CN111899182B - Color enhancement method and device - Google Patents

Color enhancement method and device Download PDF

Info

Publication number
CN111899182B
CN111899182B CN201910370040.8A CN201910370040A CN111899182B CN 111899182 B CN111899182 B CN 111899182B CN 201910370040 A CN201910370040 A CN 201910370040A CN 111899182 B CN111899182 B CN 111899182B
Authority
CN
China
Prior art keywords
value
pixel point
brightness
pixel
saturation
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.)
Active
Application number
CN201910370040.8A
Other languages
Chinese (zh)
Other versions
CN111899182A (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

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 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 a first pixel point and a second pixel point 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; carrying out saturation enhancement processing on the first pixel point with enhanced brightness to obtain a processed second target image; and converting the processed second target image from the HSV color space to the RGB color space to obtain a third target image. Therefore, the problem that the target enhancement color is not bright caused by the scene 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 the photographed images are expected to be brighter. A green enhancement algorithm is currently generally used to green enhance an image. Most of the green enhancement algorithms adopt a mode of only adjusting saturation, and the problem of color cast or green darkness (i.e. green is not bright) exists in the image processed by the mode.
Disclosure of Invention
In order to overcome the above-mentioned shortcomings in the prior art, an object of the embodiments of the present application is to provide a color enhancement method and apparatus, which can enhance the brightness of a pixel point corresponding to a target enhancement color by combining the influence of hue and brightness on the target enhancement color after the pixel point is determined, and enhance the saturation, so as to effectively improve the image effect of a color camera in a scene with the target enhancement color, and obtain a vivid 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 pixels of the second target image into a first pixel and a second pixel according to the determined target enhancement color and the tone value of each pixel of the second target image, wherein the first pixel is a pixel 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;
carrying out saturation enhancement processing on the first pixel point with enhanced brightness to obtain a processed second target image;
and converting the processed second target image from the HSV color space to the RGB color space to obtain a third target image.
In a second aspect, embodiments of the present application provide a color enhancement device, including:
the conversion module is used for obtaining a first target image, converting the first target image from an RGB color space to an HSV color space and obtaining a second target image;
the judging module is used for dividing all the pixels of the second target image into first pixels and second pixels according to the determined target enhancement color and the tone value of each pixel of the second target image, wherein the first pixels are pixels 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 carrying out saturation enhancement processing on the first pixel point after brightness enhancement to obtain a second target image after processing;
the conversion module is further configured to convert the processed second target image from an HSV color space to an RGB color space, to obtain a third target image.
Compared with the prior art, the application has the following beneficial effects:
after a first target image needing to be subjected to color enhancement is obtained, the first target image is converted into an HSV color space from an RGB color space, and a second target image is obtained. And then, according to the determined target enhancement color and the tone value of each pixel point in the second target image, judging whether each pixel point is a pixel point to be processed or not in sequence, 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 tone influence factor corresponding to the tone 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 the HSV color space to the RGB color space to obtain a third target image. Therefore, the influence of the hue and the brightness on the target enhancement color is combined, the brightness of the pixel point corresponding to the target enhancement color is enhanced, and the saturation of the pixel point is enhanced, so that the image effect is effectively improved, and the bright and vivid image of the target enhancement color is obtained.
In order to make the above 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 needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
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 according to an embodiment of the present disclosure;
FIG. 3 is a schematic view of an HSV color space model;
FIG. 4 is one of the flow charts 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 flow chart illustrating the sub-steps included in step S140 of FIG. 2;
FIG. 7 is a flow chart of sub-steps included in step S143 of FIG. 6;
fig. 8 is a block schematic diagram of a color enhancement device according to an embodiment of the present application.
Icon: 100-an electronic device; 110-memory; 120-a storage controller; 130-a processor; 200-color enhancement means; a 210-conversion module; 220-a judging module; 230-a brightness enhancement module; 240-saturation enhancement module.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
In the prior art, a hardware mode or a software mode is generally adopted to process the image so as to achieve the effect of color enhancement. For example, when the green enhancement is performed by hardware, the input image color difference signals Cb and Cr are rotated by the reference axis unit to a chromaticity space with the most saturated green color as the vertical axis; then judging that the rotated chrominance vector is in a corresponding adjustment area of the chrominance space by an enhancement area judging unit, and dividing the chrominance vector into four areas; and the saturation enhancement unit enhances the saturation of the current chroma signal according to the control parameter and the user configuration parameter, thereby achieving the effect of green enhancement. The mode needs hardware implementation, and has high cost; moreover, the saturation is adjusted only to enhance the green, the influence of the brightness on the green is not considered, and the processed image still has the problem of dark green.
The color space based software enhancement algorithm mainly comprises: 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 vivid. However, the above algorithm is based on RGB (red, green, blue) color space, acting on each component of R, G, B alone, without considering the strong correlation between each component of the color image R, G, B, changing any component of the pixel will change the ratio of the three components R, G, B, which can easily lead to color distortion.
The present invention is directed to a method for manufacturing a semiconductor device, and a semiconductor device manufactured by the method, and the method is also applicable to a semiconductor device manufactured by the method.
Referring to fig. 1, fig. 1 is a block schematic diagram of an electronic device 100 according to an embodiment of the disclosure. The electronic device 100 may be, but is not limited to, a smart phone, a tablet computer, a video camera, etc. The electronic device 100 may combine the influence of hue and brightness on the target enhanced color to construct a brightness enhancement relationship suitable for the human eye effect, so as to enhance the brightness of the pixel point corresponding to the target enhanced color in the image, and enhance the saturation, so as to obtain a vivid 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 memory 110, the memory controller 120 and the processor 130 are electrically connected directly or indirectly to each other 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 a color enhancement device 200, said color enhancement device 200 comprising at least one software functional module which may 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 of the embodiments of the present application, by running software programs and modules stored in the memory 110, such as the color enhancement device 200 of the embodiments of the present application.
The Memory 110 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory 110 is used for storing a program, and the processor 130 executes the program after receiving an 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 with signal processing capabilities. The processor 130 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc. But also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks 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 is to be understood that the configuration shown in fig. 1 is merely illustrative, and that electronic device 100 may also 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 flow chart of a color enhancement method according to an embodiment of the disclosure. 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, a plurality of images may be stored in the electronic device 100, and the first target image may be determined from the plurality of images according to the received selection operation. Alternatively, the received image transmitted by the other 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 will of course be appreciated that the above is by way of example only and that the first target image may be obtained in other ways.
The color space is a functional representation of a series of colors. Common color space models are RGB, YUV (luminance, color difference), HSV and other color space models. HSV is Hue (Hue), saturation (Saturation), brightness (Value). Because R, G, B components in the RGB color space have high correlation, color cast phenomenon is easy to appear during adjustment, the HSV color space is more in line with the perception and explanation modes of colors by human eyes, the correlation of each component is small, each component can be independently processed, and the space model is a hexagonal pyramid shown in fig. 3. In addition, in the HSV color space, pixels to be color-enhanced are also easily screened out. In the present embodiment, color enhancement is performed in the HSV color space.
Optionally, after the first target image is obtained, the first target image may be converted from the RGB color space to the HSV color space according to the R, G, B component of each pixel in the first target image and the following conversion formula, so as to obtain the second target image. Wherein, the conversion formula is:
v=max (3)
wherein h represents the hue value of a pixel, r represents the red component value of the pixel, g represents the green component value of the pixel, b represents the blue component value of the pixel, the range of r, g and b is [0,255], max represents the maximum value of r, g and b component values in the pixel, min represents the minimum value of r, g and b component values in the pixel, and undefined represents undefined.
Step S120, dividing all pixels of the second target image into a first pixel and a second pixel 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 ranging from [0 °,360 ° ], calculated in the counterclockwise direction from red, 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 °. After the second target image is obtained, traversing each pixel point in the second target image according to the determined target enhancement color to judge whether each pixel point is a pixel point needing to be subjected to color enhancement, so that all the pixel points in the second target image are divided into two types according to the tone value of each pixel point: the pixel comprises a first pixel point and a second pixel point. The first pixel points are the pixel points to be subjected to color enhancement processing in the second target image target, and the second pixel points are the pixel points which do not need to be subjected to color enhancement. The target enhanced 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 enhanced color is determined according to actual requirements, for example, the target enhanced color is green or blue.
Optionally, in one implementation manner of this embodiment, the determining whether each pixel is a pixel that needs to perform color enhancement processing is: judging whether the tone value of the pixel point is in a preset tone value range corresponding to the target enhanced color; if the tone value of the pixel point is in the preset tone value range, judging the pixel point as the first pixel point; if the tone value of the pixel point is not in the preset tone value range, the pixel point is judged to be the second pixel point. The preset tone value range corresponding to the target enhancement color can be set according to actual requirements, and the range represents different target enhancement colors. In order to ensure the color enhancement effect, the preset hue value range corresponding to the target enhanced color may be the same angle of deflection around the hue value of the target enhanced color, and the same angle of deflection is smaller than the preset angle, for example, smaller than 60 degrees.
In the following, an example of how to screen out the first pixel point is given as an example that the target enhancement color is green.
The hue value of green is 120 degrees, and the corresponding preset hue value range may be set to [90 °,150 ° ], [100 °,140 ° ], etc., to represent different green colors, such as pure green, apple green, etc. Preferably, the preset hue value range corresponding to green is set to [90 °,150 ° ]. And comparing the tone value of each pixel point in the second target image with the preset tone value range in turn, and judging whether the tone value of each pixel point is set in the preset tone value range. If the tone value of a pixel is within the preset tone value range, the pixel is a green pixel which needs to be subjected to color enhancement processing, and the pixel is a first pixel. If the tone value of a pixel is not within the preset tone value range, the pixel does not need to be subjected to color enhancement processing, and the pixel is a second pixel. Thus, the pixel point to be processed can be found from the second target image.
Step S130, performing brightness enhancement processing on the first pixel according to the tone influencing factor corresponding to the tone value of the first pixel and the brightness value of the first pixel.
In this embodiment, for the first pixel point corresponding to the target enhanced color (i.e., the pixel point whose hue value is within the preset hue value range), the visual characteristic is considered, and the brightness is adjusted such that the smaller the brightness value, the larger the adjusted proportion is, and the smaller the adjusted proportion is, so that the enhanced target enhanced color is more harmonious with the whole picture. When the tone value of the first pixel is in a different tone region range, the contribution value to the target enhanced color is different. Wherein the contribution of the hue value to the target enhancement color may be represented by a hue influence factor. Alternatively, the contribution value of each component in the tone (i.e., the R, G, B component of the pixel point in the RGB color space for each tone value) approximately tends to a gaussian curve, and a gaussian function may be used to construct the tone influencing factor. For the first pixel points falling within the range of different tone areas, brightness enhancement is performed using different ratios. The tone value of the first pixel point is in different tone intervals and accords with a Gaussian curve, and a Gaussian function hue-N (mu, sigma) can be adopted 2 ) And constructing a constraint relation between the tone and the brightness so as to enhance the brightness. The method can combine the influence of hue and brightness on the target enhanced color, construct the brightness enhancement relation suitable for the visual effect of human eyes, and increase the dynamic range of saturation.
Thus, for a certain first pixel point, firstly, a tone influencing factor corresponding to the tone 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 tone influencing factor, the brightness adjustment proportion and the brightness value of the first pixel point. And repeating the process to finish the brightness enhancement processing of all the first pixel points.
In this embodiment, referring to fig. 4, fig. 4 is a flowchart illustrating the sub-steps included in step S130 in fig. 2. Step S130 may include sub-steps S132-S135.
In sub-step S132, a hue influence factor corresponding to the hue value of the first pixel is obtained.
The hue influence factor is not less than 1. Alternatively, the tone influencing factor may be obtained by, but not limited to, performing a look-up table in a predetermined look-up table including different tone values and corresponding tone influencing factors, or may be calculated by a predetermined calculation formula. In one manner of this embodiment, the tone influencing factor is calculated according to a tone value of the first pixel point and a first preset calculation formula, where the first preset calculation formula is a gaussian function formula related to the tone value. As an embodiment, the first preset calculation formula is:
where f (hue) represents a hue influence factor, i represents a sequence number of a target enhancement color, n represents a total number of enhancement colors, hue represents a hue value,represents the hue value of the target enhanced color, σ represents the degree of adjustment smoothness. Sigma may be set according to actual requirements.
For example, if the enhancement colors are red, green and blue, the total number of enhancement colors is 3, where i=0, 1,2 represents the serial numbers of the three basic hues of red, green and blue. If the enhancement colors are red, yellow, green, cyan, blue, and magenta, the total enhancement colors are 6, where i=0, 1,2,3,4,5i represents the serial numbers of 6 basic hues of red, yellow, green, cyan, blue, and magenta. Therefore, the sequence number of the target enhanced color and the total number of the enhanced colors can be determined according to the actual requirements.
In sub-step S133, a brightness adjustment ratio corresponding to the brightness value of the first pixel is obtained.
Wherein the brightness adjustment ratio decreases with an increase in brightness value, and the minimum value of the brightness adjustment ratio is not less than 1.
And step S134, calculating the target brightness value of the first pixel point according to the tone influencing factor, the brightness adjusting proportion and the brightness value of the first pixel point.
Optionally, according to the hue influence factor, the brightness adjustment proportion, the brightness value of the first pixel point and a second preset calculation formula, calculating to obtain the target brightness value of the first pixel point. The second preset calculation formula is as follows:
wherein v is out Representing the target brightness value, v in Represents the brightness value, K 1 The luminance adjustment factor is represented, and f (hue) represents the hue influence factor. K (K) 1 For the purpose of artificially controlling the brightness, the value is generally 6.
And step S135, adjusting the brightness value of the first pixel point to the target brightness value so as to carry out brightness enhancement.
When the brightness value is larger than a certain value, the image brightness is enhanced to cause the image color to be too bright, so that the visual impact on people is large, and the image color is distorted. Optionally, before the sub-step S135 is performed, it may be determined whether to increase the luminance value of each first pixel according to the luminance value of the first pixel. Referring to fig. 5, fig. 5 is a second schematic flow chart of the sub-steps included in step S130 in fig. 2. Step S130 may further include substep S131 and substep S136.
In sub-step S131, it is determined whether the brightness value of the first pixel is within the 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 luminance value of the first pixel is not within the first preset luminance adjustment range, it means that if the luminance value of the first pixel is increased, the color will be too bright, so that the color is distorted, and the sub-step S136 is performed without increasing the luminance value of the first pixel: the first pixel point is not subjected to brightness enhancement processing. Wherein, alternatively, the first preset brightness adjustment may be set to [0,210]. Thereby, it can be ensured that the region corresponding to the target enhanced color is too excessive.
After step S130 is performed, the process advances to step S140 to perform saturation enhancement processing.
And step S140, carrying out saturation enhancement processing on the first pixel point with enhanced brightness to obtain a second target image after processing.
Referring to fig. 6, fig. 6 is a flowchart illustrating the sub-steps included in step S140 in fig. 2. Step S140 may include sub-steps S141 to S144.
In sub-step S141, a saturation adjustment factor corresponding to the saturation value of the first pixel is obtained.
As can be seen from the HSV color space model shown in fig. 3, there is a certain coupling relation between brightness and saturation, and a saturation adjustment factor is obtained according to the coupling relation. Optionally, the saturation adjustment factor is obtained by: when the brightness value of the first pixel point is in a second preset brightness adjustment range, calculating to obtain a saturation adjustment factor according to the brightness value of the first pixel point and a target brightness value after brightness enhancement, namely;alpha represents a saturation adjustment factor; 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 tone 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 may be the same or different, and may be set according to actual requirements.
In sub-step S142, a hue influence factor corresponding to the hue value of the first pixel is obtained.
Wherein the hue influence factor is not less than 1. For a specific description of sub-step S142, reference may be made to the description of sub-step S142 above.
And step 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 flow chart illustrating the sub-steps included in step S143 in fig. 6. Sub-step S143 may include sub-step S1431.
In sub-step S1431, a target saturation reference value is calculated 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:
S out1 =S in ×α×f(hue)×K 2 (6)
wherein S is out1 Represents a target saturation reference value, S in Represents a saturation value, α represents a saturation adjustment factor, f (hue) represents a hue influence factor, K 2 Representing the scale factor. K (K) 2 Can be set according to the preference degree of the user for the color concentration, and optionally K 2 ∈(0,2)。
In one 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 point may be adjusted to the target saturation value.
When saturation is enhanced to the same extent in different gain sections according to the V (luminance) component and the S (saturation) component, image quality is deteriorated at high gain. For example, the saturation of the common scene is adjusted, and the common scene is in a sensor low-gain section and is free of colorless noise; however, in the case of high gain (for example, the maximum gain of a sensor is 54db, and the gain is 42 db), noise is amplified and color noise is generated when the saturation is adjusted in the same proportion. In another implementation 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 may be adjusted to the target saturation value. Referring again to fig. 7, substep S143 may further include substep S1432 and substep S1433.
In step S1432, a maximum gain and a gain corresponding to the first target image are obtained, and a corresponding saturation adjustment coefficient is obtained according to the maximum gain and the gain corresponding to the first target image.
And step S1433, calculating the target saturation value according to the target saturation reference value and the saturation adjustment coefficient.
In this embodiment, V, S is constrained according to different gain segments to ensure that the target saturation value is calculated according to the gain. Different sensors have different sensitivities, and the obtained maximum gain values are different, so that the gain can be normalized for adapting 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 inquiry. The saturation adjustment coefficient corresponding to the high gain section is smaller than the saturation adjustment coefficient corresponding to the low gain section. And then carrying out product operation according to the saturation adjustment coefficient and the target saturation reference value to obtain a target saturation value. Thus, the color noise caused by the 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:
wherein G is max Indicating the maximum gain of the sensor used. It will of course be appreciated that the fourth predetermined formula is merely illustrative.
And step S144, adjusting the saturation value of the first pixel point to the target saturation value so as to enhance the saturation.
The self-adaptive brightness enhancement mode can ensure that the brightness of the dark target enhancement color area is enhanced under the condition that the bright target enhancement color is unchanged, and the dynamic range of the saturation of the pixel point corresponding to the target enhancement color is enlarged. In the self-adaptive saturation enhancement mode, firstly, the influence degree of different hues on human eye vision and the influence of brightness on saturation are combined to construct a self-adaptive scaling factor; secondly, considering the influence of saturation adjustment under different gain sections on image quality, the image quality is improved by using a saturation adjustment constraint relation based on the gain. Therefore, the problem of the unclear target enhanced color caused by the scene can be effectively eliminated, and the layering sense and the definition of the target enhanced color region (particularly the image in a large-area green scene) are enhanced, so that the display effect accords with the ideal color subjectively expected by people.
Step S150, converting the processed second target image from HSV color space to RGB color space to obtain a third target image.
After step S130 and step S140 are performed on all the first pixels, a processed second target image corresponding to the second pixels and the processed first pixels is obtained. The processed second target image may then be converted from the HSV color space to the RGB color space based on the 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 of a color enhancement device 200 according to an embodiment of the disclosure. The color enhancement device 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 pixels of the second target image into a first pixel and a second pixel according to the determined target enhancement color and the hue value of each pixel of the second target image. The first pixel point is a pixel point 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 a 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 tone influence factor corresponding to a tone value of a first pixel point, wherein the tone influence factor is not less than 1;
obtaining a brightness adjustment ratio corresponding to the brightness value of the first pixel point, wherein the brightness adjustment ratio is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment ratio is not less than 1;
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;
and adjusting the brightness value of the first pixel point to the target brightness value so as to carry out brightness enhancement.
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 conversion module 210 is further configured to convert the processed second target image from HSV color space to RGB color space, to obtain a third target image.
In this embodiment, the specific description of the color enhancement device 200 may refer to the description of the color enhancement method above, and will not be repeated here.
In summary, the embodiments of the present application provide a color enhancement method and apparatus. After a first target image needing to be subjected to color enhancement is obtained, the first target image is converted into an HSV color space from an RGB color space, and a second target image is obtained. And then, according to the determined target enhancement color and the tone value of each pixel point in the second target image, judging whether each pixel point is a pixel point to be processed or not in sequence, 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 tone influence factor corresponding to the tone 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 the HSV color space to the RGB color space to obtain a third target image. Therefore, the influence of the hue and the brightness on the target enhancement color is combined, the brightness of the pixel point corresponding to the target enhancement color is enhanced, and the saturation of the pixel point is enhanced, so that the image effect is effectively improved, and the bright and vivid image of the target enhancement color is obtained.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should 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 pixels of the second target image into a first pixel and a second pixel according to the determined target enhancement color and the tone value of each pixel of the second target image, wherein the first pixel is a pixel to be processed in the second target image, and whether one pixel is the first pixel is determined according to whether the tone value of the pixel is in a preset tone value range corresponding to the target enhancement color;
the brightness enhancement processing for the first pixel point according to the tone influencing factor corresponding to the tone value of the first pixel point and the brightness value of the first pixel point comprises the following steps: 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, a brightness adjustment proportion corresponding to the brightness value of the first pixel point and the brightness value of the first pixel point;
the saturation enhancement processing is carried out on the first pixel point with enhanced brightness, and a processed second target image is obtained, wherein the method comprises the following steps: carrying out saturation enhancement processing on the first pixel point according to a saturation adjustment factor corresponding to the saturation value of the first pixel point after brightness enhancement, a tone influence factor corresponding to the tone value of the first pixel point and the saturation value of the first pixel point;
and converting the processed second target image from the HSV color space to the RGB color space to obtain a third target image.
2. The color enhancement method according to claim 1, wherein the performing the luminance enhancement processing on the first pixel according to the hue influence factor corresponding to the hue value of the first pixel and the luminance value of the first pixel comprises:
obtaining a tone influence factor corresponding to a tone value of a first pixel point, wherein the tone influence factor is not less than 1;
obtaining a brightness adjustment ratio corresponding to the brightness value of the first pixel point, wherein the brightness adjustment ratio is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment ratio is not less than 1;
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;
and adjusting the brightness value of the first pixel point to the target brightness value so as to carry out brightness enhancement.
3. The color enhancement method according to claim 2, wherein obtaining a hue influence factor corresponding to a hue value of the first pixel point comprises:
and calculating the tone influence factor according to the tone 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 tone value.
4. The color enhancement method according to claim 3, wherein the calculating the target luminance value of the first pixel according to the hue influence factor, the luminance adjustment ratio, and the luminance value of the first pixel comprises:
according to the hue influence factor, the brightness adjustment ratio, the brightness value of the first pixel point and a second preset calculation formula, calculating to obtain a target brightness value of the first pixel point, wherein the second preset calculation formula is as follows:
wherein v is out Representing the target brightness value, v in Represents the brightness value, K 1 The luminance adjustment factor is represented, and f (hue) represents the hue influence factor.
5. The color enhancement method according to claim 2, wherein the performing the luminance enhancement processing on the first pixel according to the hue influence factor corresponding to the hue value of the first pixel and the luminance value of the first pixel further comprises:
judging whether the brightness value of the first pixel point is in 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, carrying out brightness enhancement processing on the first pixel point;
if the brightness value of the first pixel point is not in the first preset brightness adjustment range, the brightness enhancement processing is not carried out on the first pixel point.
6. The color enhancement method according to claim 1, wherein the saturation enhancement processing is performed on the first pixel point after the brightness enhancement, and the method 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 tone value of the first pixel point is 1; wherein the saturation adjustment factor is not less than 1;
obtaining a tone influence factor corresponding to a tone value of a first pixel point, wherein the tone influence factor is not less than 1;
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;
and adjusting the saturation value of the first pixel point to the target saturation value so as to enhance the saturation.
7. The method of claim 6, wherein 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 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:
S out1 =S in ×α×f(hue)×K 2
wherein S is out1 Represents a target saturation reference value, S in Represents a saturation value, α represents a saturation adjustment factor, f (hue) represents a hue influence factor, K 2 Representing 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 the target saturation value according to the target saturation reference value and the saturation adjustment coefficient.
8. The color enhancement method according to claim 1, wherein dividing all pixels of the second target image into a first pixel and a second pixel 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 in a preset tone value range corresponding to the target enhanced color;
if the tone value of the pixel point is in the preset tone value range, judging the pixel point as the first pixel point;
if the tone value of the pixel point is not in the preset tone value range, the pixel point is judged to be the second pixel point.
9. A color enhancement device, comprising:
the conversion module is used for obtaining a first target image, converting the first target image from an RGB color space to an HSV color space and obtaining a second target image;
the judging module is used for dividing all the pixels of the second target image into a first pixel and a second pixel according to the determined target enhancement color and the tone value of each pixel of the second target image, wherein the first pixel is a pixel to be processed in the second target image, and whether one pixel is the first pixel is determined according to whether the tone value of the pixel is in a preset tone value range corresponding to the target enhancement color;
the brightness enhancement module is configured to perform brightness enhancement processing on a first pixel according to a hue influence factor corresponding to a hue value of the first pixel and a brightness value of the first pixel, and includes: 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, a brightness adjustment proportion corresponding to the brightness value of the first pixel point and the brightness value of the first pixel point;
the saturation enhancement module is configured to perform saturation enhancement processing on the first pixel point after brightness enhancement, and obtain a processed second target image, where the saturation enhancement module includes: carrying out saturation enhancement processing on the first pixel point according to a saturation adjustment factor corresponding to the saturation value of the first pixel point after brightness enhancement, a tone influence factor corresponding to the tone value of the first pixel point and the saturation value of the first pixel point;
the conversion module is further configured to convert the processed second target image from an HSV color space to an RGB color space, 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 tone influence factor corresponding to a tone value of a first pixel point, wherein the tone influence factor is not less than 1;
obtaining a brightness adjustment ratio corresponding to the brightness value of the first pixel point, wherein the brightness adjustment ratio is reduced along with the increase of the brightness value, and the minimum value of the brightness adjustment ratio is not less than 1;
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;
and adjusting the brightness value of the first pixel point to the target brightness value so as to carry out brightness enhancement.
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 CN111899182A (en) 2020-11-06
CN111899182B true 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)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598585A (en) * 2020-12-07 2021-04-02 京东方科技集团股份有限公司 Color image processing method and device, electronic ink screen and storage medium
CN113066020A (en) * 2021-03-11 2021-07-02 Oppo广东移动通信有限公司 Image processing method and device, computer readable medium and electronic device
CN113643651B (en) * 2021-07-13 2022-08-09 深圳市洲明科技股份有限公司 Image enhancement method and device, computer equipment and storage medium
CN115100989A (en) * 2022-06-24 2022-09-23 京东方科技集团股份有限公司 Image color processing device, method and system
CN116363232B (en) * 2022-07-14 2024-02-09 上海玄戒技术有限公司 Color gamut compression method, device, electronic equipment, chip and storage medium
CN115829861B (en) * 2022-11-02 2023-11-21 上海傲显科技有限公司 Image color enhancement method and image color enhancement device
CN117333402B (en) * 2023-12-01 2024-03-01 北京飞渡科技股份有限公司 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
Fast Image Enhancement Based on Color Space Fusion;Jinsheng Xiao等;《 Color Research & Application》;第41卷(第1期);全文 *

Also Published As

Publication number Publication date
CN111899182A (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN111899182B (en) Color enhancement method and device
US8538147B2 (en) Methods and appartuses for restoring color and enhancing electronic images
CN105915909B (en) A kind of high dynamic range images layered compression method
KR100453038B1 (en) An apparatus and method for saturation correction in color image
US7916158B2 (en) Image display apparatus, image signal processing circuit used therein, and method of controlling color saturation of image signal
KR100983037B1 (en) Method for controlling auto white balance
US7057768B2 (en) Automatic color balance
CN107909553B (en) Image processing method and device
US7933469B2 (en) Video processing
CN108230407B (en) Image processing method and device
KR20070090224A (en) Method of electronic color image saturation processing
CN111861922A (en) Method and device for adjusting color correction matrix and storage medium
US8064693B2 (en) Methods of and apparatus for adjusting colour saturation in an input image
CN105898252A (en) Television color adjustment method and device
CN113301318A (en) Image white balance processing method and device, storage medium and terminal
TWI736599B (en) Method for detection of saturated pixels in an image
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
WO2022120799A9 (en) Image processing method and apparatus, electronic device, and storage medium
US7184174B2 (en) Color picture signal processing method and color picture using the method
US20180176420A1 (en) Automatic white balance based on surface reflection decomposition and chromatic adaptation
EP1404116A1 (en) Method for fast color saturation control
TWI531246B (en) Color adjustment method and its system
CN111613168B (en) Image display processing method and device and computer readable storage medium
EP1895781A1 (en) Method of and apparatus for adjusting colour saturation
JP3061614B1 (en) Color image quality improvement method and apparatus

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