[go: up one dir, main page]

CN119941597A - A color enhancement method based on image brightness gain - Google Patents

A color enhancement method based on image brightness gain Download PDF

Info

Publication number
CN119941597A
CN119941597A CN202311441979.1A CN202311441979A CN119941597A CN 119941597 A CN119941597 A CN 119941597A CN 202311441979 A CN202311441979 A CN 202311441979A CN 119941597 A CN119941597 A CN 119941597A
Authority
CN
China
Prior art keywords
image
brightness
gain
calculating
formula
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311441979.1A
Other languages
Chinese (zh)
Inventor
胡驰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Ingenic Technology Co ltd
Original Assignee
Hefei Ingenic Technology 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 Hefei Ingenic Technology Co ltd filed Critical Hefei Ingenic Technology Co ltd
Priority to CN202311441979.1A priority Critical patent/CN119941597A/en
Publication of CN119941597A publication Critical patent/CN119941597A/en
Pending legal-status Critical Current

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The invention provides a color enhancement method based on image brightness gain, which comprises the steps of S1, inputting YUV color images to obtain original brightness images Y, S2, brightness enhancement, enhancing the brightness images Y by histogram equalization to obtain enhanced images Y, S3, calculating a weighted curve, calculating a Gauss weighted curve according to preset parameters delta, S4, calculating the brightness gain according to the change of each pixel position before and after brightness enhancement, S5, color enhancement, carrying out color enhancement on the input U and V data images to obtain enhanced chrominance component images U and V, S5.1, shifting the input U and V data in the negative direction of UV components to obtain offset data U ', V', wherein the formula is U '=u' -128, V '=v-128, S5.2, enhancing the U and V data images by using brightness gain yGain, the formula is U' × yGain2, V '× yGain2, S5.3, shifting the enhanced positive direction of the enhanced U and V' =v+v component, and finally carrying out color offset to obtain the final formula of u=v+v=128.

Description

Color enhancement method based on image brightness gain
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a color enhancement method based on image brightness gain.
Background
In the prior art, after a series of operations such as denoising, gamma, white balancing, green balancing and the like are performed on input raw data in an ISP, the contrast of an image may be insufficient, so that a contrast enhancement algorithm is required to improve the contrast of the image in the processing of the ISP, a Histogram Equalization (HE) algorithm is a widely used contrast enhancement algorithm which generally works in a YUV color space, the processing object is a brightness image Y, the histogram equalization algorithm calculates a Cumulative Distribution Function (CDF) by using the histogram of the input image, which is also called a mapping function, and the function can map a narrower gray range to a wider gray 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, and after the HE processing, the histogram is distributed more uniformly, thereby improving the contrast of the image.
Since the histogram equalization algorithm only processes the luminance image Y and does not process the chrominance components U, V at the corresponding positions when used for the contrast enhancement of the YUV image, the luminance components of a partial region are increased while the image contrast is improved, the RGB components are mainly derived from the luminance components when the enhanced image is converted into the RGB color space, the color bias of the obtained RGB image is caused, and obviously, the contrast enhancement of the luminance image damages the proportional relationship between the luminance component Y and the chrominance components U, V, resulting in the reduction of the color saturation of the enhanced image and poor visual effect.
Furthermore, common term interpretations in the art include:
ISP IMAGE SIGNAL processer, image signal processor, module for processing raw data input by sensor, generally comprising denoising, color space conversion, scaling, etc., LCE local contrast enhancement, local contrast enhancement;
YUV is an abbreviation for common color space, consisting of luminance image component Y, chrominance image components U, V;
HE histogram equalization, histogram equalization;
HSV, abbreviation for common color space;
a PDF Probability Density Function, probability density function;
CDF Cumulative Distribution Function, cumulative distribution function, also known as mapping function in histogram equalization.
Disclosure of Invention
In order to solve the above problems, an object of the present application is to:
1. The color enhancement method based on the image brightness gain is provided, and can still have better color saturation when the image brightness changes;
2. The data offset during color enhancement is to convert the values of the chrominance components u and v into the original value range;
3. and a Gauss weighting curve used for limiting the brightness gain ensures that the image does not generate color noise in a dark area after the color enhancement.
Specifically, the invention provides a color enhancement method based on image brightness gain, which comprises the following steps:
S1, inputting a YUV color image to obtain an original brightness image y;
s2, enhancing the brightness image Y by adopting histogram equalization to obtain an enhanced image Y;
S3, calculating a weighted curve, and calculating a Gauss weighted curve according to a preset parameter delta in the following calculation mode:
where x represents the luminance value and δ is used to control the smoothness of the Gauss weighting curve;
S4, calculating the gain, namely calculating the brightness gain according to the change of each pixel position before and after brightness enhancement, S5, enhancing the color, and carrying out color enhancement on the input U, V data image to obtain an enhanced chromaticity component image U, V, wherein the method comprises the following steps:
s5.1, offset is carried out on input u, v data in the negative direction of the UV component, and offset data u ', v' are obtained, wherein the formula is as follows:
u'=u'-128,
v'=v-128,
S5.2, enhancing the UV component, and enhancing the u, v data image by utilizing the brightness gain yGain, wherein the formula is as follows:
u'=u'×yGain2,
v'=v'×yGain2,
S5.3, carrying out positive direction offset on the UV component, carrying out data offset on the enhanced color component again to obtain final U, V values, wherein the formula is as follows:
U=u'+128,
V=v'+128。
The step S2 further includes:
S2.1, counting a histogram hist of the brightness image y;
s2.2, calculating probability density functions pdf of all gray levels according to width and height (height) of an input image, wherein the formula is as follows:
pdf=hist/(height×width);
s2.3, accumulating the probability density functions to obtain a cumulative distribution function cdf, and normalizing the cumulative distribution function cdf to [0 ] 255] with the following formula:
wherein numBins = 256;
And S2.4, enhancing the input brightness image Y by adopting the calculated cumulative distribution function cdf, and obtaining an enhanced image Y.
In step S3, δ=5 is taken.
In the step S4, the brightness gain yGain is calculated and limited to obtain yGain, which includes:
s4.1, calculating brightness gain, wherein the formula is as follows:
yGain=Y/y;
s4.2, weighting the brightness gain, and weighting the gain ygain by fusLine according to the following formula:
yGain1=yGain×fusLine+1×(1-fusLine);
and S4.3, limiting the weighted gain yGain1 according to a preset maximum gain value maxLimit and a preset minimum gain value minLimit to obtain a final gain yGain2, wherein maxLimit =2 and minlimit=1 are taken.
Therefore, the application has the advantages of solving the problem of reduced image color saturation caused by image brightness change, ensuring that the color of the enhanced image has higher saturation while enhancing brightness contrast, and conforming to human eye perception.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate and together with the description serve to explain the application.
FIG. 1 is a schematic flow chart of the method of the present application.
Fig. 2 is a schematic diagram of a weighting curve according to the present application.
Detailed Description
In order that the technical content and advantages of the present invention may be more clearly understood, a further detailed description of the present invention will now be made with reference to the accompanying drawings.
The invention provides a color enhancement method based on image brightness gain, which mainly comprises the steps of inputting a brightness image Y and an HE enhanced image Y, calculating the brightness gain of each pixel point and limiting, carrying out data offset and color enhancement on input u and v data, solving the problem of reduced color saturation caused by image brightness enhancement, and specifically comprising the following steps:
S1, inputting a YUV color image to obtain an original brightness image y;
S2, carrying out histogram equalization on Y to obtain an enhanced image Y, wherein the method mainly comprises the following steps:
S2.1, counting a histogram hist of the brightness image y;
s2.2, calculating probability density functions pdf of all gray levels according to width and height (height) of an input image, wherein the formula is as follows:
pdf=hist/(height×width);
s2.3, accumulating the probability density functions to obtain a cumulative distribution function cdf, and normalizing the cumulative distribution function cdf to [0 ] 255] with the following formula:
wherein numBins = 256;
And S2.4, enhancing the input brightness image Y by adopting the calculated cumulative distribution function cdf, and obtaining an enhanced image Y.
S3, calculating a Gauss weighting curve according to a preset parameter delta, wherein the curve shape is shown in FIG. 2, and the calculation mode is as follows:
Where x represents the gray level and delta is used to control the smoothness of the Gauss weighting curve, taken here
δ=5;
S4, calculating and limiting the brightness gain yGain to obtain yGain, wherein the method mainly comprises the following steps of S4.1, calculating the brightness gain, and adopting the following formula:
yGain=Y/y;
s4.2, weighting the gain ygain by fusLine according to the following formula:
yGain1=yGain×fusLine+1×(1-fusLine);
s4.3, limiting the weighted gain yGain1 according to a preset maximum gain value maxLimit and a preset minimum gain value minLimit to obtain a final gain yGain2, wherein maxLimit =2 and minlimit=1 are taken;
s5, performing color enhancement on the input U, V data image to obtain enhanced chrominance component images U, V, wherein the method mainly comprises the following steps of:
s5.1, shifting the input u, v data to obtain shifted data u ', v', wherein the formula is as follows:
u'=u'-128
v'=v-128;
S5.2, enhancing the u, v data image by utilizing the brightness gain yGain, wherein the formula is as follows:
u'=u'×yGain2
v'=v'×yGain2;
s5.3, carrying out data migration on the enhanced color components again to obtain final U, V data, wherein the formula is as follows:
U=u'+128
V=v'+128。
In summary, the method solves the problem of color cast of the image caused by the change of the brightness of the image, focuses on the realization process of image color enhancement, firstly calculates the brightness gain of each pixel position before and after the brightness change, then adopts Gauss weighting curve to limit the gain, enhances the chromaticity component of the image by adopting the limited gain, ensures that the problem of color cast of the image cannot be caused after the brightness change of the image, and solves the problem of color noise in the dark area of the image after the color enhancement by using the Gauss weighting curve.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, and various modifications and variations can be made to the embodiments of the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. A method of color enhancement based on image brightness gain, the method comprising the steps of:
S1, inputting a YUV color image to obtain an original brightness image y;
s2, enhancing the brightness image Y by adopting histogram equalization to obtain an enhanced image Y;
S3, calculating a weighted curve, and calculating a Gauss weighted curve according to a preset parameter delta in the following calculation mode:
where x represents the luminance value and δ is used to control the smoothness of the Gauss weighting curve;
s4, calculating the gain, namely calculating the brightness gain according to the change of each pixel position before and after brightness enhancement;
s5, color enhancement, for an input U, V data image, performing color enhancement to obtain an enhanced chrominance component image U, V, including:
and S5.1, offsetting the input u, v data to obtain offset data u ', v', wherein the formula is as follows:
u'=u'-128,
v'=v-128,
And S5.2, enhancing the UV component, and enhancing the u, v data image by utilizing the brightness gain yGain, wherein the formula is as follows:
u'=u'×yGain2,
v'=v'×yGain2,
S5.3, carrying out positive direction offset on the UV component, carrying out data offset on the enhanced color component again to obtain final U, V values, wherein the formula is as follows:
U=u'+128,
V=v'+128。
2. A color enhancement method based on image brightness gain according to claim 1, wherein the step S2 further comprises:
S2.1, counting a histogram hist of the brightness image y;
s2.2, calculating probability density functions pdf of all gray levels according to width and height (height) of an input image, wherein the formula is as follows:
pdf=hist/(height×width);
s2.3, accumulating the probability density functions to obtain a cumulative distribution function cdf, and normalizing the cumulative distribution function cdf to [0 ] 255] with the following formula:
wherein numBins = 256;
And S2.4, enhancing the input brightness image Y by adopting the calculated cumulative distribution function cdf, and obtaining an enhanced image Y.
3. The method according to claim 1, wherein δ=5 is taken in the step S3.
4. The method of claim 1, wherein in step S4, the brightness gain yGain is calculated and limited to obtain yGain, and the method comprises:
s4.1, calculating brightness gain, wherein the formula is as follows:
yGain=Y/y;
s4.2, weighting the brightness gain, and weighting the gain ygain by fusLine according to the following formula:
yGain1=yGain×fusLine+1×(1-fusLine);
and S4.3, limiting the weighted gain yGain1 according to a preset maximum gain value maxLimit and a preset minimum gain value minLimit to obtain a final gain yGain2, wherein maxLimit =2 and minlimit=1 are taken.
CN202311441979.1A 2023-11-01 2023-11-01 A color enhancement method based on image brightness gain Pending CN119941597A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311441979.1A CN119941597A (en) 2023-11-01 2023-11-01 A color enhancement method based on image brightness gain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311441979.1A CN119941597A (en) 2023-11-01 2023-11-01 A color enhancement method based on image brightness gain

Publications (1)

Publication Number Publication Date
CN119941597A true CN119941597A (en) 2025-05-06

Family

ID=95534919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311441979.1A Pending CN119941597A (en) 2023-11-01 2023-11-01 A color enhancement method based on image brightness gain

Country Status (1)

Country Link
CN (1) CN119941597A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110123133A1 (en) * 2008-06-30 2011-05-26 Honeywell International Inc. Gaussian mixture model based illumination normalization for global enhancement
CN102231264A (en) * 2011-06-28 2011-11-02 王洪剑 Dynamic contrast enhancement device and method
CN108629738A (en) * 2017-03-16 2018-10-09 阿里巴巴集团控股有限公司 A kind of image processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110123133A1 (en) * 2008-06-30 2011-05-26 Honeywell International Inc. Gaussian mixture model based illumination normalization for global enhancement
CN102231264A (en) * 2011-06-28 2011-11-02 王洪剑 Dynamic contrast enhancement device and method
CN108629738A (en) * 2017-03-16 2018-10-09 阿里巴巴集团控股有限公司 A kind of image processing method and device

Similar Documents

Publication Publication Date Title
CN101483711B (en) Gradation correction device, gradation correction method
CN108830800B (en) A method for enhancing the brightness of images in dark scenes
CN101916431B (en) Low-illumination image data processing method and system
CN108876742B (en) Image color enhancement method and device
CN106846282A (en) A kind of enhancement method of low-illumination image of use adaptively correcting
CN102509272A (en) Color image enhancement method based on color constancy
CN109493291A (en) A kind of method for enhancing color image contrast ratio of adaptive gamma correction
CN113643651B (en) Image enhancement method and device, computer equipment and storage medium
CN101378480A (en) Tone correcting apparatus, tone correcting method and tone correcting programe
CN111127343B (en) Histogram double-control infrared image contrast enhancement method
CN112598607A (en) Endoscope image blood vessel enhancement algorithm based on improved weighted CLAHE
CN114037641B (en) Low-illumination image enhancement method, device, equipment and medium
CN108280836A (en) A kind of image processing method and device
CN113191956A (en) Backlight image enhancement method based on depth cutout
CN101211459A (en) Boundary point processed histogram balancing method
CN114764832B (en) Adaptive adjustment method for non-uniform illumination image
CN107068042A (en) Image processing method
CN118071634B (en) Self-adaptive enhancement method for low-illumination color cast image
CN109035182B (en) An Adaptive Dynamic Dual-Histogram Equalization Method
JP4664938B2 (en) Image processing apparatus, image processing method, and program
CN101072362A (en) Image processing device and method thereof
CN119941597A (en) A color enhancement method based on image brightness gain
JP4608961B2 (en) Image processing apparatus, image processing method, and image processing program
CN114066748B (en) Image processing method and electronic device
CN114612344B (en) Image sharpening device and method

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