CN111899182A - Color enhancement method and device - Google Patents

Color enhancement method and device Download PDF

Info

Publication number
CN111899182A
CN111899182A CN201910370040.8A CN201910370040A CN111899182A CN 111899182 A CN111899182 A CN 111899182A CN 201910370040 A CN201910370040 A CN 201910370040A CN 111899182 A CN111899182 A CN 111899182A
Authority
CN
China
Prior art keywords
value
pixel point
brightness
hue
target
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.)
Granted
Application number
CN201910370040.8A
Other languages
Chinese (zh)
Other versions
CN111899182B (en
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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201910370040.8A priority Critical patent/CN111899182B/en
Publication of CN111899182A publication Critical patent/CN111899182A/en
Application granted granted Critical
Publication of CN111899182B publication Critical patent/CN111899182B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • 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/10024Color image

Landscapes

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

Abstract

The application provides a color enhancement method and a color enhancement device, and relates to the technical field of image processing. The method comprises the following steps: converting the obtained first target image from an RGB color space to an HSV color space to obtain a second target image; dividing all pixel points of the second target image into first pixel points and second pixel points according to the determined target enhancement color; performing brightness enhancement processing on the first pixel point according to a tone influence factor corresponding to the tone value of the first pixel point and the brightness value of the first pixel point; performing saturation enhancement processing on the first pixel points with enhanced brightness to obtain a processed second target image; and converting the processed second target image from HSV color space to RGB color space to obtain a third target image. Therefore, the problem that the target enhancement color is not bright due to the scene itself can be effectively solved by enhancing the brightness and the saturation of the pixel point corresponding to the target enhancement color.

Description

Color enhancement method and device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a color enhancement method and apparatus.
Background
With the continuous development of digital camera technology, people have higher and higher requirements on image effects, and people want to shoot images more vivid. Currently, a green enhancement algorithm is generally used to perform green enhancement on an image. Most of the green enhancement algorithms adopt a mode of only adjusting saturation, and the image processed by the mode has the problem of color cast or dark green (namely, the green is not bright).
Disclosure of Invention
In order to overcome the above deficiencies in the prior art, an object of the embodiments of the present application is to provide a color enhancement method and apparatus, which can, after determining a pixel corresponding to a target enhancement color, enhance the brightness of the pixel in combination with the influence of hue and brightness on the target enhancement color, and enhance the saturation, thereby effectively improving the image effect of a color camera in a scene with the target enhancement color, and obtaining a vivid and lively image with the target enhancement color.
In a first aspect, an embodiment of the present application provides a color enhancement method, including:
obtaining a first target image, and converting the first target image from an RGB color space to an HSV color space to obtain a second target image;
dividing all pixel points of the second target image into first pixel points and second pixel points according to the determined target enhancement color and the tone value of each pixel point of the second target image, wherein the first pixel points are pixel points to be processed in the second target image;
performing brightness enhancement processing on the first pixel point according to a tone influence factor corresponding to the tone value of the first pixel point and the brightness value of the first pixel point;
performing saturation enhancement processing on the first pixel points with enhanced brightness to obtain a processed second target image;
and converting the processed second target image from HSV color space to RGB color space to obtain a third target image.
In a second aspect, an embodiment of the present application provides a color enhancement apparatus, including:
the conversion module is used for obtaining a first target image and converting the first target image from an RGB color space to an HSV color space to obtain a second target image;
the judging module is used for dividing all pixel points of the second target image into first pixel points and second pixel points according to the determined target enhancement color and the tone value of each pixel point of the second target image, wherein the first pixel points are pixel points to be processed in the second target image;
the brightness enhancement module is used for carrying out brightness enhancement processing on the first pixel point according to the tone influence factor corresponding to the tone value of the first pixel point and the brightness value of the first pixel point;
the saturation enhancement module is used for performing saturation enhancement processing on the first pixel points after the brightness enhancement to obtain a processed second target image;
the conversion module is further configured to convert the processed second target image from an HSV color space to an RGB color space, so as to obtain a third target image.
Compared with the prior art, the method has the following beneficial effects:
after a first target image needing color enhancement is obtained, converting the first target image from an RGB color space to an HSV color space to obtain a second target image. And then, sequentially judging whether each pixel point is a pixel point to be processed or not according to the determined target enhancement color and the tone value of each pixel point in the second target image, so that all the pixel points in the second target image are divided into second pixel points and first pixel points serving as the pixel points to be processed. And then, carrying out brightness enhancement processing on the first pixel point by combining the hue influence factor corresponding to the hue value of the first pixel point, and carrying out saturation enhancement processing on the first pixel point after brightness enhancement to obtain a processed second target image. And finally, converting the processed second target image from HSV color space to RGB color space to obtain a third target image. Therefore, the influence of the hue and the brightness on the target enhanced color is combined, the brightness of the pixel points corresponding to the target enhanced color is enhanced, and the saturation of the pixel points is enhanced, so that the image effect is effectively improved, and the vivid and vivid image of the target enhanced color is obtained.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a block schematic diagram of an electronic device provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a color enhancement method provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of an HSV color space model;
FIG. 4 is one of the flow diagrams of the sub-steps included in step S130 of FIG. 2;
FIG. 5 is a second schematic flow chart of the sub-steps included in step S130 of FIG. 2;
FIG. 6 is a schematic flow chart of step S140 of FIG. 2 including sub-steps;
FIG. 7 is a schematic flow chart of sub-steps included in sub-step S143 of FIG. 6;
fig. 8 is a block diagram of a color enhancement device provided in an embodiment of the present application.
Icon: 100-an electronic device; 110-a memory; 120-a memory controller; 130-a processor; 200-a color enhancement device; 210-a conversion module; 220-a judgment module; 230-a brightness enhancement module; 240-saturation enhancement module.
Detailed Description
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. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
In the prior art, a hardware mode or a software mode is generally adopted to process an image, so that the effect of color enhancement is achieved. For example, when the hardware method is used to perform green enhancement, the input image color difference signals Cb and Cr are subjected to color axis rotation by the reference axis unit, so that the input image color difference signals Cb and Cr are rotated to a chromaticity space with the most saturated green as the vertical axis; then, the enhanced region judgment unit judges that the rotated chrominance vector is in a corresponding adjustment region of a chrominance space and is divided into four regions; and the saturation enhancement unit performs saturation enhancement on the current chrominance signal according to the control parameter and the user configuration parameter, so that the effect of green enhancement is achieved. The method needs hardware implementation and is high in cost; moreover, only the saturation is adjusted to enhance the green color, and the influence of the brightness on the green color is not considered, so that the processed image still has the problem of dark green color.
The software enhancement algorithm based on the color space mainly comprises the following steps: r, G, B monochrome channel two-dimensional histogram equalization, two-dimensional histogram specification, and color space three-dimensional histogram equalization. The algorithm can enhance the brightness of the image, so that the image is more vivid and the color is more bright. However, the above algorithm is based on RGB (red, green, blue) color space, acting on R, G, B components individually, and not considering the strong correlation between the components of the color image R, G, B, changing any component of a pixel changes the proportion of R, G, B three components, easily resulting in color distortion.
The defects existing in the above solutions are the results obtained after the inventors have experimented and studied, and therefore, the discovery process of the above problems and the solutions proposed by the following embodiments of the present application for the above problems should be the contributions of the inventors to the present application in the process of the present application.
Referring to fig. 1, fig. 1 is a block diagram of an electronic device 100 according to an embodiment of the present disclosure. The electronic device 100 may be, but is not limited to, a smart phone, a tablet, a camera, etc. The electronic device 100 may combine the influence of the hue and brightness on the target enhanced color to construct a brightness enhancement relationship suitable for human eye effects, so as to enhance the brightness of the pixel points corresponding to the target enhanced color in the image, and enhance the saturation, so as to obtain a vivid and lively image with the target enhanced color.
As shown in fig. 1, the electronic device 100 may include: memory 110, memory controller 120, processor 130, and color enhancement device 200. The elements of the memory 110, the memory controller 120 and the processor 130 are electrically connected directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The memory 110 stores therein a color enhancement device 200, the color enhancement device 200 including at least one software functional module that can be stored in the memory 110 in the form of software or firmware (firmware). The processor 130 executes various functional applications and data processing, i.e., implements the color enhancement method in the embodiment of the present application, by running software programs and modules stored in the memory 110, such as the color enhancement device 200 in the embodiment of the present application.
The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 110 is used for storing a program, and the processor 130 executes the program after receiving the execution instruction. Access to the memory 110 by the processor 130 and possibly other components may be under the control of the memory controller 120.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor 130 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like. But may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be appreciated that the configuration shown in FIG. 1 is merely illustrative and that electronic device 100 may include more or fewer components than shown in FIG. 1 or have a different configuration than shown in FIG. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Referring to fig. 2, fig. 2 is a schematic flow chart of a color enhancement method according to an embodiment of the present application. The method is applied to the electronic device 100. The specific flow of the color enhancement method is described in detail below.
Step S110, a first target image is obtained, and the first target image is converted from an RGB color space to an HSV color space, so that a second target image is obtained.
In this embodiment, the electronic device 100 may store a plurality of images, and determine the first target image from the plurality of images according to the received selection operation. Alternatively, the received image transmitted by another device may be taken as the first target image. Alternatively, the electronic device 100 further includes a camera, and an image obtained by the camera is used as the first target image. It is understood that the above-mentioned method is only an example, and the first target image may be obtained by other methods.
The color space is a functional representation of a range of colors. Common color space models include RGB, YUV (luminance, color difference), HSV, and other color space models. HSV is Hue (Hue), Saturation (Saturation), and lightness (Value). Because R, G, B components in the RGB color space have high correlation, a color cast phenomenon easily occurs during adjustment, while the HSV color space more conforms to the perception and interpretation manner of human eyes on colors, and the correlation of each component is small, each component can be independently processed, and the spatial model thereof is a hexagonal pyramid shown in fig. 3. In addition, in the HSV color space, the pixel points to be subjected to color enhancement can be easily screened. In the present embodiment, color enhancement is performed in the HSV color space.
Optionally, after obtaining the first target image, the first target image may be converted from an RGB color space to an HSV color space according to R, G, B components of each pixel point in the first target image and the following conversion formula, so as to obtain a second target image. Wherein, the conversion formula is:
Figure BDA0002049625790000071
Figure BDA0002049625790000081
v=max (3)
wherein h represents the hue value of a pixel point, r represents the red component value of the pixel point, g represents the green component value of the pixel point, b represents the blue component value of the pixel point, the value ranges of r, g and b are [0,255], max represents the maximum value of the r, g and b component values in the pixel point, min represents the minimum value of the r, g and b component values in the pixel point, and undefined represents undefined.
Step S120, dividing all the pixels of the second target image into first pixels and second pixels according to the determined target enhancement color and the hue value of each pixel of the second target image.
As shown in fig. 3, the H (hue) component is a chromaticity component reflecting the spectral wavelength closest to the color, and its value is represented by an angle in the range of [0 °,360 ° ], and the angle value of red is 0 °, the angle value of yellow is 60 °, the angle value of green is 120 °, the angle value of cyan is 180 °, the angle value of blue is 240 °, and the angle value of magenta is 300 ° calculated counterclockwise from red. After the second target image is obtained, each pixel point in the second target image can be traversed according to the determined target enhancement color so as to judge whether each pixel point is a pixel point needing color enhancement, and therefore all the pixel points in the second target image are divided into two types according to the hue value of each pixel point: the first pixel point and the second pixel point. The first pixel points are pixel points to be subjected to color enhancement processing in the second target image target, and the second pixel points are pixel points which do not need color enhancement. The target enhancement color may be set by a user, or may be automatically determined by the electronic device 100, which is not specifically limited herein. The specific color of the target enhancement color is determined according to actual requirements, for example, the target enhancement color is green or blue.
Optionally, in an implementation manner of this embodiment, a manner of determining whether each pixel is a pixel that needs to be color-enhanced is as follows: judging whether the tone value of the pixel point is within a preset tone value range corresponding to the target enhanced color; if the hue value of the pixel point is within the preset hue value range, the pixel point is judged to be the first pixel point; and if the hue value of the pixel point is not within the preset hue value range, judging the pixel point as the second pixel point. The preset hue value range corresponding to the target enhancement color can be set according to actual requirements, and the range represents different target enhancement colors. To ensure the color enhancement effect, the preset hue value range corresponding to the target enhancement color may be that the target enhancement color is deflected by the same angle from left to right with the hue value of the target enhancement color as the center, and the deflected same angle is smaller than the preset angle, for example, smaller than 60 degrees.
Taking the target enhancement color as green as an example, how to screen out the first pixel point is illustrated below.
The hue value of green is 120 degrees, and the corresponding preset hue value range may be set to [90 °,150 ° ], [100 °,140 ° ] and the like to represent different green colors, e.g., pure green, apple green, and the like. Preferably, the preset hue value range for green is set to [90 °,150 ° ]. And comparing the hue value of each pixel point in the second target image with the preset hue value range in sequence, and judging whether the hue value of each pixel point is set in the preset hue value range. If the hue value of a pixel point is within the preset hue value range, the pixel point is a green point needing color enhancement processing, and the pixel point is a first pixel point. If the hue value of a pixel is not within the preset hue value range, the pixel is represented to be a second pixel without subsequent color enhancement processing. Therefore, the pixel points needing to be processed can be found from the second target image.
Step S130, performing brightness enhancement processing on the first pixel point according to the hue influence factor corresponding to the hue value of the first pixel point and the brightness value of the first pixel point.
In this embodiment, for the first pixel corresponding to the target enhanced color (i.e., the pixel having the hue value within the preset hue value range), the visual characteristic is considered, and the adjustment of the brightness is performed such that the smaller the brightness value, the larger the adjustment ratio is, and the larger the brightness value, the smaller the adjustment ratio is, so that the enhanced target enhanced color is more harmonious with the whole picture. And when the tone value of the first pixel point is in different tone area ranges, the contribution value to the target enhanced color is different. Wherein the contribution value of the hue value to the target enhancement color may be expressed in a hue impact factor. Alternatively, the contribution value of each component in the hue (i.e. R, G, B components of the pixel point corresponding to each hue value in the RGB color space) is approximately close to a gaussian curve, and a gaussian function may be used to construct the hue influence factor. And for the first pixel points falling into the range of different hue regions, performing brightness enhancement by using different proportions. The hue value of the first pixel point in different hue intervals accords with a Gaussian curve, and a Gaussian function hue-N (mu, sigma) can be adopted2) Architectural colourAnd adjusting the constraint relation of the brightness to enhance the brightness. The above method can combine the influence of the hue and the brightness on the target enhanced color, construct the brightness enhancement relationship suitable for the human visual effect, and increase the saturation dynamic range.
Therefore, for a certain first pixel point, firstly, a hue influence factor corresponding to the hue value of the first pixel point and a brightness adjustment proportion corresponding to the brightness value of the first pixel point are obtained, and then brightness enhancement processing is carried out on the first pixel point according to the hue influence factor, the brightness adjustment proportion and the brightness value of the first pixel point. The process is repeated, and then the brightness enhancement processing of all the first pixel points can be completed.
In this embodiment, referring to fig. 4, fig. 4 is one of the flow diagrams of the sub-steps included in step S130 in fig. 2. Step S130 may include sub-step S132 to sub-step S135.
And a substep S132, obtaining a tone influence factor corresponding to the tone value of the first pixel point.
The hue influence factor is not less than 1. Alternatively, the hue influence factor may be obtained by, but not limited to, performing table lookup in a preset lookup table including different hue values and corresponding hue influence factors, or by calculating through a predetermined calculation formula. In one mode of this embodiment, the hue influence factor is obtained by calculation according to a hue value of the first pixel and a first preset calculation formula, where the first preset calculation formula is a gaussian function formula related to the hue value. As an embodiment, the first preset calculation formula is:
Figure BDA0002049625790000111
where f (hue) denotes the hue impact factor, i denotes the number of target enhancement colors, n denotes the total number of enhancement colors, hue denotes the hue value,
Figure BDA0002049625790000112
representing the hue value of the target enhancement color, sigma representing the adjustmentThe degree of flattening. Sigma can be set according to actual requirements.
For example, if the color capable of enhancement is red, green, and blue, the total number of the color capable of enhancement is 3, where i is 0, and 1 and 2 represent the numbers of the three basic hues of red, green, and blue. If the colors that can be enhanced are red, yellow, green, cyan, blue, and magenta, the total number of colors that can be enhanced is 6, and in this case, i is 0, and 1,2,3,4, and 5i represent the numbers of 6 basic hues of red, yellow, green, cyan, blue, and magenta. Therefore, the number of the target enhanced colors and the total number of the enhanced colors can be determined according to actual requirements.
And a substep S133, obtaining a brightness adjustment ratio corresponding to the brightness value of the first pixel point.
Wherein the brightness adjustment proportion is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment proportion is not less than 1.
And a substep S134, calculating a target brightness value of the first pixel point according to the hue influence factor, the brightness adjustment proportion and the brightness value of the first pixel point.
Optionally, the target brightness value of the first pixel point is obtained through calculation according to the hue influence factor, the brightness adjustment ratio, the brightness value of the first pixel point and a second preset calculation formula. The second preset calculation formula is as follows:
Figure BDA0002049625790000113
wherein v isoutRepresenting a target brightness value, vinRepresents the brightness value, K1Denotes a luminance adjustment factor, and f (hue) denotes a hue influence factor. K1The brightness control device is used for artificially controlling the brightness degree and generally takes the value of 6.
In the substep S135, the brightness value of the first pixel point is adjusted to the target brightness value for brightness enhancement.
When the brightness value is larger than a certain value, the image color is too bright due to the enhancement processing of the image brightness, the visual impact on people is large, and the image color is distorted. Optionally, before performing the sub-step S135, it may be determined whether to increase the brightness value of each first pixel according to the brightness value of the first pixel. Referring to fig. 5, fig. 5 is a second schematic flowchart of the sub-steps included in step S130 in fig. 2. Step S130 may also include sub-step S131 and sub-step S136.
The substep S131 determines whether the brightness value of the first pixel point is within a first preset brightness adjustment range.
If the brightness value of the first pixel point is within the first preset brightness adjustment range, the brightness value of the first pixel point can be increased. If the brightness value of the first pixel point is not within the first preset brightness adjustment range, it indicates that after the brightness value of the first pixel point is increased, the color is too bright, so that the color is distorted, and at this time, the brightness value of the first pixel point is not increased, i.e., substep S136 is performed: and not performing brightness enhancement processing on the first pixel point. Wherein, optionally, the first preset brightness adjustment may be set to [0,210 ]. Thus, it can be ensured that the region corresponding to the target enhancement color is not too bright.
After step S130 is performed, the process proceeds to step S140 to perform saturation enhancement processing.
Step S140, performing saturation enhancement processing on the first pixel point with enhanced brightness to obtain a processed second target image.
Referring to fig. 6, fig. 6 is a flowchart illustrating the substeps included in step S140 in fig. 2. Step S140 may include substeps S141 to S144.
In the substep S141, a saturation adjustment factor corresponding to the saturation value of the first pixel point is obtained.
As can be seen from the HSV color space model shown in fig. 3, there is a certain coupling relationship between the brightness and the saturation, and the saturation adjustment factor is obtained according to the coupling relationship. Optionally, the manner of obtaining the saturation adjustment factor is: when the brightness value of the first pixel point is within a second preset brightness adjustment range, calculating according to the brightness value of the first pixel point and a target brightness value after brightness enhancement to obtain a saturation adjustment factor;
Figure BDA0002049625790000131
alpha meterIndicating a saturation adjustment factor; and when the brightness value of the first pixel point is not in the second preset brightness adjustment range, the saturation adjustment factor corresponding to the hue value of the first pixel point is 1. Wherein the saturation adjustment factor is not less than 1. The first preset brightness adjustment range and the second preset brightness adjustment range can be the same or different and can be set according to actual requirements.
And a substep S142, obtaining a hue influence factor corresponding to the hue value of the first pixel point.
Wherein the hue influence factor is not less than 1. The detailed description about the substep S142 may refer to the above description about the substep S142.
And a substep S143, calculating a target saturation value of the first pixel point according to the hue influence factor, the saturation adjustment factor and the saturation value of the first pixel point.
Referring to fig. 7, fig. 7 is a flowchart illustrating the sub-steps included in sub-step S143 in fig. 6. Sub-step S143 may include sub-step S1431.
And a substep S1431, calculating to obtain a target saturation reference value according to the hue influence factor, the saturation adjustment factor, the saturation value of the first pixel point and a third preset calculation formula. The third preset calculation formula is as follows:
Sout1=Sin×α×f(hue)×K2(6)
wherein S isout1Representing a target saturation reference value, SinDenotes the saturation value, alpha denotes the saturation adjustment factor, f (hue) denotes the hue influence factor, K2Representing a scale factor. K2Can be set according to the preference degree of the user for the color density, and optionally K2∈(0,2)。
In an implementation manner of this embodiment, the target saturation reference value may be directly used as the target saturation value, and the saturation value of the first pixel may be adjusted to the target saturation value.
When the saturation is enhanced to the same degree in different gain stages according to the V (luminance) component and the S (saturation) component, the image quality at a high gain is deteriorated. For example, the saturation adjustment is performed on a common scene, and the scene is in a low-gain section of a sensor and has no color noise; however, in the case of a high gain (for example, a maximum gain value of a sensor is 54db, and a gain value at this time is 42db), when the saturation is adjusted at the same ratio, noise is amplified, and a color noise phenomenon occurs. In another implementation manner of this embodiment, the target saturation value may be determined by combining the gain and the calculated target saturation reference value, and then the saturation of the first pixel point is adjusted to the target saturation value. Referring again to fig. 7, the sub-step S143 may further include a sub-step S1432 and a sub-step S1433.
And a substep S1432 of obtaining a maximum gain and a gain corresponding to the first target image, and obtaining a corresponding saturation adjustment coefficient according to the maximum gain and the gain corresponding to the first target image.
And a substep S1433 of calculating the target saturation value according to the target saturation reference value and the saturation adjustment coefficient.
In this embodiment, V, S are constrained according to different gain segments to ensure that the target saturation value is calculated according to the gain. Different sensors have different light sensitivity, and the obtained maximum gain values are different, so that the gain can be normalized in order to adapt to different sensors. Alternatively, the saturation adjustment coefficient may be obtained by: the used sensor gain range is divided into multiple parts in advance (the specific number of the division is determined according to actual requirements), each part corresponds to a set saturation adjustment coefficient, and the saturation adjustment coefficient corresponding to the gain of the first target image can be obtained through query. And the saturation adjusting coefficient corresponding to the high-gain section is smaller than that corresponding to the low-gain section. And then, performing product operation according to the saturation adjustment coefficient and the target saturation reference value to obtain a target saturation value. Thereby, color noise due to saturation enhancement processing can be reduced.
Alternatively, the target saturation value may be calculated based on a fourth preset formula. The fourth preset formula is as follows:
Figure BDA0002049625790000151
wherein G ismaxRepresenting the maximum gain of the sensor used. It will of course be appreciated that the fourth predetermined formula is merely illustrative.
And a substep S144, adjusting the saturation value of the first pixel point to the target saturation value for saturation enhancement.
The self-adaptive brightness enhancement mode can ensure that the brightness of a dark target enhancement color area is enhanced under the condition that the bright target enhancement color is not changed, and the dynamic range of the saturation of the pixel point corresponding to the target enhancement color is expanded. In the self-adaptive saturation enhancement mode, firstly, the influence degree of different hues on human vision and the influence of brightness on saturation are combined to construct a self-adaptive scaling factor; and secondly, considering the influence of saturation adjustment under different gain sections on the image quality, and improving the image quality by using a saturation adjustment constraint relation based on the gain. Therefore, the problem that the target enhanced color is not bright due to the scene can be effectively solved, and the layering sense and the definition of a target enhanced color area (particularly an image under a large-area green scene) are enhanced, so that the display effect meets the ideal color expected by people subjectively.
And S150, converting the processed second target image from an HSV color space to an RGB color space to obtain a third target image.
After steps S130 and S140 are performed on all the first pixel points, a processed second target image corresponding to the second pixel point and the processed first pixel point is obtained. And then, converting the processed second target image from an HSV color space to an RGB color space based on a conversion formula to obtain a third target image. Thereby, a color-enhanced image is obtained.
Referring to fig. 8, fig. 8 is a block diagram illustrating a color enhancement device 200 according to an embodiment of the present disclosure. The color enhancement apparatus 200 may include a conversion module 210, a determination module 220, a brightness enhancement module 230, and a saturation enhancement module 240.
The conversion module 210 is configured to obtain a first target image, and convert the first target image from an RGB color space to an HSV color space to obtain a second target image.
The determining module 220 is configured to divide all the pixels of the second target image into first pixels and second pixels according to the determined target enhancement color and the hue value of each pixel of the second target image. And the first pixel points are pixel points to be processed in the second target image.
The brightness enhancement module 230 is configured to perform brightness enhancement processing on the first pixel according to the hue influence factor corresponding to the hue value of the first pixel and the brightness value of the first pixel.
In this embodiment, the brightness enhancement module 230 is specifically configured to:
obtaining a hue influence factor corresponding to the hue value of the first pixel point, wherein the hue influence factor is not less than 1;
obtaining a brightness adjustment proportion corresponding to the brightness value of the first pixel point, wherein the brightness adjustment proportion is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment proportion is not less than 1;
calculating to obtain a target brightness value of the first pixel point according to the hue influence factor, the brightness adjustment proportion and the brightness value of the first pixel point;
and adjusting the brightness value of the first pixel point to the target brightness value so as to enhance the brightness.
The saturation enhancement module 240 is configured to perform saturation enhancement processing on the first pixel point after brightness enhancement to obtain a processed second target image.
The converting module 210 is further configured to convert the processed second target image from HSV color space to RGB color space, so as to obtain a third target image.
In this embodiment, for a specific description of the color enhancement apparatus 200, reference may be made to the above description of the color enhancement method, which is not repeated herein.
In summary, the present application provides a color enhancement method and device. After a first target image needing color enhancement is obtained, converting the first target image from an RGB color space to an HSV color space to obtain a second target image. And then, sequentially judging whether each pixel point is a pixel point to be processed or not according to the determined target enhancement color and the tone value of each pixel point in the second target image, so that all the pixel points in the second target image are divided into second pixel points and first pixel points serving as the pixel points to be processed. And then, carrying out brightness enhancement processing on the first pixel point by combining the hue influence factor corresponding to the hue value of the first pixel point, and carrying out saturation enhancement processing on the first pixel point after brightness enhancement to obtain a processed second target image. And finally, converting the processed second target image from HSV color space to RGB color space to obtain a third target image. Therefore, the influence of the hue and the brightness on the target enhanced color is combined, the brightness of the pixel points corresponding to the target enhanced color is enhanced, and the saturation of the pixel points is enhanced, so that the image effect is effectively improved, and the vivid and vivid image of the target enhanced color is obtained.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method of color enhancement, comprising:
obtaining a first target image, and converting the first target image from an RGB color space to an HSV color space to obtain a second target image;
dividing all pixel points of the second target image into first pixel points and second pixel points according to the determined target enhancement color and the tone value of each pixel point of the second target image, wherein the first pixel points are pixel points to be processed in the second target image;
performing brightness enhancement processing on the first pixel point according to a tone influence factor corresponding to the tone value of the first pixel point and the brightness value of the first pixel point;
performing saturation enhancement processing on the first pixel points with enhanced brightness to obtain a processed second target image;
and converting the processed second target image from HSV color space to RGB color space to obtain a third target image.
2. The method of claim 1, wherein performing a luminance enhancement process on the first pixel according to the hue impact factor corresponding to the hue value of the first pixel and the luminance value of the first pixel comprises:
obtaining a hue influence factor corresponding to the hue value of the first pixel point, wherein the hue influence factor is not less than 1;
obtaining a brightness adjustment proportion corresponding to the brightness value of the first pixel point, wherein the brightness adjustment proportion is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment proportion is not less than 1;
calculating to obtain a target brightness value of the first pixel point according to the hue influence factor, the brightness adjustment proportion and the brightness value of the first pixel point;
and adjusting the brightness value of the first pixel point to the target brightness value so as to enhance the brightness.
3. The method of claim 2, wherein the obtaining the hue impact factor corresponding to the hue value of the first pixel point comprises:
and calculating to obtain the hue influence factor according to the hue value of the first pixel point and a first preset calculation formula, wherein the first preset calculation formula is a Gaussian function formula related to the hue value.
4. The method of claim 3, wherein the calculating a target luminance value of the first pixel according to the hue impact factor, the luminance adjustment ratio, and the luminance value of the first pixel comprises:
calculating to obtain a target brightness value of the first pixel point according to the hue influence factor, the brightness adjustment ratio, the brightness value of the first pixel point and a second preset calculation formula, wherein the second preset calculation formula is as follows:
Figure FDA0002049625780000021
wherein v isoutRepresenting a target brightness value, vinRepresents the brightness value, K1Denotes a luminance adjustment factor, and f (hue) denotes a hue influence factor.
5. The color enhancement method according to claim 2, wherein the luminance enhancement processing is performed on the first pixel point according to the hue influence factor corresponding to the hue value of the first pixel point and the luminance value of the first pixel point, further comprising:
judging whether the brightness value of the first pixel point is within a first preset brightness adjustment range or not;
if the brightness value of the first pixel point is within the first preset brightness adjustment range, brightness enhancement processing is carried out on the first pixel point;
and if the brightness value of the first pixel point is not within the first preset brightness range, not performing brightness enhancement processing on the first pixel point.
6. The color enhancement method according to claim 1, wherein the performing saturation enhancement processing on the first pixel point after brightness enhancement comprises:
obtaining a saturation adjustment factor corresponding to the saturation value of the first pixel point, wherein when the brightness value of the first pixel point is within a second preset brightness adjustment range, the saturation adjustment factor is obtained by calculating the brightness value of the first pixel point and a target brightness value after brightness enhancement; when the brightness value of the first pixel point is not in the second preset brightness adjustment range, the saturation adjustment factor corresponding to the hue value of the first pixel point is 1; wherein the saturation adjustment factor is not less than 1;
obtaining a hue influence factor corresponding to the hue value of the first pixel point, wherein the hue influence factor is not less than 1;
calculating to obtain a target saturation value of the first pixel point according to the hue influence factor, the saturation adjustment factor and the saturation value of the first pixel point;
and adjusting the saturation value of the first pixel point to be the target saturation value so as to enhance the saturation.
7. The method of claim 6, wherein the calculating the target saturation value of the first pixel according to the hue influence factor, the saturation adjustment factor, and the saturation value of the first pixel comprises:
calculating to obtain a target saturation reference value according to the hue influence factor, the saturation adjustment factor, the saturation value of the first pixel point and a third preset calculation formula, wherein the third preset calculation formula is as follows:
Sout1=Sin×α×f(hue)×K2
wherein S isout1Representing a target saturation reference value, SinDenotes the saturation value, alpha denotes the saturation adjustment factor, f (hue) denotes the hue influence factor, K2Represents a scale factor;
obtaining a maximum gain and a gain corresponding to the first target image, and obtaining a corresponding saturation adjustment coefficient according to the maximum gain and the gain corresponding to the first target image;
and calculating to obtain the target saturation value according to the target saturation reference value and the saturation adjustment coefficient.
8. The method of claim 1, wherein the dividing all the pixels of the second target image into first pixels and second pixels according to the determined target enhancement color and the hue value of each pixel of the second target image comprises:
judging whether the tone value of the pixel point is within a preset tone value range corresponding to the target enhanced color;
if the hue value of the pixel point is within the preset hue value range, the pixel point is judged to be the first pixel point;
and if the hue value of the pixel point is not within the preset hue value range, judging the pixel point as the second pixel point.
9. A color enhancement device, comprising:
the conversion module is used for obtaining a first target image and converting the first target image from an RGB color space to an HSV color space to obtain a second target image;
the judging module is used for dividing all pixel points of the second target image into first pixel points and second pixel points according to the determined target enhancement color and the tone value of each pixel point of the second target image, wherein the first pixel points are pixel points to be processed in the second target image;
the brightness enhancement module is used for carrying out brightness enhancement processing on the first pixel point according to the tone influence factor corresponding to the tone value of the first pixel point and the brightness value of the first pixel point;
the saturation enhancement module is used for performing saturation enhancement processing on the first pixel points after the brightness enhancement to obtain a processed second target image;
the conversion module is further configured to convert the processed second target image from an HSV color space to an RGB color space, so as to obtain a third target image.
10. The color enhancement device of claim 9, wherein the brightness enhancement module is specifically configured to:
obtaining a hue influence factor corresponding to the hue value of the first pixel point, wherein the hue influence factor is not less than 1;
obtaining a brightness adjustment proportion corresponding to the brightness value of the first pixel point, wherein the brightness adjustment proportion is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment proportion is not less than 1;
calculating to obtain a target brightness value of the first pixel point according to the hue influence factor, the brightness adjustment proportion and the brightness value of the first pixel point;
and adjusting the brightness value of the first pixel point to the target brightness value so as to enhance the brightness.
CN201910370040.8A 2019-05-06 2019-05-06 Color enhancement method and device Active CN111899182B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910370040.8A CN111899182B (en) 2019-05-06 2019-05-06 Color enhancement method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910370040.8A CN111899182B (en) 2019-05-06 2019-05-06 Color enhancement method and device

Publications (2)

Publication Number Publication Date
CN111899182A true CN111899182A (en) 2020-11-06
CN111899182B CN111899182B (en) 2024-04-05

Family

ID=73169354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910370040.8A Active CN111899182B (en) 2019-05-06 2019-05-06 Color enhancement method and device

Country Status (1)

Country Link
CN (1) CN111899182B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113066020A (en) * 2021-03-11 2021-07-02 Oppo广东移动通信有限公司 Image processing method and device, computer readable medium and electronic device
CN113643651A (en) * 2021-07-13 2021-11-12 深圳市洲明科技股份有限公司 Image enhancement method and device, computer equipment and storage medium
CN115829861A (en) * 2022-11-02 2023-03-21 上海傲显科技有限公司 Image color enhancement method and image color enhancement device
CN116312312A (en) * 2022-09-05 2023-06-23 深圳市集贤科技有限公司 Color data processing method, light source system, device, equipment and storage medium
CN116363232A (en) * 2022-07-14 2023-06-30 上海玄戒技术有限公司 Color gamut compression method, device, electronic equipment, chip and storage medium
WO2023246311A1 (en) * 2022-06-24 2023-12-28 京东方科技集团股份有限公司 Image color processing apparatus, method and system
CN117333402A (en) * 2023-12-01 2024-01-02 北京飞渡科技股份有限公司 Local updating processing method of oblique photographic image and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779330A (en) * 2012-06-13 2012-11-14 京东方科技集团股份有限公司 Image reinforcement method, image reinforcement device and display device
FR2980324A1 (en) * 2011-09-21 2013-03-22 St Microelectronics Grenoble 2 Method for carrying out modification of color saturation of pixel of image in e.g. LCD, involves determining pixel, determining saturation factor, and modifying level of saturation of color on basis of saturation factor
CN104767983A (en) * 2015-03-19 2015-07-08 华为技术有限公司 Picture processing method and device
CN104881853A (en) * 2015-05-28 2015-09-02 厦门美图之家科技有限公司 Skin color rectification method and system based on color conceptualization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2980324A1 (en) * 2011-09-21 2013-03-22 St Microelectronics Grenoble 2 Method for carrying out modification of color saturation of pixel of image in e.g. LCD, involves determining pixel, determining saturation factor, and modifying level of saturation of color on basis of saturation factor
CN102779330A (en) * 2012-06-13 2012-11-14 京东方科技集团股份有限公司 Image reinforcement method, image reinforcement device and display device
CN104767983A (en) * 2015-03-19 2015-07-08 华为技术有限公司 Picture processing method and device
CN104881853A (en) * 2015-05-28 2015-09-02 厦门美图之家科技有限公司 Skin color rectification method and system based on color conceptualization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JINSHENG XIAO等: "Fast Image Enhancement Based on Color Space Fusion", 《 COLOR RESEARCH & APPLICATION》, vol. 41, no. 1, XP071625844, DOI: 10.1002/col.21931 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113066020A (en) * 2021-03-11 2021-07-02 Oppo广东移动通信有限公司 Image processing method and device, computer readable medium and electronic device
CN113643651A (en) * 2021-07-13 2021-11-12 深圳市洲明科技股份有限公司 Image enhancement method and device, computer equipment and storage medium
WO2023284528A1 (en) * 2021-07-13 2023-01-19 深圳市洲明科技股份有限公司 Image enhancement method and apparatus, computer device, and storage medium
WO2023246311A1 (en) * 2022-06-24 2023-12-28 京东方科技集团股份有限公司 Image color processing apparatus, method and system
CN116363232A (en) * 2022-07-14 2023-06-30 上海玄戒技术有限公司 Color gamut compression method, device, electronic equipment, chip and storage medium
CN116363232B (en) * 2022-07-14 2024-02-09 上海玄戒技术有限公司 Color gamut compression method, device, electronic equipment, chip and storage medium
CN116312312A (en) * 2022-09-05 2023-06-23 深圳市集贤科技有限公司 Color data processing method, light source system, device, equipment and storage medium
CN115829861A (en) * 2022-11-02 2023-03-21 上海傲显科技有限公司 Image color enhancement method and image color enhancement device
CN115829861B (en) * 2022-11-02 2023-11-21 上海傲显科技有限公司 Image color enhancement method and image color enhancement device
CN117333402A (en) * 2023-12-01 2024-01-02 北京飞渡科技股份有限公司 Local updating processing method of oblique photographic image and electronic equipment
CN117333402B (en) * 2023-12-01 2024-03-01 北京飞渡科技股份有限公司 Local updating processing method of oblique photographic image and electronic equipment

Also Published As

Publication number Publication date
CN111899182B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN111899182B (en) Color enhancement method and device
KR100983037B1 (en) Method for controlling auto white balance
US7916158B2 (en) Image display apparatus, image signal processing circuit used therein, and method of controlling color saturation of image signal
Liu et al. CID: IQ–a new image quality database
CN105915909B (en) A kind of high dynamic range images layered compression method
CN104796683B (en) A kind of method and system of calibration image color
US11277595B2 (en) White balance method for image and terminal device
CN109147005B (en) Self-adaptive dyeing method and system for infrared image, storage medium and terminal
CN108022223B (en) Tone mapping method based on logarithm mapping function blocking processing fusion
US20080240605A1 (en) Image Processing Apparatus, Image Processing Method, and Image Processing Program
KR20070090224A (en) Method of electronic color image saturation processing
US20140292616A1 (en) Computer monitor equalization using handheld device
CN104581103A (en) Image processing method and device
WO2022120799A1 (en) Image processing method and apparatus, electronic device, and storage medium
US7224833B2 (en) Method for fast color saturation control
Hsu et al. A novel automatic white balance method for color constancy under different color temperatures
EP2802139B1 (en) Image color adjusting method and electronic device using the same
CN108765502B (en) Color appearance obtaining method in complex environment
Vazquez Corral et al. Coupled retinex
CN111565306B (en) Automatic white balance method and storage device for three-dimensional space white point detection and brightness weighting white point
CN109005397A (en) A kind of method of adjustment, device, picture processing chip and the storage device of image white balance
CN113556525B (en) Color temperature adjusting method, device, computer equipment and storage medium
EP3942790B1 (en) Camera color image processing
CN110392245B (en) White balance correction method based on skin color information and image processing device thereof
CN107430769A (en) The system and method for refined image data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant