Color enhancement method based on image brightness gain
By combining histogram equalization and Gauss weighted curves in image processing, the color casting problem caused by the histogram equalization algorithm when contrast is enhanced is solved, and high saturation enhancement of image color is achieved.
Patent Information
- Application Number
- CN202311441979.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2043-11-01
AI Technical Summary
In the prior art, the histogram equalization algorithm only processes the brightness image when the contrast is enhanced, and does not process the chrominance components, resulting in color casts and color saturation decreases while the contrast is improved.
A color enhancement method based on image brightness gain is proposed, which can process brightness images through histogram equalization, and the brightness gain is limited by using Gauss weighted curves to ensure that there is no color casting problem in the enhancement process of chrominance components.
While enhancing the contrast of image brightness, it improves the saturation of image color, avoids color casts and ensures improvement of visual effects.
Smart Images

Figure CN119941597A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a color enhancement method based on image brightness gain. Background Art
[0002] In the prior art, after a series of operations such as denoising, gamma, white balance, green balance, etc. are performed on the input raw data in the ISP, the contrast of the image may be insufficient. Therefore, a contrast enhancement algorithm is needed to improve the contrast of the image during the processing of the ISP. The histogram equalization (HE) algorithm is a widely used contrast enhancement algorithm, which generally works in the YUV color space and processes the brightness image Y. The histogram equalization algorithm uses the histogram of the input image to calculate the cumulative distribution function (CDF), also called a mapping function, which can map a narrow grayscale range to a wider grayscale range. The histogram of the image after histogram equalization has a more uniform distribution, thereby achieving the purpose of enhancing the contrast of the image. After an image with poor contrast is processed by HE, the histogram will be distributed more evenly, thereby improving the contrast of the image.
[0003] When the histogram equalization algorithm is used for contrast enhancement of YUV images, it only processes the brightness image Y, but does not process the chrominance components U and V at the corresponding positions; this will increase the brightness component of some areas while improving the image contrast; and when the enhanced image is converted to the RGB color space, the RGB component mainly comes from the brightness component, which will cause the color cast of the obtained RGB image; it is obvious that the contrast enhancement of the brightness image destroys the proportional relationship between the brightness component Y and the chrominance components U and V, resulting in a decrease in the color saturation of the enhanced image, presenting a poor visual effect.
[0004] In addition, common terminology explanations in the prior art include:
[0005] ISP: image signal processor, a module that performs a series of processing on the raw data input by the sensor, generally including functions such as denoising, color space conversion, and scaling; LCE: local contrast enhancement, local contrast enhancement;
[0006] YUV: The abbreviation of the commonly used color space, which consists of the brightness image component Y and the chrominance image components U and V;
[0007] HE: histogram equalization, histogram equalization;
[0008] HSV: abbreviation for commonly used color space;
[0009] PDF:Probability Density Function,Probability density function;
[0010] CDF: Cumulative Distribution Function, also known as mapping function in histogram equalization. Summary of the invention
[0011] In order to solve the above problems, the purpose of this application is to:
[0012] 1. A color enhancement method based on image brightness gain is proposed, which can maintain good color saturation when the image brightness changes;
[0013] 2. Data offset during color enhancement is to convert the values of chromaticity components u and v to their original value range;
[0014] 3. The Gauss weighted curve used to limit the brightness gain ensures that no color noise appears in the dark area of the image after color enhancement.
[0015] Specifically, the present invention proposes a color enhancement method based on image brightness gain, the method comprising the following steps:
[0016] S1, input YUV color image and obtain original brightness image y;
[0017] S2, using histogram equalization to enhance the brightness image y to obtain an enhanced image Y;
[0018] S3, calculate the weighted curve, and calculate a Gauss weighted curve according to the preset parameter δ. The calculation method is as follows:
[0019]
[0020] Where x represents the brightness value, and δ is used to control the smoothness of the Gauss weighted curve;
[0021] S4, gain calculation, calculates the brightness gain according to the change of each pixel position before and after brightness enhancement; S5, color enhancement, performs color enhancement on the input u, v data images to obtain enhanced chroma component images U, V, including:
[0022] S5.1, UV component negative direction offset, the input u, v data offset, get the offset data u', v', the formula is:
[0023] u'=u'-128,
[0024] v'=v-128,
[0025] S5.2, UV component enhancement, use the brightness gain yGain2 to enhance the u, v data images, the formula is:
[0026] u'=u'×yGain2,
[0027] v'=v'×yGain2,
[0028] S5.3, UV component is shifted in the positive direction, and the enhanced color component is shifted again to obtain the final U and V values. The formula is:
[0029] U=u'+128,
[0030] V=v'+128.
[0031] The step S2 further comprises:
[0032] S2.1, histogram hist of the statistical brightness image y;
[0033] S2.2, according to the width and height of the input image, calculate the probability density function pdf of all gray levels, the formula is as follows:
[0034] pdf = hist / (height × width);
[0035] S2.3, accumulate the probability density functions to obtain the cumulative distribution function cdf, and normalize it to [0 255], the formula is as follows:
[0036]
[0037] Where numBins = 256;
[0038] S2.4, using the calculated cumulative distribution function cdf to enhance the input brightness image y, to obtain an enhanced image Y.
[0039] In step S3, δ=5 is taken.
[0040] In step S4, the brightness gain yGain is calculated and limited to obtain yGain2, including:
[0041] S4.1, calculate the brightness gain, the formula is as follows:
[0042] yGain=Y / y;
[0043] S4.2, brightness gain weighting, use fusLine to weight the gain ygain, the formula is as follows:
[0044] yGain1=yGain×fusLine+1×(1-fusLine);
[0045] S4.3, gain limitation, according to the preset maximum gain value maxLimit and minimum gain value minLimit, the weighted gain yGain1 is limited to obtain the final gain yGain2; here maxLimit=2, minLimit=1.
[0046] Therefore, the advantages of the present application are: solving the problem of reduced image color saturation caused by changes in image brightness, ensuring that while enhancing the brightness contrast, the color of the enhanced image has a higher saturation, which is consistent with human eye perception. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0048] Figure 1 It is a flow chart of the present application method.
[0049] Figure 2 It is a schematic diagram of the weighted curve involved in this application. DETAILED DESCRIPTION
[0050] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.
[0051] The present invention proposes a color enhancement method based on image brightness gain; the method mainly comprises: inputting brightness image y and HE enhanced image Y, calculating the brightness gain of each pixel and limiting it, performing data offset and color enhancement on input u and v data; the method is used to solve the problem of color saturation reduction caused by increased image brightness; the specific process is as follows Figure 1 As shown:
[0052] S1, input YUV color image and obtain original brightness image y;
[0053] S2, performs histogram equalization on y to obtain the enhanced image Y, which mainly includes:
[0054] S2.1, histogram hist of the statistical brightness image y;
[0055] S2.2, according to the width and height of the input image, calculate the probability density function pdf of all gray levels, the formula is as follows:
[0056] pdf = hist / (height × width);
[0057] S2.3, accumulate the probability density functions to obtain the cumulative distribution function cdf, and normalize it to [0 255], the formula is as follows:
[0058]
[0059] Where numBins = 256;
[0060] S2.4, using the calculated cumulative distribution function cdf to enhance the input brightness image y, to obtain an enhanced image Y.
[0061] S3, according to the preset parameter δ, calculate a Gauss weighted curve, the shape of the curve is as follows Figure 2 As shown, the calculation method is as follows:
[0062]
[0063] Where x represents the gray level, and δ is used to control the smoothness of the Gauss weighted curve.
[0064] δ = 5;
[0065] S4, calculate the brightness gain yGain, and limit it to obtain yGain2, mainly including: S4.1, calculate the brightness gain, the formula is as follows:
[0066] yGain=Y / y;
[0067] S4.2, use fusLine to weight the gain ygain, the formula is as follows:
[0068] yGain1=yGain×fusLine+1×(1-fusLine);
[0069] S4.3, according to the preset maximum gain value maxLimit and minimum gain value minLimit, the weighted gain yGain1 is limited to obtain the final gain yGain2; here, maxLimit=2, minLimit=1;
[0070] S5, for the input u, v data images, color enhancement is performed to obtain enhanced chrominance component images U, V, mainly including:
[0071] S5.1, offset the input u, v data to obtain the offset data u', v', the formula is:
[0072] u'=u'-128
[0073] v' = v - 128;
[0074] S5.2, use the brightness gain yGain2 to enhance the u, v data images, the formula is:
[0075] u'=u'×yGain2
[0076] v'=v'×yGain2;
[0077] S5.3, the enhanced color components are shifted again to obtain the final U and V data, the formula is:
[0078] U=u'+128
[0079] V=v'+128.
[0080] In summary, this method solves the problem of image color cast caused by changes in image brightness, and focuses on the implementation process of image color enhancement; first, the brightness gain of each pixel position before and after the brightness change is calculated, and then the Gauss weighted curve is used to limit the gain, and the image chromaticity component is enhanced using the limited gain to ensure that after the image brightness changes, the image color cast problem will not be caused; and the application of the Gauss weighted curve solves the problem of color noise appearing in the dark area of the image after color enhancement.
[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A color enhancement method based on image brightness gain, characterized in that: The method comprises the following steps: S1, input YUV color image and obtain original brightness image y; S2, using histogram equalization to enhance the brightness image y to obtain an enhanced image Y; S3, calculate the weighted curve, and calculate a Gauss weighted curve according to the preset parameter δ. The calculation method is as follows: Where x represents the brightness value, and δ is used to control the smoothness of the Gauss weighted curve; S4, gain calculation, calculating the brightness gain according to the change of each pixel position before and after the brightness enhancement; S5, color enhancement, for the input u, v data images, color enhancement is performed to obtain enhanced chrominance component images U, V, including: S5.1, UV component negative direction offset; offset the input u, v data to obtain the offset data u', v', the formula is: u'=u'-128, v'=v-128, S5.2, UV component enhancement: Use the brightness gain yGain2 to enhance the u and v data images. The formula is: u'=u'×yGain2, v'=v'×yGain2, S5.3, UV component is shifted in the positive direction, and the enhanced color component is shifted again to obtain the final U and V values. The formula is: U=u'+128, V=v'+128.
2. The color enhancement method based on image brightness gain according to claim 1, characterized in that: The step S2 further comprises: S2.1, histogram hist of the statistical brightness image y; S2.2, according to the width and height of the input image, calculate the probability density function pdf of all gray levels, the formula is as follows: pdf = hist / (height × width); S2.3, accumulate the probability density functions to obtain the cumulative distribution function cdf, and normalize it to [0 255], the formula is as follows: Where numBins = 256; S2.4, using the calculated cumulative distribution function cdf to enhance the input brightness image y, to obtain an enhanced image Y.
3. The color enhancement method based on image brightness gain according to claim 1, characterized in that: In step S3, δ=5 is taken.
4. The color enhancement method based on image brightness gain according to claim 1, characterized in that: In step S4, the brightness gain yGain is calculated and limited to obtain yGain2, including: S4.1, calculate the brightness gain, the formula is as follows: yGain=Y / y; S4.2, brightness gain weighting, use fusLine to weight the gain ygain, the formula is as follows: yGain1=yGain×fusLine+1×(1-fusLine); S4.3, gain limitation, according to the preset maximum gain value maxLimit and minimum gain value minLimit, the weighted gain yGain1 is limited to obtain the final gain yGain2; here maxLimit=2, minLimit=1.
Citation Information
Patent Citations
Dynamic contrast enhancement device and method
CN102231264A
Image processing method and device
CN108629738A
Gaussian mixture model based illumination normalization for global enhancement
US20110123133A1
Cited By
Industrial detection image detail enhancement method
CN120725939A