CN112911166A - Method, device, chip, medium and camera equipment for adjusting image brightness - Google Patents

Method, device, chip, medium and camera equipment for adjusting image brightness Download PDF

Info

Publication number
CN112911166A
CN112911166A CN202010632007.0A CN202010632007A CN112911166A CN 112911166 A CN112911166 A CN 112911166A CN 202010632007 A CN202010632007 A CN 202010632007A CN 112911166 A CN112911166 A CN 112911166A
Authority
CN
China
Prior art keywords
histogram
image
weight
pixel
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010632007.0A
Other languages
Chinese (zh)
Other versions
CN112911166B (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.)
Zhuhai Jieli Technology Co Ltd
Original Assignee
Zhuhai Jieli 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 Zhuhai Jieli Technology Co Ltd filed Critical Zhuhai Jieli Technology Co Ltd
Priority to CN202010632007.0A priority Critical patent/CN112911166B/en
Publication of CN112911166A publication Critical patent/CN112911166A/en
Application granted granted Critical
Publication of CN112911166B publication Critical patent/CN112911166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/20Circuitry for controlling amplitude response
    • H04N5/202Gamma control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention provides a method, a device, a chip, a medium and a camera device for adjusting image brightness, wherein the method comprises the following steps: acquiring a first histogram of an image to be processed; performing peak and trough suppression on the first histogram to enable the number of pixels of each gray level to be constrained between a peak and a trough, and adjusting the suppressed histogram according to a scale factor to enable the sum of the pixels before and after suppression to be unchanged to obtain a second histogram; calculating the cumulative distribution function of the second histogram and multiplying by 255 to be used as a first conversion function; setting two pixel threshold values and weights to construct a weight curve; obtaining a second conversion function according to the first conversion function and the weight curve; and obtaining a gain curve through a second conversion function, and adjusting the brightness of the image to be processed. The slope of the histogram cumulative distribution function is limited through peak and trough suppression, and the weight curve is combined, so that the phenomena of detail loss and over-enhancement caused by the traditional histogram equalization are improved, the robustness of a brightness mapping curve is stronger, and more scenes can be adapted.

Description

Method, device, chip, medium and camera equipment for adjusting image brightness
Technical Field
The present invention relates to the field of image processing, and in particular, to a method and an apparatus for adjusting image brightness, and further, to an image processing chip, a computer-readable storage medium, and an image capturing device.
Background
With the popularization of the camera device, such as indoor and outdoor monitoring, unmanned aerial vehicle shooting, a vehicle data recorder, and the like, the brightness of some images obtained by the camera device may be low due to the influence of various factors, or overexposure may occur, which affects the use effect of a user, and then the brightness of the collected images needs to be properly adjusted by a processing algorithm built in the camera device.
The image brightness adjustment algorithm mainly comprises the following steps: a curve mapping method and a histogram equalization method; the curve mapping method is to adjust the image brightness through a given mapping curve; the histogram equalization method is essentially to stretch the image nonlinearly so that the number of pixels in a certain gray scale range is approximately equal. However, the traditional curve mapping method has weak adaptability, and is difficult to adapt to all scenes, so that the robustness is weak; conventional histogram equalization generally fails to achieve the desired effect because a gray level merging phenomenon occurs during equalization, resulting in partial detail loss and over-enhancement.
Disclosure of Invention
Based on the above situation, the main objective of the present invention is to provide a method and an apparatus for adjusting image brightness, so as to solve the phenomena of loss of detail and over-enhancement, and simultaneously improve the robustness of the curve mapping method, so as to adapt to more scenes.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a method of adjusting brightness of an image, comprising the steps of:
s10: acquiring pixel statistical information of each gray level of an image to be processed, and obtaining a first histogram of the image to be processed based on the statistical information;
s20: setting a peak threshold value and a trough threshold value of a single gray level pixel quantity, performing peak suppression and trough suppression on the first histogram, enabling the pixel quantity of each gray level of the image to be processed to be constrained between the peak threshold value and the trough threshold value, calculating a scale factor of the pixel sum of the suppressed histogram and the pixel sum of the first histogram, adjusting the suppressed histogram according to the calculated scale factor, enabling the pixel sum of the histogram to be unchanged, and obtaining a second histogram;
s30: finding the cumulative distribution function of the second histogram and multiplying by 255 as a first conversion function T (i), wherein i is the index of the pixel gray level and ranges from [0,256 ];
s40: setting two pixel thresholds t1And t2Dividing the second histogram to obtain three different gray scale interval, setting the weight of the first segment as w1The weight of the third segment is w2And is based on w1And w2Determining the weight of the second segment such that the weight of the second segment is between w1And w2W1、w2And the weight of the second section form a weight curve W (i), wherein w1,w2In the range of [0,1];
S50: weighting the first conversion function according to the weight curve to obtain a second conversion function T1 (i):
T1(i)=T(i)*W(i)+i*(1-W(i));
s60: obtaining a gain curve g (i) of the image by the second transfer function T1 (i):
G(i)=T1(i)/i;
s70: and adjusting the brightness of the image to be processed through the gain curve and outputting the image.
Preferably, in step S20, the method for calculating the scale factor and adjusting the suppressed histogram according to the scale factor is implemented by using the following formula:
Figure BDA0002569336280000021
Figure BDA0002569336280000022
wherein S1 and S2 are the pixel summation of the original histogram and the suppressed histogram respectively,
Figure BDA0002569336280000023
and the scale factor is the sum of the two pixels, w is the width of the image to be processed, and h is the height of the image to be processed.
Preferably, in step S40, w1And w2And (3) obtaining the weight of the second section by linear interpolation, and constructing a weight curve as follows:
Figure BDA0002569336280000024
preferably, in step S40, w1And w2The curve fitting method determines the weights of the second segment.
Preferably, in step S40, a preset pixel threshold t is selected according to the scene of the image to be processed when it is shot1And t2And is based on t1And t2Determining preset w1And w2
Preferably, in step S10, an original histogram of the image to be processed is obtained based on the statistical information, and then the original histogram is subjected to gamma conversion to obtain the first histogram.
The invention also provides a device for adjusting the image brightness, which comprises:
the image acquisition unit is used for acquiring an image to be processed and sending the image to the histogram calculation unit;
the histogram calculation unit is used for acquiring pixel statistical information of each gray level of an image to be processed, obtaining a first histogram of the image to be processed based on the statistical information, and sending the first histogram to the histogram processing unit;
the histogram processing unit is used for setting a peak threshold value and a trough threshold value of a single gray level pixel quantity, performing peak suppression and trough suppression on the first histogram, enabling the pixel quantity of each gray level of the image to be processed to be constrained between the peak threshold value and the trough threshold value, calculating a scale factor of the pixel sum of the histogram after suppression and the pixel sum of the first histogram, and adjusting the histogram after suppression according to the calculated scale factor to enable the pixel sum of the histogram to be unchanged to obtain a second histogram;
a first conversion function determination unit configured to find a cumulative distribution function of the second histogram and multiply the cumulative distribution function by 255 as a first conversion function t (i);
a weight curve determining unit for setting two pixel threshold values t1And t2Dividing the second histogram to obtain three different gray scale intervals, and setting corresponding weights of the gray scale intervals to form a weight curve;
a second conversion function determining unit, configured to weight the first conversion function according to the weight curve to obtain a second conversion function T1 (i);
a gain curve construction unit for obtaining a gain curve of the image by the second transfer function T1 (i); and
and the output unit is used for adjusting the brightness of the image to be processed according to the gain curve and outputting the adjusted image.
Preferably, the weight curve determination unit is configured to set the weight of the first segment to w1The weight of the third segment is w2And is based on w1And w2Determining the weight of the second segment such that the weight of the second segment is between w1And w2Through w1And w2And (3) obtaining the weight of the second section by linear interpolation, and constructing a weight curve as follows:
Figure BDA0002569336280000041
preferably, the weight curve determination unit is further configured to select the preset pixel threshold t according to a scene at the time of the image capturing to be processed1And t2And is based on t1And t2Determining preset w1And w2
Preferably, the histogram calculation unit is further configured to obtain an original histogram of the image to be processed based on the statistical information, and then perform gamma conversion on the original histogram to obtain the first histogram.
The invention also provides an image processing chip which can realize part or all of the steps described in the method for adjusting the image brightness.
The present invention also provides a computer-readable storage medium storing a computer program, which, when executed, can implement some or all of the steps described in the method for adjusting image brightness according to the present invention.
The invention also provides an image pickup device which comprises the image processing chip provided by the invention or the device for adjusting the image brightness provided by the invention.
The invention limits the histogram by setting the peak threshold and the trough threshold of the single gray level pixel quantity, thereby limiting the slope of the cumulative distribution function, and simultaneously, the histogram is divided into different gray level intervals by setting the pixel threshold and the weight corresponding to each gray level interval is set to construct the weight curve, thereby effectively avoiding the phenomena of detail loss and over-enhancement caused by pixel combination in the histogram equalization process, and the gain curve of brightness adjustment has stronger robustness by setting the pixel threshold and the weight according to different scenes or requirements, and can adapt to more application scenes.
Other advantages of the present invention will be described in the detailed description, and those skilled in the art will understand the technical features and technical solutions presented in the description.
Drawings
Preferred embodiments of a method, an apparatus, a chip, a medium, and an image pickup apparatus for adjusting brightness of an image according to the present invention will be described below with reference to the accompanying drawings. In the figure:
FIG. 1 is a flow chart of a method of adjusting image brightness according to a preferred embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a principle of suppressing a first histogram in a method for adjusting brightness of an image according to a preferred embodiment of the present invention, wherein a is an original histogram, and B is a suppressed histogram;
FIG. 3 is a schematic diagram of a transfer function in a backlit scene according to a preferred embodiment of the present invention;
FIG. 4 is a diagram illustrating a transfer function in an intermediate scenario in accordance with a preferred embodiment of the present invention;
fig. 5 is a schematic diagram of an apparatus for adjusting brightness of an image according to a preferred embodiment of the present invention.
Detailed Description
Fig. 1 shows a method for adjusting brightness of an image according to a preferred embodiment of the present invention, which includes the following steps:
step S10: the method comprises the steps of obtaining pixel statistical information of each gray level of an image to be processed, and obtaining a first histogram of the image to be processed based on the statistical information.
Specifically, an image to be processed in the image sensor is obtained, and a histogram of the image to be processed is obtained through statistics of pixel distribution of the image, where the specific histogram can be obtained by formula 1:
H1(Ix,y)=H1(Ix,y) + 1; (x < ═ h, y < ═ w) (formula 1)
Wherein, H1 is a histogram of the image to be processed, and is denoted as a first histogram, for example, assuming that the image is 8 bits, H1 can be regarded as a one-dimensional array with a length of 256; i is a gray image to be processed and can be regarded as a two-dimensional array, x and y are image position indexes, Ix and y are gray values of pixel points of the gray image to be processed at the x and y positions, and h and w are the height and width of the image respectively.
Step S20: setting a peak threshold and a trough threshold of a single gray level pixel quantity, performing peak suppression and trough suppression on the first histogram, enabling the pixel quantity of each gray level of the image to be processed to be constrained between the peak threshold and the trough threshold, calculating a scale factor of the pixel sum of the suppressed histogram and the pixel sum of the first histogram, and adjusting the suppressed histogram according to the calculated scale factor to enable the pixel sum of the histogram to be unchanged to obtain a second histogram.
Specifically, referring to fig. 2 (in the figure, the abscissa is a gray level L of an image, and the ordinate is a total pixel number NUM at the gray level), two thresholds of a single gray level pixel number are set, T1 is a valley threshold, and T2 is a peak threshold, and peak suppression and valley suppression are respectively performed on the histogram, where the peak suppression is to reduce the number of pixels at the gray level where the number of pixels in the first square image is greater than the peak threshold to the peak threshold, and the valley suppression is to increase the number of pixels at the gray level where the number of pixels in the first square image is less than the valley threshold to the valley threshold, so that the number of pixels at each gray level of the image to be processed is constrained between the peak threshold and the valley threshold. Specifically, the method can be realized by formula 2:
Figure BDA0002569336280000061
h2 is the histogram after suppression, i is the index of the pixel gray level, the range is [0,256 ], and T1 and T2 are the valley threshold and the peak threshold, respectively.
The total number of pixels of the histogram H2 after the peak and trough suppression is changed, and the sum of the specific number of pixels is as shown in formula 3:
Figure BDA0002569336280000062
s1 and S2 are the sum of pixels of the first histogram and the histogram after peak-valley suppression, respectively, in order to ensure that the sum of pixels of the histogram before and after suppression is unchanged, H2 needs to be adjusted to obtain a second histogram, and the adjustment of H2 can be implemented by using formula 4:
Figure BDA0002569336280000063
wherein the content of the first and second substances,
Figure BDA0002569336280000064
is a scaling factor of the sum of the two pixels.
Therefore, through wave crest suppression and wave trough suppression, the situation that the amplitude of a certain gray level is too high or too low is effectively avoided, and the amplitude difference of different gray levels is reduced, so that the slope of the cumulative distribution function of the histogram is limited, the problems of detail loss and excessive enhancement caused in the equalization process of the histogram are avoided, and the image quality is improved. The pixel sum of the histogram is adjusted by calculating the scale factor according to the formula 4, and the calculation is simple and easy to implement.
Step S30: the cumulative distribution function of the second histogram is found and multiplied by 255 as a first transfer function t (i), where i is the index of the pixel gray level and ranges from [0,256 ].
A Cumulative Distribution Function (CDF) of the second histogram is found. The method can be specifically realized by formula 5:
Figure BDA0002569336280000065
where T (i) is the cumulative distribution function.
To ensure that the output range of T (i) is within [0,255], T (i) is transformed as shown in equation 6:
t (i) ═ t (i)/(w) × 255 (formula 6)
According to the histogram equalization method, t (i) can be used as a transfer function of the image and is denoted as a first transfer function.
Step S40: setting two pixel thresholds t1And t2Dividing the second histogram to obtain three different gray scale interval, setting the weight of the first segment as w1The weight of the third segment is w2And is based on w1And w2Determining the weight of the second segment such that the weight of the second segment is between w1And w2W1、w2And the weight of the second section form a weight curve W (i), wherein w1,w2In the range of [0,1]。
Specifically, two pixel thresholds t are set1And t2And two weight values w1,w2Passing through two pixel thresholds t1And t2The second histogram is segmented to obtain three different gray scale intervals which are smaller than a threshold value t1Has a gray scale interval weight of w1Is greater than a threshold value t2Has a gray scale interval weight of w2Through w1And w2Determining a threshold value t1And t2The gray scale interval therebetween.
As a preferred embodiment, the threshold t is1And t2The weight corresponding to the gray scale interval is obtained by a linear interpolation method, and a weight curve is constructed according to the following formula 7:
Figure BDA0002569336280000071
as another preferred embodiment, the threshold t1And t2The weights corresponding to the pixels in between are determined by a curve fitting method.
Therefore, the brightness adjustment range of the image can be further limited through the weight curve, and the phenomena of detail loss and excessive enhancement possibly caused by histogram equalization are relieved.
Step S50: weighting the first conversion function according to the weight curve to obtain a second conversion function T1 (i):
T1(i)=T(i)*W(i)+i*(1-W(i))。
specifically, the first conversion function obtained by equation 6 and the weight curve obtained by equation 7 are weighted to obtain a second conversion function, which is shown in equation 8:
t1(i) ═ T (i) ═ w (i) + i (1-w (i)) (formula 8)
In one embodiment, in a backlight scene, the conversion function obtained according to the above steps is as shown in fig. 3: in the figure, the abscissa represents the gray level value l (in) (pixel value) of image acquisition, and the ordinate represents the gray level value l (out) (pixel value) of output.
The straight line represents the identity mapping, that is, the gray value of the image to be processed is equal to the gray value of the output image, and if the straight line is taken as the conversion function, the brightness value of the image is not adjusted.
The solid curve is the unweighted first transfer function, and if the solid curve is taken as the transfer function, the pixels below the line will be darkened and the pixels above the line will be lightened.
The dashed curve is the weighted second transfer function, which may slow down the bright or dark pixels compared to the unweighted first transfer function, the degree of slowing down being related to the weighted weighting factors.
As a preferred embodiment, a specific pixel threshold and a specific weight value may be set and stored according to different scenes or requirements, so that when brightness adjustment is performed, a preset pixel threshold t may be conveniently selected according to a scene of a to-be-processed image during shooting1And t2And is based on t1And t2Determining preset w1And w2For example by table lookup.
Also in the above embodiment of the backlight scene, the conversion function is as shown in fig. 3, the pixels with larger pixel values have conversion function values below the straight line, the pixels will be compressed, if the pixels are not wanted to be compressed, a larger threshold and a smaller weight can be set, so as to make the conversion values of the pixels as close to the straight line as possible. If it is not desired to make the conversion function values for the pixels with smaller pixel values fall on the line, a smaller threshold and a larger weight can be set to make the conversion values for these pixels as close as possible to the curve.
In another embodiment, in an intermediate scene (pixels concentrated in the middle area), the transfer function is shown in fig. 4, and it can be seen that the pixels with lower pixel values will be compressed and the pixels with larger pixel values will be brightened. Similarly, the optimal adjustment of brightness can also be achieved by setting appropriate thresholds and weights to limit the tensile strength.
In one embodiment, if a single image is processed, the brightness of different images can be adaptively adjusted by setting parameters such as threshold values, weights and the like through the steps, and an image with the best brightness is output.
The first conversion function and the weighting of the weight curve can realize flexible processing of the image brightness, and the second conversion function has stronger robustness so as to adapt to more scenes.
Step S60: obtaining a gain curve g (i) of the image by the second transfer function T1 (i):
G(i)=T1(i)/i。
step S70: and adjusting the brightness of the image to be processed through the gain curve and outputting the image.
Specifically, the brightness of the image to be processed is adjusted through the gain curve, so that an output image with the adjusted brightness can be obtained, and the method can be realized by the following formula 9:
outx,y=Ix,y*G(Ix,y) (formula 9)
Wherein I is an image to be processed, out is an output image, and outx,yFor outputting the gray value, I, of pixel points at x, y positions of the imagex,yFor the gray values of the image to be processed at x, y positions, G (I)x,y) The gain corresponding to the gray value of the image at the x and y positions is processed.
As a preferred embodiment, an original histogram of the image to be processed is obtained based on the statistical information, and then the original histogram is subjected to gamma conversion to obtain the first histogram.
Specifically, when the brightness is adjusted by using the gamma curve, the histogram of the image is first subjected to gamma conversion, and then the subsequent processing of the method described in the above embodiment is performed. Specifically, the formula is 10:
h1(i) ═ F (H1(i)) (formula 10)
Wherein F is a gamma transformation.
The two brightness adjustment algorithms may result in over-enhancement of the image, so that a gamma conversion is required to reduce the effect of the gamma curve on the algorithm.
Compared with the prior art, the method limits the histogram by setting the peak threshold and the trough threshold of the pixel number, thereby limiting the slope of the cumulative distribution function, simultaneously divides the histogram into different gray intervals by setting the threshold and sets the weight corresponding to each gray interval, effectively avoids the phenomena of detail loss and over-enhancement caused by pixel combination in the histogram equalization process, and enables the gain curve of brightness adjustment to have stronger robustness by setting the threshold and the weight according to different scenes or requirements, thereby being suitable for more application scenes.
In order to implement the method for adjusting the brightness of the image, the present invention further provides an apparatus for adjusting the brightness of the image, which is schematically shown in fig. 5 and includes:
the image acquisition unit is used for acquiring an image to be processed and sending the image to the histogram calculation unit;
the histogram calculation unit is used for acquiring pixel statistical information of each gray level of the image to be processed, obtaining a first histogram of the image to be processed based on the statistical information, and sending the first histogram to the histogram processing unit;
the histogram processing unit is used for setting a peak threshold value and a trough threshold value of a single gray level pixel quantity, performing peak suppression and trough suppression on the first histogram, enabling the pixel quantity of each gray level of the image to be processed to be constrained between the peak threshold value and the trough threshold value, calculating a scale factor of the pixel sum of the histogram after suppression and the pixel sum of the first histogram, and adjusting the histogram after suppression according to the calculated scale factor to enable the pixel sum of the histogram to be unchanged to obtain a second histogram;
a first conversion function determination unit configured to find a cumulative distribution function of the second histogram and multiply the cumulative distribution function by 255 as a first conversion function t (i);
a weight curve determining unit for setting two pixel threshold values t1And t2Dividing the second histogram to obtain three different gray scale sections, and setting corresponding weights of the gray scale sections to form a weight curve;
a second conversion function determining unit, configured to weight the first conversion function according to the weight curve to obtain a second conversion function T1 (i);
a gain curve construction unit for obtaining a gain curve of the image by the second transfer function T1 (i); and
and the output unit is used for adjusting the brightness of the image to be processed according to the gain curve and outputting the adjusted image.
As a preferred embodiment, the histogram processing unit is configured to calculate a difference value between the sum of pixels of the histogram after suppression and the sum of pixels of the first histogram and uniformly distribute the difference value over the entire gray scale section when adjusting the histogram after suppression on the basis of a principle that the sum of pixels of the histogram does not change.
As a preferred embodiment, the histogram processing unit is configured to calculate a scale factor of a sum of pixels of the histogram after suppression and a sum of pixels of the first histogram when adjusting the histogram after suppression on the basis of a principle that the sum of pixels of the histogram does not change, and adjust the histogram after suppression according to the calculated scale factor.
In a preferred embodiment, the weight curve determination unit is configured to set the weight of the first segment to w1The weight of the third segment is w2And is based on w1And w2Determining the weight of the second segment such that the weight of the second segment is between w1And w2Through w1And w2And (3) obtaining the weight of the second section by linear interpolation, and constructing a weight curve as follows:
Figure BDA0002569336280000101
as a preferred embodiment, the histogram calculation unit is further configured to obtain an original histogram of the image to be processed based on the statistical information, and then perform gamma conversion on the original histogram to obtain the first histogram.
The device for adjusting the image brightness limits the slope of the histogram cumulative distribution function through peak suppression and trough suppression, can effectively avoid the phenomena of detail loss and over-enhancement caused by pixel combination in the histogram equalization process, sets a threshold value according to specific scenes or requirements to segment the histogram to obtain different gray scale intervals, sets the corresponding weight of each gray scale interval, and further limits the brightness adjustment range of the image through threshold value segmentation and weight setting, so that the device for adjusting the image brightness has stronger robustness and can adapt to more application scenes.
The invention also provides an image processing chip, which comprises a processor for calling and running a computer program from a memory so that a device provided with the chip can realize part or all of the steps of adjusting the image brightness in the embodiment of the method.
The present invention also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is executed by hardware (such as a processor) to implement part or all of the steps of the method for adjusting the brightness of an image described in the above method embodiment.
The invention also provides a camera device, such as an indoor and outdoor monitoring device, an unmanned aerial vehicle, a driving recorder and the like, which is provided with the image processing chip or comprises the device for adjusting the image brightness, and can realize part or all of the steps of adjusting the image brightness in the embodiment of the method so as to output high-quality images or pictures.
It should be noted that step numbers (letter or number numbers) are used to refer to some specific method steps in the present invention only for the purpose of convenience and brevity of description, and the order of the method steps is not limited by letters or numbers in any way. It will be clear to a person skilled in the art that the order of the steps of the method in question, as determined by the technology itself, should not be unduly limited by the presence of step numbers.
It will be appreciated by those skilled in the art that the above-described preferred embodiments may be freely combined, superimposed, without conflict.
It will be understood that the embodiments described above are illustrative only and not restrictive, and that various obvious and equivalent modifications and substitutions for details described herein may be made by those skilled in the art without departing from the basic principles of the invention.

Claims (13)

1. A method for adjusting brightness of an image, comprising the steps of:
s10: acquiring pixel statistical information of each gray level of an image to be processed, and obtaining a first histogram of the image to be processed based on the statistical information;
s20: setting a peak threshold value and a trough threshold value of a single gray level pixel quantity, performing peak suppression and trough suppression on the first histogram, enabling the pixel quantity of each gray level of the image to be processed to be constrained between the peak threshold value and the trough threshold value, calculating a scale factor of the pixel sum of the suppressed histogram and the pixel sum of the first histogram, adjusting the suppressed histogram according to the calculated scale factor, enabling the pixel sum of the histogram to be unchanged, and obtaining a second histogram;
s30: calculating the cumulative distribution function of the second histogram and multiplying by 255 as a first conversion function T (i), wherein i is the index of the pixel gray level and is in the range of [0,256 ];
s40: setting two pixel thresholds t1And t2Dividing the second histogram to obtain three different gray scale interval, setting the weight of the first segment as w1The weight of the third segment is w2And is based on w1And w2Determining the weight of the second segment such that the weight of the second segment is between w1And w2W1、w2And the weight of the second section form a weight curve W (i), wherein w1,w2In the range of [0,1];
S50: weighting the first conversion function according to the weight curve to obtain a second conversion function T1 (i):
T1(i)=T(i)*W(i)+i*(1-W(i));
s60: obtaining a gain curve g (i) of the image by the second transfer function T1 (i):
G(i)=T1(i)/i;
s70: and adjusting the brightness of the image to be processed through the gain curve and outputting the image.
2. The method for adjusting brightness of an image according to claim 1, wherein in step S20, the method for calculating the scale factor and adjusting according to the scale factor is implemented by using the following formula:
Figure FDA0002569336270000011
Figure FDA0002569336270000012
wherein S1 and S2 are the pixel summation of the first histogram and the suppressed histogram respectively,
Figure FDA0002569336270000022
and the scale factor is the sum of the two pixels, w is the width of the image to be processed, and h is the height of the image to be processed.
3. The method for adjusting brightness of an image according to any one of claims 1-2, wherein in step S40, w is defined as1And w2And (3) obtaining the weight of the second section by linear interpolation, and constructing a weight curve as follows:
Figure FDA0002569336270000021
4. the method for adjusting brightness of an image according to any one of claims 1-2, wherein in step S40, w is defined as1And w2Determining weights for the second segment by curve fitting。
5. The method for adjusting brightness of image according to any of claims 1-2, wherein in step S40, a preset pixel threshold t is selected according to the scene of the image to be processed when it is captured1And t2And is based on t1And t2Determining preset w1And w2
6. The method of any one of claims 1-2, wherein in step S10, an original histogram of the image to be processed is obtained based on the statistical information, and then the original histogram is gamma-transformed to obtain the first histogram.
7. An apparatus for adjusting brightness of an image, comprising:
the image acquisition unit is used for acquiring an image to be processed and sending the image to the histogram calculation unit;
the histogram calculation unit is used for acquiring pixel statistical information of each gray level of an image to be processed, obtaining a first histogram of the image to be processed based on the statistical information, and sending the first histogram to the histogram processing unit;
the histogram processing unit is used for setting a peak threshold value and a trough threshold value of a single gray level pixel quantity, performing peak suppression and trough suppression on the first histogram, enabling the pixel quantity of each gray level of the image to be processed to be constrained between the peak threshold value and the trough threshold value, calculating a scale factor of the pixel sum of the histogram after suppression and the pixel sum of the first histogram, and adjusting the histogram after suppression according to the calculated scale factor to enable the pixel sum of the histogram to be unchanged to obtain a second histogram;
a first conversion function determination unit configured to find a cumulative distribution function of the second histogram and multiply the cumulative distribution function by 255 as a first conversion function t (i);
a weight curve determining unit for setting two pixel threshold values t1And t2Dividing the second histogram to obtain three different gray scale sections, and setting corresponding weights of the gray scale sections to form a weight curve;
a second conversion function determining unit, configured to weight the first conversion function according to the weight curve to obtain a second conversion function T1 (i);
a gain curve construction unit for obtaining a gain curve of the image by the second transfer function T1 (i); and
and the output unit is used for adjusting the brightness of the image to be processed according to the gain curve and outputting the adjusted image.
8. The apparatus according to claim 7, wherein the weight curve determining unit is configured to set the weight of the first segment to w1The weight of the third segment is w2And is based on w1And w2Determining the weight of the second segment such that the weight of the second segment is between w1And w2Through w1And w2And (3) obtaining the weight of the second section by linear interpolation, and constructing a weight curve as follows:
Figure FDA0002569336270000031
9. the apparatus according to claim 8, wherein the weight curve determining unit is further configured to select a preset pixel threshold t according to a scene of the image to be processed when the image is captured1And t2And is based on t1And t2Determining preset w1And w2
10. The apparatus according to any one of claims 7-9, wherein the histogram calculation unit is further configured to obtain an original histogram of the image to be processed based on the statistical information, and then perform gamma conversion on the original histogram to obtain the first histogram.
11. An image processing chip, wherein the image processing chip is capable of implementing the method for adjusting brightness of an image according to any one of claims 1 to 6 when processing an image.
12. A computer-readable storage medium, on which a computer program is stored, which, when executed, is capable of implementing a method of adjusting the brightness of an image according to any one of claims 1-6.
13. An image pickup apparatus characterized by comprising: the image processing chip according to claim 11, or the apparatus for adjusting brightness of an image according to any one of claims 7 to 10.
CN202010632007.0A 2020-07-03 2020-07-03 Method, device, chip, medium and camera equipment for adjusting image brightness Active CN112911166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010632007.0A CN112911166B (en) 2020-07-03 2020-07-03 Method, device, chip, medium and camera equipment for adjusting image brightness

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010632007.0A CN112911166B (en) 2020-07-03 2020-07-03 Method, device, chip, medium and camera equipment for adjusting image brightness

Publications (2)

Publication Number Publication Date
CN112911166A true CN112911166A (en) 2021-06-04
CN112911166B CN112911166B (en) 2022-09-23

Family

ID=76110929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010632007.0A Active CN112911166B (en) 2020-07-03 2020-07-03 Method, device, chip, medium and camera equipment for adjusting image brightness

Country Status (1)

Country Link
CN (1) CN112911166B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114119432A (en) * 2021-11-09 2022-03-01 深圳Tcl数字技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114897743A (en) * 2022-07-08 2022-08-12 苏州拉索生物芯片科技有限公司 Self-adaptive judging method for brightness of gene chip microbead, terminal and storage medium
CN115760652A (en) * 2023-01-06 2023-03-07 荣耀终端有限公司 Method for expanding dynamic range of image and electronic equipment
CN115830459A (en) * 2023-02-14 2023-03-21 山东省国土空间生态修复中心(山东省地质灾害防治技术指导中心、山东省土地储备中心) Method for detecting damage degree of mountain forest and grass life community based on neural network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070104387A1 (en) * 2005-11-10 2007-05-10 Samsung Electronics Co., Ltd. Method and apparatus for enhancing contrast
US20100033495A1 (en) * 2008-08-06 2010-02-11 Kai-Hsiang Hsu Image processing apparatus and image processing method
US20140254924A1 (en) * 2013-03-06 2014-09-11 Mstar Semiconductor, Inc. Method, apparatus, and non-transitory computer readable medium for enhancing image contrast
CN108805829A (en) * 2018-05-25 2018-11-13 浙江科澜信息技术有限公司 Video data processing method, device, equipment and computer readable storage medium
US20190043176A1 (en) * 2017-08-04 2019-02-07 Shanghai Zhaoxin Semiconductor Co., Ltd. Methods for enhancing image contrast and related image processing systems thereof
CN109584191A (en) * 2018-12-06 2019-04-05 纳米视觉(成都)科技有限公司 A kind of method for adaptive image enhancement and terminal based on histogram

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070104387A1 (en) * 2005-11-10 2007-05-10 Samsung Electronics Co., Ltd. Method and apparatus for enhancing contrast
US20100033495A1 (en) * 2008-08-06 2010-02-11 Kai-Hsiang Hsu Image processing apparatus and image processing method
US20140254924A1 (en) * 2013-03-06 2014-09-11 Mstar Semiconductor, Inc. Method, apparatus, and non-transitory computer readable medium for enhancing image contrast
US20190043176A1 (en) * 2017-08-04 2019-02-07 Shanghai Zhaoxin Semiconductor Co., Ltd. Methods for enhancing image contrast and related image processing systems thereof
CN108805829A (en) * 2018-05-25 2018-11-13 浙江科澜信息技术有限公司 Video data processing method, device, equipment and computer readable storage medium
CN109584191A (en) * 2018-12-06 2019-04-05 纳米视觉(成都)科技有限公司 A kind of method for adaptive image enhancement and terminal based on histogram

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114119432A (en) * 2021-11-09 2022-03-01 深圳Tcl数字技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114897743A (en) * 2022-07-08 2022-08-12 苏州拉索生物芯片科技有限公司 Self-adaptive judging method for brightness of gene chip microbead, terminal and storage medium
CN114897743B (en) * 2022-07-08 2022-10-11 苏州拉索生物芯片科技有限公司 Gene chip micro-bead brightness self-adaptive judging method, terminal and storage medium
CN115760652A (en) * 2023-01-06 2023-03-07 荣耀终端有限公司 Method for expanding dynamic range of image and electronic equipment
CN115830459A (en) * 2023-02-14 2023-03-21 山东省国土空间生态修复中心(山东省地质灾害防治技术指导中心、山东省土地储备中心) Method for detecting damage degree of mountain forest and grass life community based on neural network

Also Published As

Publication number Publication date
CN112911166B (en) 2022-09-23

Similar Documents

Publication Publication Date Title
CN112911166B (en) Method, device, chip, medium and camera equipment for adjusting image brightness
US7684639B2 (en) Methods and systems for automatic digital image enhancement
WO2022179335A1 (en) Video processing method and apparatus, electronic device, and storage medium
US8295596B1 (en) Adaptive histogram-based video contrast enhancement
US8374430B2 (en) Apparatus and method for feature-based dynamic contrast enhancement
US20070092137A1 (en) Methods and systems for automatic digital image enhancement with local adjustment
US8526736B2 (en) Image processing apparatus for correcting luminance and method thereof
JP6602789B2 (en) System and method for local contrast enhancement
US20080037897A1 (en) Automatic contrast enhancement
US9396526B2 (en) Method for improving image quality
CN107682594A (en) Image processing apparatus, camera device, image processing method and storage medium
CN101394471A (en) Image processing device and digital camera
CN111565261B (en) Image processing method and device and electronic equipment
JP5648849B2 (en) Image processing apparatus and image processing method
CN107993189B (en) Image tone dynamic adjustment method and device based on local blocking
Yu et al. Adaptive inverse hyperbolic tangent algorithm for dynamic contrast adjustment in displaying scenes
US20130287299A1 (en) Image processing apparatus
Kansal et al. Trade-off between mean brightness and contrast in histogram equalization technique for image enhancement
CN112488954B (en) Adaptive image enhancement method and device based on image gray level
US10387999B2 (en) Image processing apparatus, non-transitory computer-readable medium storing computer program, and image processing method
CN111369459B (en) Method and device for optimizing global tone mapping contrast
CN111080563B (en) Histogram equalization method based on traversal optimization
CN109003241B (en) Linear image enhancement method with double control function
CN108171670B (en) Nonlinear image enhancement method with double control function
WO2021093718A1 (en) Video processing method, video repair method, apparatus and device

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
CB02 Change of applicant information

Address after: 519075 No. 333, Kexing Road, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant after: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

Address before: Floor 1-107, building 904, ShiJiHua Road, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant