CN113870156A - Image enhancement method and related equipment - Google Patents

Image enhancement method and related equipment Download PDF

Info

Publication number
CN113870156A
CN113870156A CN202110933715.2A CN202110933715A CN113870156A CN 113870156 A CN113870156 A CN 113870156A CN 202110933715 A CN202110933715 A CN 202110933715A CN 113870156 A CN113870156 A CN 113870156A
Authority
CN
China
Prior art keywords
target
image
determining
enhancement
histogram
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110933715.2A
Other languages
Chinese (zh)
Inventor
姜伟兵
郭锋
张群兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Camyu Hi Tech Devleopment Co ltd
Original Assignee
Chongqing Camyu Hi Tech Devleopment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Camyu Hi Tech Devleopment Co ltd filed Critical Chongqing Camyu Hi Tech Devleopment Co ltd
Priority to CN202110933715.2A priority Critical patent/CN113870156A/en
Publication of CN113870156A publication Critical patent/CN113870156A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses an image enhancement method and related equipment, wherein the method comprises the following steps: acquiring an image to be processed; determining a target histogram of the image to be processed; determining a target enhancement coefficient of the target histogram; and enhancing the image to be processed according to the target enhancement coefficient to obtain a target image. According to the embodiment of the application, the image enhancement can be realized according to the histogram, and the improvement of the image quality is facilitated.

Description

Image enhancement method and related equipment
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image enhancement method and related device.
Background
With the rapid development of electronic technology, photographing is becoming a standard technology of electronic devices (such as mobile phones, tablet computers, and the like). The image quality greatly affects the judgment of the user on the quality of the electronic equipment product, so the problem of how to realize image enhancement needs to be solved urgently.
Disclosure of Invention
The embodiment of the application provides an image enhancement method and related equipment, which can realize image enhancement and are beneficial to improving the image quality.
In a first aspect, an embodiment of the present application provides an image enhancement method, where the method includes:
acquiring an image to be processed;
determining a target histogram of the image to be processed;
determining a target enhancement coefficient of the target histogram;
and enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
In a second aspect, an embodiment of the present application provides an image enhancement apparatus, including: an acquisition unit, a first determination unit, a second determination unit and an enhancement unit, wherein,
the acquisition unit is used for acquiring an image to be processed;
the first determining unit is used for determining a target histogram of the image to be processed;
the second determining unit is used for determining a target enhancement coefficient of the target histogram;
and the enhancement unit is used for enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in any method of the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps as described in any one of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
By adopting the embodiment of the application, the following beneficial effects are achieved:
the image enhancement method and the related device described in the embodiment of the application can obtain the image to be processed, determine the target histogram of the image to be processed, determine the target enhancement coefficient of the target histogram, enhance the image to be processed according to the target enhancement coefficient to obtain the target image, and can determine the corresponding enhancement coefficient according to the characteristics of the histogram, so that the image enhancement is realized in a targeted manner, and the image quality is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of an image enhancement method provided in an embodiment of the present application;
FIG. 2 is a schematic flowchart of another image enhancement method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 4 is a block diagram of functional units of an image enhancement apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The electronic device related to the embodiment of the present application may include various handheld devices (Mobile phones, tablet computers, etc.) having a wireless communication function, vehicle-mounted devices, wearable devices (smart glasses, smart bracelets, smart watches, etc.), computing devices or other processing devices connected to a wireless modem, and various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and the like.
The following describes embodiments of the present application in detail.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an image enhancement method applied to an electronic device according to an embodiment of the present application.
101. And acquiring an image to be processed.
In the embodiment of the present application, the image to be processed may be a grayscale image or a color image. In specific implementation, the electronic device can shoot through the camera to obtain an image to be processed.
102. And determining a target histogram of the image to be processed.
In specific implementation, the electronic device may obtain a target histogram of the image to be processed, where the target histogram reflects essential characteristics of the image, and is further helpful for determining a corresponding enhancement coefficient according to the characteristics.
Of course, the target histogram may be a histogram of a target region in the image to be processed, and the image to be processed may be subjected to target segmentation by using an image segmentation method to obtain the target region, and obtain the target histogram corresponding to the target region, where the target segmentation method is at least one of the following: a watershed image segmentation algorithm, OTSU law, local minimum image segmentation algorithm, etc., which are not limited herein. Furthermore, local histogram enhancement can be achieved.
103. Determining a target enhancement coefficient for the target histogram.
Wherein, the histogram reflects the characteristics of the image, and further, the electronic device can determine the corresponding target enhancement coefficient through the target histogram. For example, the corresponding enhancement coefficient may be determined according to the distribution condition of the histogram, the corresponding pixels in the uniformly distributed area may not be enhanced, and the corresponding pixels in the area with large distribution difference may be enhanced, and further, local enhancement may be implemented. Of course, the overall enhancement and the local enhancement of the image can be realized according to the histogram, and then the images of the overall enhancement and the local enhancement are subjected to image fusion to obtain the final enhanced image. In addition, the whole image enhancement can be realized only according to the histogram, and then the enhanced image is subjected to fine adjustment, such as smoothing processing, so as to obtain the enhanced image.
For example, the histogram mapping rule MAP is:
Figure BDA0003212154360000041
where Bin represents the number of gray levels of an image, and is 255 as a default (1023 for an 8bi image and a 10bit image).
Result of image processing YclaheComprises the following steps:
Yclahe(i,y)=MAP(Ysym(i,j)+1)
wherein, Ysym(i, j) represents a pixel point to be processed, YclaheAnd (i, j) represents the pixel points after enhancement processing.
Optionally, in step 103, determining the target enhancement coefficient of the target histogram may include the following steps:
31. evaluating the target histogram to obtain a target evaluation value;
32. according to a mapping relation between a preset evaluation value and an enhancement coefficient, determining a reference enhancement coefficient corresponding to the target evaluation value;
33. performing mean square error operation based on the target histogram to obtain a target mean square error;
34. determining a target adjusting coefficient corresponding to the target mean square error according to a mapping relation between a preset mean square error and an adjusting coefficient;
35. and adjusting the reference enhancement coefficient based on the target adjustment coefficient to obtain the target enhancement coefficient.
In a specific implementation, a mapping relationship between a preset evaluation value and an enhancement coefficient, and a mapping relationship between a preset mean square error and an adjustment coefficient may be stored in the electronic device in advance. Specifically, since the histogram reflects the image quality to a certain extent, the electronic device may further evaluate the target histogram to obtain a target evaluation value, for example, the target contrast of the image may be determined by the histogram, the target evaluation value corresponding to the target contrast may be determined according to a mapping relationship between the contrast and the evaluation value, further, for example, the reference contrast of the image may be determined by the histogram, the reference evaluation value corresponding to the reference contrast may be determined according to a mapping relationship between the contrast and the evaluation value, the mean square error corresponding to the histogram may also be determined, and further, the target optimization coefficient corresponding to the target mean square error may be determined according to a mapping relationship between the mean square error and the optimization coefficient, in this embodiment, a value range of the optimization coefficient may be-0.2 to 0.2, and the reference evaluation value is optimized by the target optimization coefficient, a target evaluation value, specifically, (1+ target optimization coefficient) × reference evaluation value, is obtained.
Further, the electronic device may further perform a mean square error operation based on the target histogram according to a mapping relationship between a preset evaluation value and an enhancement coefficient, to determine a reference enhancement coefficient corresponding to the target evaluation value, and obtain a target mean square error, specifically, each bin in the target histogram may be abstracted to a numerical value, that is, a ratio between the number of pixels included in each bin and the total number of pixels is used as a weight of the bin, and a product between a pixel corresponding to the bin and the weight corresponding thereto is used as a numerical value corresponding to the bin, so that each bin corresponds to one numerical value, so as to obtain a plurality of numerical values, and perform the mean square error operation using the plurality of numerical values to obtain the target mean square error.
Furthermore, the electronic device may determine a target adjustment coefficient corresponding to the target mean square error according to a mapping relationship between a preset mean square error and an adjustment coefficient, in this embodiment of the application, a value range of the adjustment coefficient may be-1 to 1, for example, -0.15 to 0.15, and then adjust the reference enhancement coefficient based on the target adjustment coefficient to obtain a target enhancement coefficient, that is, the target enhancement coefficient is (1+ target adjustment coefficient) × the reference enhancement coefficient.
Optionally, in the step 31, evaluating the target histogram to obtain a target evaluation value, the method may include the following steps:
311. acquiring histogram parameters of the target histogram;
312. evaluating based on the histogram parameters to obtain a first evaluation value;
313. determining a target contrast corresponding to the target histogram;
314. determining a second evaluation value corresponding to the target contrast according to a preset mapping relation between the contrast and the evaluation value;
315. acquiring target environment parameters;
316. determining a target weight pair corresponding to the target environment parameter according to a mapping relation between a preset environment parameter and the weight pair, wherein the weight pair comprises a first weight and a second weight, and the target weight pair comprises a target first weight and a target second weight;
317. and performing weighted operation based on the target first weight, the target second weight, the first evaluation value and the second evaluation value to obtain the target evaluation value.
In specific implementation, the mapping relationship between the preset environment parameter and the weight pair, and the mapping relationship between the preset contrast and the evaluation value may be stored in the electronic device in advance. In an embodiment of the present application, the environmental parameter may be at least one of: ambient brightness, ambient color temperature, ambient humidity, ambient light brightness, etc., without limitation.
Specifically, the electronic device may obtain a histogram parameter of the target histogram, where the histogram parameter may be at least one of: the number of bins, distribution parameters of the histogram, and the like, which are not limited herein, and further, the evaluation may be performed based on the histogram parameters to obtain a first evaluation value, for example, the evaluation may be performed by the number of bins, and the quality is better as the number of bins is larger, and a target contrast corresponding to the target histogram may be determined, and a second evaluation value corresponding to the target contrast may be determined according to a preset mapping relationship between the contrast and the evaluation value;
further, the electronic device may obtain a target environment parameter, determine a target weight pair corresponding to the target environment parameter according to a mapping relationship between a preset environment parameter and the weight pair, where the weight pair includes a first weight and a second weight, and the target weight pair includes a first target weight and a second target weight, and finally perform weighted operation based on the first target weight, the second target weight, the first evaluation value, and the second evaluation value to obtain a target evaluation value, where a specific calculation formula is as follows:
a target evaluation value is the first evaluation value plus the first weight of the target and the second evaluation value plus the second weight of the target
Optionally, in the step 33, performing a mean square error operation based on the target histogram to obtain a target mean square error, which may include the following steps:
331. a peripheral contour curve of the target histogram;
332. dividing the peripheral contour curve into a plurality of segments;
333. determining an energy value of each of the plurality of segments to obtain a plurality of energy values;
334. and performing mean square error operation based on the plurality of energy values to obtain the target mean square error.
In a specific implementation, the electronic device may describe each bin of the target histogram as a point, for example, the centers of the bins may be taken and then connected to obtain a peripheral profile curve, the peripheral profile curve is divided into a plurality of segments, an energy value of each segment of the plurality of segments is determined to obtain a plurality of energy values, and a mean square error operation is performed based on the plurality of energy values to obtain a target mean square error.
104. And enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
In specific implementation, the electronic device may perform enhancement processing on the image to be processed according to the target enhancement coefficient to obtain a target image, that is, perform global enhancement on the image to be processed to improve the image quality.
Optionally, in the step 104, performing enhancement processing on the image to be processed according to the target enhancement coefficient to obtain a target image, which may include the following steps:
41. performing target extraction on the image to be processed to obtain a target area;
42. determining the center of the target area;
43. acquiring a pixel point i, wherein the pixel point i is any pixel point of the image to be processed;
44. determining a target Euclidean distance between the pixel point i and the center;
45. determining a target fine tuning coefficient corresponding to the target Euclidean distance according to a mapping relation between a preset Euclidean distance and the fine tuning coefficient;
46. adjusting the target enhancement coefficient based on the target fine tuning coefficient to obtain an enhancement coefficient corresponding to the pixel point i;
47. and enhancing the pixel point i based on the enhancement coefficient corresponding to the pixel point i.
In the embodiment of the application, the electronic device may store a mapping relationship between a preset euclidean distance and a fine tuning coefficient in advance.
In the specific implementation, the electronic device may perform target extraction on an image to be processed to obtain a target area, and may further determine a center of the target area, and further obtain a pixel point i, where the pixel point i is any pixel point of the image to be processed, and may determine a target euclidean distance between the pixel point i and the center, and according to a mapping relationship between a preset euclidean distance and a fine tuning coefficient, a value range of the fine tuning coefficient may be-1 to 1, for example, -0.1 to 0.1, determine a target fine tuning coefficient corresponding to the target euclidean distance, and adjust a target enhancement coefficient based on the target fine tuning coefficient to obtain an enhancement coefficient corresponding to the pixel point i, where a specific calculation formula is as follows:
the enhancement coefficient corresponding to the pixel point i is equal to (1+ target fine tuning coefficient) target enhancement coefficient
Further, the electronic device can perform enhancement processing on the pixel point i based on the enhancement coefficient corresponding to the pixel point i, and then perform differentiation enhancement on different pixel points.
The image enhancement method described in the embodiment of the application can be seen in that the image to be processed is obtained, the target histogram of the image to be processed is determined, the target enhancement coefficient of the target histogram is determined, the image to be processed is enhanced according to the target enhancement coefficient to obtain the target image, the corresponding enhancement coefficient can be determined according to the characteristics of the histogram, and therefore image enhancement is achieved in a targeted manner, and the image quality is improved.
Referring to fig. 2, fig. 2 is a schematic flowchart of an image enhancement method applied to an electronic device according to an embodiment of the present application, where the image enhancement method is consistent with the embodiment shown in fig. 1.
201. And acquiring an image to be processed.
202. And acquiring target environment parameters and target shooting parameters of the image to be processed.
203. And determining reference shooting parameters corresponding to the target environment parameters according to a mapping relation between preset environment parameters and the shooting parameters.
204. And determining the target deviation degree between the target shooting parameter and the reference shooting parameter.
205. And when the target deviation degree is greater than a preset threshold value, determining a target histogram of the image to be processed.
206. Determining a target enhancement coefficient for the target histogram.
207. And enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
In the embodiment of the present application, the preset threshold may be set by a user or default by a system. In an embodiment of the present application, the environmental parameter may be at least one of: ambient brightness, ambient color temperature, ambient humidity, barometric pressure value, etc., without limitation. The shooting parameter may be at least one of: sensitivity ISO, focal length, zoom parameter, exposure time, white balance value, beauty parameter, and the like, which are not limited herein.
In the specific implementation, the electronic device may obtain a target environment parameter and a target shooting parameter of an image to be processed, determine a reference shooting parameter corresponding to the target environment parameter according to a mapping relationship between a preset environment parameter and the shooting parameter, and may further determine a target deviation between the target shooting parameter and the reference shooting parameter, where the target deviation is | the target shooting parameter-the reference shooting parameter |/the reference shooting parameter, and when the target deviation is greater than a preset threshold, it indicates that the image quality may not be good, and image enhancement needs to be performed, that is, image enhancement is implemented through a histogram.
For the detailed description of the steps 201 to 207, reference may be made to the corresponding steps of the image enhancement method described in fig. 1, and details are not repeated here.
It can be seen that, the image enhancement method described in the embodiment of the present application obtains an image to be processed, obtains a target environment parameter and a target shooting parameter of the image to be processed, determines a reference shooting parameter corresponding to the target environment parameter according to a mapping relationship between a preset environment parameter and the shooting parameter, determines a target deviation degree between the target shooting parameter and the reference shooting parameter, determines a target histogram of the image to be processed when the target deviation degree is greater than a preset threshold value, determines a target enhancement coefficient of the target histogram, performs enhancement processing on the image to be processed according to the target enhancement coefficient to obtain the target image, and can determine a corresponding enhancement coefficient according to characteristics of the histogram, thereby achieving image enhancement in a targeted manner and contributing to improvement of image quality.
Consistent with the embodiments shown in fig. 1 and fig. 2, please refer to fig. 3, and fig. 3 is a schematic structural diagram of an electronic device 300 according to an embodiment of the present application, as shown in the figure, the electronic device 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321, where the one or more programs 321 are stored in the memory 320 and configured to be executed by the processor 310, and the one or more programs 321 include instructions for performing any step of the method embodiments:
acquiring an image to be processed;
determining a target histogram of the image to be processed;
determining a target enhancement coefficient of the target histogram;
and enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
It can be seen that, in the electronic device described in the embodiment of the present application, an image to be processed is acquired, a target histogram of the image to be processed is determined, a target enhancement coefficient of the target histogram is determined, the image to be processed is enhanced according to the target enhancement coefficient, a target image is obtained, and a corresponding enhancement coefficient can be determined according to characteristics of the histogram, so that image enhancement is achieved in a targeted manner, and image quality is improved.
Optionally, the enhancing the image to be processed according to the target enhancement coefficient to obtain a target image includes:
performing target extraction on the image to be processed to obtain a target area;
determining the center of the target area;
acquiring a pixel point i, wherein the pixel point i is any pixel point of the image to be processed;
determining a target Euclidean distance between the pixel point i and the center;
determining a target fine tuning coefficient corresponding to the target Euclidean distance according to a mapping relation between a preset Euclidean distance and the fine tuning coefficient;
adjusting the target enhancement coefficient based on the target fine tuning coefficient to obtain an enhancement coefficient corresponding to the pixel point i;
and enhancing the pixel point i based on the enhancement coefficient corresponding to the pixel point i.
Optionally, the determining a target enhancement coefficient of the target histogram includes:
evaluating the target histogram to obtain a target evaluation value;
according to a mapping relation between a preset evaluation value and an enhancement coefficient, determining a reference enhancement coefficient corresponding to the target evaluation value;
performing mean square error operation based on the target histogram to obtain a target mean square error;
determining a target adjusting coefficient corresponding to the target mean square error according to a mapping relation between a preset mean square error and an adjusting coefficient;
and adjusting the reference enhancement coefficient based on the target adjustment coefficient to obtain the target enhancement coefficient.
Optionally, the evaluating the target histogram to obtain a target evaluation value includes:
acquiring histogram parameters of the target histogram;
evaluating based on the histogram parameters to obtain a first evaluation value;
determining a target contrast corresponding to the target histogram;
determining a second evaluation value corresponding to the target contrast according to a preset mapping relation between the contrast and the evaluation value;
acquiring target environment parameters;
determining a target weight pair corresponding to the target environment parameter according to a mapping relation between a preset environment parameter and the weight pair, wherein the weight pair comprises a first weight and a second weight, and the target weight pair comprises a target first weight and a target second weight;
and performing weighted operation based on the target first weight, the target second weight, the first evaluation value and the second evaluation value to obtain the target evaluation value.
Optionally, the performing a mean square error operation based on the target histogram to obtain a target mean square error includes:
a peripheral contour curve of the target histogram;
dividing the peripheral contour curve into a plurality of segments;
determining an energy value of each of the plurality of segments to obtain a plurality of energy values;
and performing mean square error operation based on the plurality of energy values to obtain the target mean square error.
Fig. 4 is a block diagram of functional units of an image enhancement apparatus 400 according to an embodiment of the present application. The image enhancement device 400 is applied to an electronic device, and the image enhancement device 400 comprises: an acquisition unit 401, a first determination unit 402, a second determination unit 403, and an enhancement unit 404, wherein,
the acquiring unit 401 is configured to acquire an image to be processed;
the first determining unit 402 is configured to determine a target histogram of the image to be processed;
the second determining unit 403 is configured to determine a target enhancement coefficient of the target histogram;
the enhancing unit 404 is configured to perform enhancement processing on the image to be processed according to the target enhancement coefficient to obtain a target image.
It can be seen that, the image enhancement device described in the embodiment of the present application obtains an image to be processed, determines a target histogram of the image to be processed, determines a target enhancement coefficient of the target histogram, performs enhancement processing on the image to be processed according to the target enhancement coefficient to obtain a target image, and can determine a corresponding enhancement coefficient according to characteristics of the histogram, thereby achieving image enhancement in a targeted manner, and contributing to improvement of image quality.
Optionally, in respect that the enhancement processing is performed on the image to be processed according to the target enhancement coefficient to obtain a target image, the enhancement unit 404 is specifically configured to:
performing target extraction on the image to be processed to obtain a target area;
determining the center of the target area;
acquiring a pixel point i, wherein the pixel point i is any pixel point of the image to be processed;
determining a target Euclidean distance between the pixel point i and the center;
determining a target fine tuning coefficient corresponding to the target Euclidean distance according to a mapping relation between a preset Euclidean distance and the fine tuning coefficient;
adjusting the target enhancement coefficient based on the target fine tuning coefficient to obtain an enhancement coefficient corresponding to the pixel point i;
and enhancing the pixel point i based on the enhancement coefficient corresponding to the pixel point i.
Optionally, in the aspect of determining the target enhancement coefficient of the target histogram, the second determining unit 403 is specifically configured to:
evaluating the target histogram to obtain a target evaluation value;
according to a mapping relation between a preset evaluation value and an enhancement coefficient, determining a reference enhancement coefficient corresponding to the target evaluation value;
performing mean square error operation based on the target histogram to obtain a target mean square error;
determining a target adjusting coefficient corresponding to the target mean square error according to a mapping relation between a preset mean square error and an adjusting coefficient;
and adjusting the reference enhancement coefficient based on the target adjustment coefficient to obtain the target enhancement coefficient.
Optionally, in respect to the evaluating the target histogram to obtain a target evaluation value, the second determining unit 403 is specifically configured to:
acquiring histogram parameters of the target histogram;
evaluating based on the histogram parameters to obtain a first evaluation value;
determining a target contrast corresponding to the target histogram;
determining a second evaluation value corresponding to the target contrast according to a preset mapping relation between the contrast and the evaluation value;
acquiring target environment parameters;
determining a target weight pair corresponding to the target environment parameter according to a mapping relation between a preset environment parameter and the weight pair, wherein the weight pair comprises a first weight and a second weight, and the target weight pair comprises a target first weight and a target second weight;
and performing weighted operation based on the target first weight, the target second weight, the first evaluation value and the second evaluation value to obtain the target evaluation value.
Optionally, in the aspect of performing a mean square error operation based on the target histogram to obtain a target mean square error, the second determining unit 403 is specifically configured to:
a peripheral contour curve of the target histogram;
dividing the peripheral contour curve into a plurality of segments;
determining an energy value of each of the plurality of segments to obtain a plurality of energy values;
and performing mean square error operation based on the plurality of energy values to obtain the target mean square error.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method of image enhancement, the method comprising:
acquiring an image to be processed;
determining a target histogram of the image to be processed;
determining a target enhancement coefficient of the target histogram;
and enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
2. The method according to claim 1, wherein the enhancing the image to be processed according to the target enhancement coefficient to obtain a target image comprises:
performing target extraction on the image to be processed to obtain a target area;
determining the center of the target area;
acquiring a pixel point i, wherein the pixel point i is any pixel point of the image to be processed;
determining a target Euclidean distance between the pixel point i and the center;
determining a target fine tuning coefficient corresponding to the target Euclidean distance according to a mapping relation between a preset Euclidean distance and the fine tuning coefficient;
adjusting the target enhancement coefficient based on the target fine tuning coefficient to obtain an enhancement coefficient corresponding to the pixel point i;
and enhancing the pixel point i based on the enhancement coefficient corresponding to the pixel point i.
3. The method according to claim 1 or 2, wherein the determining the target enhancement coefficient of the target histogram comprises:
evaluating the target histogram to obtain a target evaluation value;
according to a mapping relation between a preset evaluation value and an enhancement coefficient, determining a reference enhancement coefficient corresponding to the target evaluation value;
performing mean square error operation based on the target histogram to obtain a target mean square error;
determining a target adjusting coefficient corresponding to the target mean square error according to a mapping relation between a preset mean square error and an adjusting coefficient;
and adjusting the reference enhancement coefficient based on the target adjustment coefficient to obtain the target enhancement coefficient.
4. The method of claim 3, wherein said evaluating the target histogram to obtain a target evaluation value comprises:
acquiring histogram parameters of the target histogram;
evaluating based on the histogram parameters to obtain a first evaluation value;
determining a target contrast corresponding to the target histogram;
determining a second evaluation value corresponding to the target contrast according to a preset mapping relation between the contrast and the evaluation value;
acquiring target environment parameters;
determining a target weight pair corresponding to the target environment parameter according to a mapping relation between a preset environment parameter and the weight pair, wherein the weight pair comprises a first weight and a second weight, and the target weight pair comprises a target first weight and a target second weight;
and performing weighted operation based on the target first weight, the target second weight, the first evaluation value and the second evaluation value to obtain the target evaluation value.
5. The method of claim 3, wherein performing a mean square error operation based on the target histogram to obtain a target mean square error comprises:
a peripheral contour curve of the target histogram;
dividing the peripheral contour curve into a plurality of segments;
determining an energy value of each of the plurality of segments to obtain a plurality of energy values;
and performing mean square error operation based on the plurality of energy values to obtain the target mean square error.
6. An image enhancement apparatus, characterized in that the apparatus comprises: an acquisition unit, a first determination unit, a second determination unit and an enhancement unit, wherein,
the acquisition unit is used for acquiring an image to be processed;
the first determining unit is used for determining a target histogram of the image to be processed;
the second determining unit is used for determining a target enhancement coefficient of the target histogram;
and the enhancement unit is used for enhancing the image to be processed according to the target enhancement coefficient to obtain a target image.
7. The apparatus according to claim 6, wherein in the aspect that the target image is obtained by performing enhancement processing on the image to be processed according to the target enhancement coefficient, the enhancement unit is specifically configured to:
performing target extraction on the image to be processed to obtain a target area;
determining the center of the target area;
acquiring a pixel point i, wherein the pixel point i is any pixel point of the image to be processed;
determining a target Euclidean distance between the pixel point i and the center;
determining a target fine tuning coefficient corresponding to the target Euclidean distance according to a mapping relation between a preset Euclidean distance and the fine tuning coefficient;
adjusting the target enhancement coefficient based on the target fine tuning coefficient to obtain an enhancement coefficient corresponding to the pixel point i;
and enhancing the pixel point i based on the enhancement coefficient corresponding to the pixel point i.
8. The apparatus according to claim 6 or 7, wherein, in said determining the target enhancement coefficient of the target histogram, the second determining unit is specifically configured to:
evaluating the target histogram to obtain a target evaluation value;
according to a mapping relation between a preset evaluation value and an enhancement coefficient, determining a reference enhancement coefficient corresponding to the target evaluation value;
performing mean square error operation based on the target histogram to obtain a target mean square error;
determining a target adjusting coefficient corresponding to the target mean square error according to a mapping relation between a preset mean square error and an adjusting coefficient;
and adjusting the reference enhancement coefficient based on the target adjustment coefficient to obtain the target enhancement coefficient.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-5.
CN202110933715.2A 2021-08-15 2021-08-15 Image enhancement method and related equipment Pending CN113870156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110933715.2A CN113870156A (en) 2021-08-15 2021-08-15 Image enhancement method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110933715.2A CN113870156A (en) 2021-08-15 2021-08-15 Image enhancement method and related equipment

Publications (1)

Publication Number Publication Date
CN113870156A true CN113870156A (en) 2021-12-31

Family

ID=78990314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110933715.2A Pending CN113870156A (en) 2021-08-15 2021-08-15 Image enhancement method and related equipment

Country Status (1)

Country Link
CN (1) CN113870156A (en)

Similar Documents

Publication Publication Date Title
CN108777815B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN107862265B (en) Image processing method and related product
CN107679482B (en) Unlocking control method and related product
CN108234882B (en) Image blurring method and mobile terminal
CN107679481B (en) Unlocking control method and related product
CN103973988A (en) Scene recognition method and device
CN107690804B (en) Image processing method and user terminal
CN111507298B (en) Face detection method, device, computer equipment and storage medium
CN112419167A (en) Image enhancement method, device and storage medium
CN115496668A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111028276A (en) Image alignment method and device, storage medium and electronic equipment
CN113411498A (en) Image shooting method, mobile terminal and storage medium
CN111709894B (en) Image processing method, image processing device, electronic equipment and storage medium
CN111080665B (en) Image frame recognition method, device, equipment and computer storage medium
CN111696058A (en) Image processing method, device and storage medium
CN109615620B (en) Image compression degree identification method, device, equipment and computer readable storage medium
CN114298935A (en) Image enhancement method, device and computer readable storage medium
CN113807166B (en) Image processing method, device and storage medium
CN110717864A (en) Image enhancement method and device, terminal equipment and computer readable medium
CN114429476A (en) Image processing method, image processing apparatus, computer device, and storage medium
CN112070682A (en) Method and device for compensating image brightness
CN111787310B (en) Anti-shake performance testing method and device, computer equipment and storage medium
CN108805883B (en) Image segmentation method, image segmentation device and electronic equipment
CN115115552B (en) Image correction model training method, image correction device and computer equipment
CN116645282A (en) Data processing method and system based on big data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication