CN111757079B - White balance statistical method and device - Google Patents
White balance statistical method and device Download PDFInfo
- Publication number
- CN111757079B CN111757079B CN201910238466.8A CN201910238466A CN111757079B CN 111757079 B CN111757079 B CN 111757079B CN 201910238466 A CN201910238466 A CN 201910238466A CN 111757079 B CN111757079 B CN 111757079B
- Authority
- CN
- China
- Prior art keywords
- channel
- counted
- image
- color
- pixel
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/73—Colour balance circuits, e.g. white balance circuits or colour temperature control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/84—Camera processing pipelines; Components thereof for processing colour signals
- H04N23/88—Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Probability & Statistics with Applications (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Processing Of Color Television Signals (AREA)
- Color Television Image Signal Generators (AREA)
Abstract
The embodiment of the invention provides a white balance statistical method and a white balance statistical device. The method comprises the following steps: dividing pixel points of image blocks to be counted in an image to be counted into a plurality of pixel classes according to chromaticity values of the pixel points, wherein the chromaticity values represent the contents of red, green and blue in the colors of the pixel points; and respectively counting the color average values of the pixel points in the plurality of pixel classes to obtain the respective color average values of the plurality of pixel classes, and taking the color average values as the white balance counting results of the image block to be counted. The average color value is the average color value of the pixels obtained by dividing according to the chromaticity values, and the chromaticity value difference degree of each pixel point in the pixels is relatively low, so that the average color value can reflect the color of each pixel point in the pixels more truly. And the white balance statistical result obtained by the embodiment of the invention is more accurate.
Description
Technical Field
The invention relates to the technical field of cameras, in particular to a white balance statistical method and device.
Background
Due to the light conditions of the shooting scene, the colors in the images shot by the camera may be different from the actual colors of the shooting scene, for example, the shot images may be yellow. Some cameras can automatically set white balance related parameters according to the color of a captured image so that the color in the captured image is closer to the actual color of the captured scene, a process called automatic white balance.
In order to enable the camera to perform automatic white balance more accurately, colors in an image captured by the camera can be used as a reference for automatic white balance of the camera. The performance of the camera processor is limited, the camera may not refer to the respective color of each pixel point in the camera during the white balance process, and the reference basis during the automatic white balance can be obtained through white balance statistics before the automatic white balance. For example, in the related art, an image obtained by shooting may be divided into a plurality of image blocks, each image block includes a plurality of pixels, and a color average of the pixels in the plurality of image blocks is respectively counted as a white balance statistical result to be used as a reference basis for automatic white balance of the camera.
However, the color difference between different pixels in an image block may be large, so that the average color value of the image block may not well reflect the color of the pixel in the image block. The resulting white balance statistics are therefore not accurate enough.
Disclosure of Invention
The embodiment of the invention aims to provide a white balance statistical method and a white balance statistical device, so as to more accurately count the color characteristics of an image to be counted and provide a more accurate statistical result for automatic white balance. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a white balance statistical method is provided, where the method includes:
dividing pixel points of image blocks to be counted in an image to be counted into a plurality of pixel classes according to the chromaticity values of the pixel points, wherein the chromaticity values represent the contents of red, green and blue in the colors of the pixel points;
and respectively counting the color average values of the pixel points in the plurality of pixel classes to obtain the respective color average values of the plurality of pixel classes, and taking the color average values as the white balance counting results of the image block to be counted.
In a second aspect of the embodiments of the present invention, there is provided an exposure statistical method, including:
determining weighting coefficients of a red channel, a green channel and a blue channel according to a preset corresponding relation of the color temperature and the weighting coefficients of the red channel, the green channel and the blue channel based on the color temperature of the image to be counted, wherein the corresponding relation meets the following conditions: the weighting coefficient of the red channel corresponding to the highest color temperature value is greater than the weighting coefficient of the red channel corresponding to the lowest color temperature value, for any two different color temperatures, the weighting coefficient of the red channel corresponding to the higher color temperature is greater than or equal to the weighting coefficient of the red channel corresponding to the lower color temperature, the weighting coefficient of the blue channel corresponding to the highest color temperature value is less than the weighting coefficient of the blue channel corresponding to the lowest color temperature value, for any continuous different color temperatures, the weighting coefficient of the blue channel corresponding to the higher color temperature is less than or equal to the weighting coefficient of the blue channel corresponding to the lower color temperature, and the color temperature is calculated based on the white balance statistical result obtained by any one of the white balance statistical methods;
and for each image block of the image to be counted, carrying out weighted average on the red channel value, the green channel value and the blue channel value of each pixel point in the image block based on the determined weighting coefficients of the red channel, the green channel and the blue channel to obtain the brightness of the image block as an exposure counting result of the image block.
According to the white balance statistical method and device provided by the embodiment of the invention, the color average value is the color average value of the pixel class obtained by dividing according to the chromaticity value, and the chromaticity value difference degree of each pixel point in the pixel class is relatively low, so that the color average value can reflect the color of each pixel point in the pixel class more truly. And the white balance statistical result obtained by the embodiment of the invention is more accurate. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a white balance statistical method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a pixel point classification method according to an embodiment of the present invention;
FIG. 3 is a schematic flowchart of an exposure statistics method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating an exposure statistics method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an image to be counted according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a histogram statistics method according to an embodiment of the present invention;
FIG. 7 is a schematic flow chart of a histogram statistics method according to an embodiment of the present invention;
fig. 8a is a schematic structural diagram of a white balance statistic device according to an embodiment of the present invention;
fig. 8b is a schematic structural diagram of a white balance statistic device according to an embodiment of the present invention;
FIG. 9a is a schematic structural diagram of an exposure statistics apparatus according to an embodiment of the present invention;
fig. 9b is a schematic structural diagram of an exposure statistics apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flow chart of a white balance statistical method according to an embodiment of the present invention, which may include:
s101, dividing pixel points of image blocks to be counted in the images to be counted into a plurality of pixel classes according to the chromaticity values of the pixel points.
The image to be counted may be an original image of a shooting scene shot by a camera, or may be obtained by subjecting the original image to tone mapping (tone mapping) to compress a luminance range. Further, in the tone mapping process, in order to ensure that the chromaticity value of each pixel does not change, the values of the red channel, the green channel and the blue channel of each pixel can be mapped in equal proportion. For example, assuming that the mapping coefficient is 0.5 and the color of a pixel in the original image is (100 ), the color of the pixel after tone mapping may be (50, 50), and the contents of the three primary colors of red, green, and blue before and after mapping are not changed, but the brightness is reduced. In the white balance statistics process, limited by the capability of the processor, the bit width of the data that can be processed is limited, for example, the data with the bit width of 8bit may be processed at the highest, in this case, if the color of the pixel point in the original image is stored using the data with the width of 12bit, the white balance statistics may not be performed. By adopting the embodiment, the bit width of the image to be counted can be reduced and the applicability can be improved through tone mapping under the condition of small influence (even no influence) on white balance statistics.
The image block to be counted can be an image block which is not subjected to white balance counting in the image to be counted and comprises a plurality of pixel points. The image blocks in the image to be counted may be divided according to actual requirements, for example, the image to be counted may be uniformly divided into a plurality of rectangular image blocks, for example, assuming that pixels of the image to be counted are 1920 × 1080, the image to be counted may be divided into 91 × 54 image blocks, and each image block is composed of 20 × 20 pixels.
The chromaticity value represents the content of red, green and blue in the color of the pixel point. Since the color information in different formats of images is expressed differently, bayer (bayer) images will be used as an example for convenience of discussion, and the principle is the same for other formats of images. A pixel point in a Bayer image corresponds to four channels and is respectively an R channel, a Gr channel, a Gb channel and a B channel, wherein the value of the R channel is used for expressing the brightness of Red (Red) color in the color of the pixel point, the values of the Gr channel and the Gb channel jointly express the brightness of Green (Green) color in the color of the pixel point, and the value of the B channel is used for expressing the brightness of Blue (Blue) color in the color of the pixel point. According to the difference of the values of the four channels, the pixel points can be represented in various colors, and the chromaticity value of the color depends on the proportion of three primary colors of red, green and blue in the color, for example, if the values of the R channel, the Gr channel, the Gb channel and the B channel of one pixel point are respectively 100,50 and 100, and the values of the R channel, the Gr channel, the Gb channel and the B channel of another pixel point are respectively 50,25 and 50, the chromaticity values of the colors of the two pixel points are the same, and the difference is that the former pixel point is relatively brighter, and the latter pixel point is relatively darker.
For convenience of discussion, the value of the R channel in the bayer image is recorded as the sum of the values of the R channel, the Gr channel, and the Gb channel as G, and the value of the B channel as B, so that the chromaticity value of one pixel point may be represented by the following three terms:
the first term can represent the proportion of red in the color of the pixel point, the second term can represent the proportion of green in the color of the pixel point, and the third term can represent the proportion of blue in the color of the pixel point. Further, since the sum of the three terms is 1, the third term can be calculated under the condition that two terms are known, and therefore, the chromaticity value of one pixel point can be represented by only two terms.
The chromaticity value of a pixel may also be represented by a ratio between two of the three primary colors, for example, the chromaticity value may include a first color ratio and a second color ratio, where the first color ratio is a ratio of two of red, green, and blue, and the second color ratio is a ratio of two of red, green, and blue, and the two colors involved in the first color ratio and the two colors involved in the second color ratio are not identical, for example, the first color ratio may be a ratio of red to green, the second color ratio may be a ratio of blue to green, or the first color ratio may be a ratio of red to blue, and the second color ratio may be a ratio of blue to green. Taking the first color ratio as the ratio of red to green and the second color ratio as the ratio of blue to green as an example, the pixel having a color of (50, 100) has a chromaticity value of (0.5, 1). Under the condition that the ratio of red to green and the ratio of blue to green are known, the content of red, green, and blue in the color of the pixel can be calculated, for example, assuming that the chromaticity value of one pixel is R/G =0.5 and b/G =1, the content of red is 20%, the content of green is 40%, and the content of blue is 40% in the color of the pixel can be calculated.
Further, in the embodiment of the present invention, the pixel points may be classified according to the chromaticity values of the pixel points to obtain a plurality of pixel classes, or the pixel points may be clustered according to the chromaticity values of the pixel points to obtain a plurality of pixel classes. For example, assuming that R/G and B/G are used to represent chromaticity values, two dimensions of R/G and B/G may be used to cluster pixel points by using a k-means clustering algorithm to obtain a plurality of pixel classes.
S102, respectively counting the color average values of the pixel points in the plurality of pixel classes to obtain the respective color average values of the plurality of pixel classes, and using the color average values as the white balance counting result of the image block to be counted.
In an alternative embodiment, the color average of the pixels in a pixel class can be calculated by the following formula:
wherein, C ave Is the average value of the colors of the pixels in the pixel class, R i Is the value of R channel, G, of the ith pixel point in the pixel class i Is the sum of values of Gr channel and Gb channel of the ith pixel point in the pixel class, B i The channel is a value of a B channel of an ith pixel point in the pixel class, and n may be the number of pixel points included in the pixel class.
Further, n may also be the number of effective pixel points included in the pixel class, that is, the color average value of the pixel class obtained through statistics is the color average value of the effective pixel points in the pixel class. The effective pixel points are pixel points which meet a preset threshold condition in the pixel class, and the threshold condition can include one or more of the following three conditions:
and under the condition one, the brightness of the pixel point is smaller than a preset brightness upper limit value. And secondly, the brightness of the pixel points is greater than a preset brightness lower limit value. And thirdly, the chromaticity value of the pixel point belongs to a preset chromaticity value range.
If the brightness of one pixel point is larger than the preset brightness upper limit value, the pixel point is possibly overexposed, so that the color accuracy of the pixel point is low, and the pixel point can be ignored in the white balance statistical process. Similarly, if the brightness of a pixel is less than the preset brightness lower limit, the pixel may be too dark, so that the color accuracy of the pixel is low, and the pixel can be ignored in the white balance statistics process. If the chromaticity value of a pixel point does not belong to the preset chromaticity value range, the chromaticity value of the color of the pixel point can be considered to have larger deviation, and the pixel point can be ignored in the white balance statistical process. Further, the brightness upper limit value, the brightness lower limit value and the chromaticity value range can be set according to actual requirements.
In an optional embodiment, when calculating the color average value of a pixel class, the effective pixel points in the pixel class are determined, and the color average value of the pixel class is obtained according to statistics of the determined effective pixel points. Or screening other pixel points except the effective pixel points in the image to be counted before dividing the pixel class, and only keeping the effective pixel points in the image to be counted.
Since the pixel classes are divided according to the chromaticity values of the pixels, the chromaticity value difference degree between the pixels in the same pixel class is smaller than the chromaticity value difference degree between the pixels in different pixel classes in the image block to be counted (there is a special case that if the chromaticity values of all the pixels in an image block are very close to or even the same, the chromaticity value difference degree between the pixels in the same pixel class may be equal to the chromaticity value difference degree between the pixels in the same image block, but the technical problem to be solved by the embodiment of the present invention does not exist under the condition, and therefore, the discussion is omitted here). And then the average value of the colors of the pixels in the pixel class can better reflect the colors of the pixels in the pixel class.
Assuming that in S101, the pixel points in each image block are divided into 9 pixel classes, the color average value of the 9 pixel classes may be regarded as the color average value of the 9 image sub-blocks in the image block to be counted, and therefore the color average value of each of all the pixel classes of the image block to be counted may be regarded as the white balance statistical result of the image block to be counted.
Furthermore, the color average value of the embodiment of the invention is the color average value of the pixel class obtained by dividing according to the chromaticity value, and the chromaticity value difference degree of each pixel point in the pixel class is relatively low, so that the color average value can reflect the color of each pixel point in the pixel class more truly. And the white balance statistical result obtained by the embodiment of the invention is more accurate.
For example, assuming that there are two pixel points, the colors of the two pixel points are (50, 70) and (100, 50, 70), respectively, the average value of the colors of the two pixel points is (75, 50, 70), and the difference between the content of red in the average value of the visible colors and the content of red in the colors of the two pixel points is large, that is, the average value of the colors cannot better reflect the colors of the two pixel points. If the colors of the two pixel points are (50, 70) and (60, 50, 70) respectively, the average value of the colors of the two pixel points is (55, 50, 70), and the difference between the content of red in the visible average value and the content of red in the colors of the two pixel points is small, namely, the average value of the colors can better reflect the colors of the two pixel points.
Referring to fig. 2, fig. 2 is a schematic flow chart of a pixel point classification method according to an embodiment of the present invention, which may include:
s201, aiming at each image block of the image to be counted, dividing a chromaticity region space including coordinate point chromaticity values of all pixel points in the image block to be counted into a plurality of chromaticity subregion spaces.
The chromaticity region including the chromaticity values of all the pixels in the image block may be determined based on the chromaticity value of each pixel in the image block to be counted. In practical cases, since there are three primary colors in total and there is a constraint condition between the contents of the three primary colors, the chromaticity value is often represented by two values, and the case where the chromaticity value is represented by two values will be described as an example.
In a case where the chromaticity value is represented by two values, the maximum value and the minimum value of the chromaticity value of the pixel point of the image block on the two values may be determined respectively for the two values included in the chromaticity value, for example, if the chromaticity value includes a first color ratio and a second color ratio, the maximum value max1 and the minimum value min1 of the first color ratio and the maximum value max2 and the minimum value min2 of the second color ratio of the pixel point in the image block may be determined. Then the rectangular chromaticity region with chromaticity values (max 1, max 2), (max 1, min 2), (min 1, max 2) and (min 1, min 2) as the vertices inevitably includes the chromaticity values of all the pixels in the image block. Further, the rectangular chromaticity region may be divided into a plurality of chromaticity subregions. Further, the color gamut sub-regions may be divided into uniform or non-uniform sub-regions. And the number of sub-regions may also be determined according to actual requirements.
S202, dividing the pixel points in the image block to be counted into a plurality of pixel classes according to the chromaticity subareas to which the chromaticity values of the pixel points belong, wherein the chromaticity values of all the pixel points in each pixel class belong to the same chromaticity subarea.
For example, if there are 9 chromaticity subregions, for each chromaticity subregion, the pixel points of which the coordinate points belong to the chromaticity subregion may be counted, and the counted pixel points are classified into the same pixel class. In an optional embodiment, the number of the divided chromaticity sub-regions may be the same as the number of the divided pixel classes, and in another optional embodiment, the number of the divided sub-spaces may also be greater than the number of the divided pixel classes (for example, when the chromaticity sub-regions satisfy a condition, the chromaticity sub-regions do not include chromaticity values of any pixel points of the image block to be counted).
Compared with a k-means clustering algorithm, the pixel point classification method provided by the embodiment does not need to calculate a clustering center, can simply determine a plurality of pixel classes through the chromaticity values of the pixel points and classify the pixel classes, and can effectively save the calculation amount required for dividing the pixel points into the plurality of pixel classes.
In the case that the light conditions of different shooting scenes are different, for example, the light in some shooting scenes is sufficient, in order to avoid overexposure of the shot image, setting adjustment can be performed by reducing the shutter speed of the camera, increasing the aperture value and the like so as to reduce the light input amount of the camera. For example, in some shooting scenes, the light is insufficient, and in this case, in order to avoid the difficulty of observing the shot image which is too dark, adjustment can be set by increasing the shutter speed of the camera, decreasing the aperture value, and the like, so as to increase the light input amount of the camera. The camera can automatically adjust the relevant settings affecting the amount of incoming light according to the brightness (Exposure statistics) of the captured image of the captured scene, a process called Auto Exposure.
In order to provide an accurate exposure statistical result for automatic exposure, referring to fig. 3, fig. 3 is a schematic flowchart of an exposure statistical method according to an embodiment of the present invention, which may include:
s301, determining the weighting coefficients of the red channel, the green channel and the blue channel according to the preset corresponding relation between the color temperature and the weighting coefficients of the red channel, the green channel and the blue channel based on the color temperature of the image to be counted.
The corresponding relation satisfies the following conditions: the weighting coefficient of the red channel corresponding to the highest color temperature value is greater than the weighting coefficient of the red channel corresponding to the lowest color temperature value, for any two different color temperatures, the weighting coefficient of the red channel corresponding to the higher color temperature is greater than or equal to the weighting coefficient of the red channel corresponding to the lower color temperature, the weighting coefficient of the blue channel corresponding to the highest color temperature value is less than the weighting coefficient of the blue channel corresponding to the lowest color temperature value, and for any continuous different color temperatures, the weighting coefficient of the blue channel corresponding to the higher color temperature is less than or equal to the weighting coefficient of the blue channel corresponding to the lower color temperature.
The correspondence between the color temperature and the weighting coefficients of the red channel, the green channel, and the blue channel may be set according to actual requirements, for example, a correspondence table may be created in advance, the correspondence table is used to record the weighting coefficients of the red channel, the green channel, and the blue channel corresponding to different color temperatures, and the weighting coefficients of the red channel, the green channel, and the blue channel corresponding to the color temperatures may be obtained by querying the table.
A mapping function for mapping the color temperature to the weighting coefficients of the red, green, and blue channels and corresponding the color temperature to the weighting coefficients of the red, green, and blue channels may be preset.
The color temperature value range may also be divided into a plurality of color temperature value ranges in advance, and the weighting coefficients of the corresponding red channel, green channel and blue channel are set for each color temperature value range, the weighting coefficients of the red channel, green channel and blue channel corresponding to the color temperature are the weighting coefficients of the red channel, green channel and blue channel corresponding to the color temperature value range to which the color temperature belongs.
The maximum value of the color temperature is the maximum value of the color temperatures corresponding to the weighting coefficients of the red channel, the green channel and the blue channel, and the minimum value of the color temperature is the minimum value of the weighting coefficients corresponding to the red channel, the green channel and the blue channel. For example, assuming that weighting coefficients of corresponding red, green, and blue channels are set in advance for color temperatures of 1000K to 20000K, the color temperature highest value may be 20000K and the color temperature lowest value may be 1000K.
The color temperature can be obtained by calculation based on a white balance statistical result obtained by any one of the white balance statistical methods by using a preset color temperature algorithm. The color temperature of the image to be counted may represent the integral tone of the image to be counted, for example, if the color temperature of the image to be counted is higher, the integral tone of the image to be counted is more blue, and if the color temperature of the image to be counted is lower, the integral tone of the image to be counted is more red.
Any of the red, green, and blue channels may refer to one channel or a plurality of channels. For example, if the image to be counted is an RGB image, the red channel is an R channel in the RGB image, the green channel is a G channel in the RGB image, and the blue channel is a B channel in the RGB image. For another example, if the image to be counted is a bayer image, the red channel is an R channel in the bayer image, the green channel is a Gr channel and a Gb channel in the bayer image, and the blue channel is a B channel in the bayer image.
Further, if a color channel includes a plurality of channels, the weighting factor of the color channel may be one or a plurality of. Illustratively, the green channel includes a Gr channel and a Gb channel, and the weighting coefficient of the green channel may be one weighting coefficient that serves as both the Gr channel and the Gb channel, or two weighting coefficients that serve as the weighting coefficients of the Gr channel and the Gb channel, respectively.
Under the condition that the corresponding relation meets the conditions, specific numerical values of the weighting coefficients of the red channel, the green channel and the blue channel can be set according to actual requirements.
For example, in an alternative embodiment, three sets of weighting coefficients may be preset, which are: rR 1 、rG、rB 1 ;rR 2 ,rG,rB 1 ;rR 2 ,rG,rB 2 . Wherein, rR 1 、rR 2 、rG、rB 1 、rB 2 Are all preset values, and rR 2 Greater than rR 1 ,rB 2 Less than rB 1 . If the color temperature of the image to be counted is lower than the preset color temperature limit value, a first group of weighting coefficients is used, namely rR is calculated 1 Determining as the weighting factor for the red channel, rG as the weighting factor for the green channel, rB 1 The weighting coefficients for the blue channel are determined. If the color temperature of the image to be counted is higher than the preset color temperature lower limit value and lower than the preset color temperature upper limit value, a second group of weighting coefficients is used, namely rR is used 2 DeterminingFor the weighting coefficient of the red channel, rG is determined as the weighting coefficient of the green channel, rB 1 The weighting coefficients for the blue channel are determined. If the color temperature of the image to be counted is higher than the preset upper limit value of the color temperature, a third group of weighting coefficients is used, namely rR is used 2 Determining as the weighting factor for the red channel, rG as the weighting factor for the green channel, rB 2 The weighting coefficients for the blue channel are determined. Wherein, the upper limit value of the color temperature is larger than the lower limit value of the color temperature.
And S302, for each image block of the image to be counted, carrying out weighted average on the red channel value, the green channel value and the blue channel value of each pixel point in the image block based on the determined weighting coefficients of the red channel, the green channel and the blue channel to obtain the brightness of the image block as an exposure counting result of the image block.
For convenience of discussion, the following description will be given by taking the image to be counted as a bayer image, and the weighting coefficient of the green channel includes two weighting coefficients:
suppose the determined weighting coefficients for the red channel are rR, the weighting coefficients for the green channel are rGr and rGb, where rGr is the weighting coefficient for the Gr channel, rGb is the weighting coefficient for the Gb channel, and the weighting coefficient for the blue channel is rB. The luminance of the image block may be calculated as follows:
where Y is the luminance of the image block and R i Is the value of R channel, gr, of the ith pixel point in the image block i The value of Gr channel of the ith pixel point in the image block, B i Is the value of B channel, gb, of the ith pixel point in the image block i The value of the Gb channel of the ith pixel point in the image block, CNT is the number of pixel points included in the image block.
Since the human eye is more sensitive to green than to blue and red, colors with higher green content may be perceived as relatively brighter by the human eye. For example, assuming that color a is (50, 100, 50), color B is (50, 100), and color C is (100, 50), human eyes may perceive color a as brighter than color B and color C. Therefore, the degree of exposure required for the pixel point of the color a can be lower than that required for the pixel point of the color B or the color C. On the contrary, if the pixel point of the color a is exposed to a suitable brightness, the pixel points of the colors B and C may still be in a darker state which is not favorable for observation.
The embodiment is adopted, a smaller red channel weighting coefficient is selected under the condition of lower color temperature, and a smaller blue channel weighting coefficient is selected under the condition of higher color temperature, so that the brightness is obtained by calculation under the conditions of lower color temperature and higher color temperature, the calculated brightness is closer to the watching feeling of human eyes, and the brightness of the image shot by the camera after automatic exposure is more suitable for the watching of the human eyes.
Illustratively, assuming that the color a is (50, 100, 50), the color B is (50, 100), and the color C is (100, 50), the weighting coefficients of the three color channels are 1/3, and 1/3, respectively, for the color a, the luminance of the color a is calculated to be 66.7, the weighting coefficients of the three color channels may be 1/2, 1/3, and 1/6, respectively, for the color B, because the content of blue is relatively high (i.e., the color temperature is high), the luminance value of the color B is calculated to be 58.33, and the weighting coefficients of the three color channels may be 1/6, 1/3, and 1/2, respectively, for the color C, because the content of red is relatively high (i.e., the color temperature is low), the luminance value of the color C is calculated to be 58.33. Therefore, the brightness calculated by the color B and the color C is lower than the brightness calculated by the color A, and accords with the brightness actually sensed by human eyes, namely, the embodiment is selected, so that the brightness is closer to the brightness actually sensed by the human eyes by the dynamic weighting coefficient under the conditions of higher color temperature and lower color temperature.
Referring to fig. 4, may include:
s401, determining weighting coefficients of a red channel, a green channel and a blue channel according to a preset corresponding relation between the color temperature and the weighting coefficients of the red channel, the green channel and the blue channel based on the color temperature of the image to be counted.
The step is the same as S301, and reference may be made to the foregoing description about S301, which is not described herein again.
S402, aiming at each image block of the image to be counted, carrying out weighted average on the red channel value, the green channel value and the blue channel value of each pixel point in the image block based on the determined weighting coefficients of the red channel, the green channel and the blue channel to obtain the brightness of the image block as an exposure counting result of the image block.
The step is the same as S302, and reference may be made to the foregoing description about S302, which is not described herein again.
And S403, performing weighted average on the brightness of all image blocks of the image to be counted based on the preset weighting coefficient for each image block of the image to be counted to obtain the brightness of the image to be counted as an exposure counting result of the image to be counted.
In an exemplary case, in the image to be counted, there are an area in which a user is interested and an area in which the user is not interested, for example, a shooting scene is a showcase, the area in which the user is interested is an area in which an exhibit displayed in the showcase is located, and for an area other than the area in which the exhibit is located, the user may not be interested, and therefore the user may wish to optimize the brightness of the area in which the user is interested by automatic exposure, and may not care whether the brightness of the area in which the user is not interested is appropriate, the weighting coefficient of the area in which the user is interested may be set to be larger, and the weighting coefficient of the area in which the user is not interested may be set to be smaller (even may be set to 0).
The brightness of the image to be counted can be calculated according to the following formula:
wherein n is the number of rows of image blocks included in the image to be counted, m is the number of columns of image blocks included in the image to be counted, and Y ij Is the brightness of the image block in the ith row and the jth column, W ij Is the image of the ith row and the jth columnWeighting coefficients of the blocks.
The embodiment is selected, the brightness of the image to be counted is used as the exposure statistical result, and the brightness of the image to be counted is obtained by weighted average of the brightness of each image block based on the respective weighting coefficient, so that the importance degree of each image block can be reflected, and the optimization effect of the brightness of the important area can be improved in the subsequent automatic exposure process.
For example, referring to fig. 5, fig. 5 is a schematic diagram of an image to be counted, in the image to be counted, a region actually interested by a user may be a grid region in the center of the image, and due to the influence of a lens of a camera or light rays of a shooting site, a large number of black regions exist around the image to be counted, which results in a low overall brightness of the image to be counted, and at this time, the camera may determine that it is necessary to increase more light input amount, which further results in overexposure of the grid region in the center. The embodiment is selected, the weighting coefficients of the image blocks corresponding to the peripheral black areas can be set to be 0 (or a smaller non-zero value), and the weighting coefficient of the image block corresponding to the central grid area is set to be a larger value, so that the brightness of the image to be counted is higher, at this moment, the camera may determine that a smaller light input amount needs to be increased (even determine that the light input amount needs to be decreased), and the overexposure phenomenon in the central grid area is avoided.
In some exposure statistics, a luminance histogram is an important statistical manner, and the luminance histogram can represent the distribution condition of the luminance of the pixel points in the image to be counted. Referring to fig. 6, fig. 6 is a schematic flowchart of a histogram statistics method according to an embodiment of the present invention, where the histogram statistics method includes:
s601, determining the weighting coefficients of the red channel, the green channel and the blue channel according to the preset corresponding relation between the color temperature and the weighting coefficients of the red channel, the green channel and the blue channel based on the color temperature of the image to be counted.
The step is the same as S301, and reference may be made to the foregoing description about S301, which is not described herein again.
S602, for each pixel point of the image to be counted, based on the determined weighting coefficients of the red channel, the green channel and the blue channel, carrying out weighted average on the value of the red channel, the value of the green channel and the value of the blue channel of the pixel point, and obtaining the brightness of the pixel point.
And S603, counting to obtain a brightness histogram of the image to be counted based on the brightness of each pixel point of the obtained image to be counted.
The brightness histogram is used for representing the number of pixel points in each brightness area in the image to be counted. Exemplarily, assuming that the value range of the brightness of the pixel points in the image to be counted is 0 to 4096, each 4 brightness units can be classified into a histogram unit, the feasible region of the brightness histogram can be 0 to 1024, and the number of the pixel points with the brightness in the brightness regions 0 to 4, 4 to 8, \ 8230 \ 8230, 4092 to 4096 is counted in sequence to generate the brightness histogram. Illustratively, if the number of pixels having luminances within the luminance regions 0-4 is 10, the ordinate of the first histogram cell in the luminance histogram is 10.
However, in the luminance histogram obtained according to the method, the statistical information contained in the region with lower luminance is not favorable for the analysis of the subsequent algorithm, that is, the degree of validity of the information in the luminance histogram may be lower, and in order to improve the degree of validity of the information in the obtained luminance histogram, see fig. 7, where fig. 7 is another schematic flow chart of the histogram statistical method provided by the embodiment of the present invention, and may include:
s701, determining the weighting coefficients of the red channel, the green channel and the blue channel according to the preset corresponding relation between the color temperature and the weighting coefficients of the red channel, the green channel and the blue channel based on the color temperature of the image to be counted.
The step is the same as S301, and reference may be made to the foregoing description about S301, and details are not repeated herein.
S702, gamma correction is carried out on the image to be processed.
The specific method of gamma correction can be selected according to actual requirements, which is not limited in this embodiment. The gamma correction can effectively improve the brightness of pixel points with darker brightness in the image to be counted so as to reduce information distributed in the area with lower brightness.
And S703, carrying out weighted average on the red channel value, the green channel value and the blue channel value of the pixel point after gamma correction based on the determined weighting coefficients of the red channel, the green channel and the blue channel to obtain the brightness of the pixel point.
And S704, counting to obtain a brightness histogram of the image to be counted based on the obtained brightness of each pixel point of the image to be counted.
By adopting the embodiment, more effective information can be contained in the brightness histogram through gamma correction, and more information is provided for subsequent processing such as automatic exposure, wide dynamic synthesis, automatic contrast adjustment, dynamic range analysis and the like, so that the processing can be more accurately carried out.
Referring to fig. 8a, fig. 8a is a schematic structural diagram of a white balance statistics apparatus according to an embodiment of the present invention, which may include:
the pixel division module 801 is configured to divide a pixel point of an image block to be counted in an image to be counted into multiple pixel classes according to a chromaticity value of the pixel point, where the chromaticity value represents the content of red, green, and blue in the color of the pixel point;
the color averaging module 802 is configured to separately count color averages of pixels in multiple pixel classes, to obtain respective color averages of the multiple pixel classes, and to use the color averages as a white balance statistical result of the image block to be counted.
Further, the pixel division module 801 is specifically configured to divide a chromaticity region including chromaticity values of all pixel points in the image block to be counted into a plurality of chromaticity subregions;
dividing the pixel points in the image block to be counted into a plurality of pixel classes according to the chromaticity subareas to which the chromaticity values of the pixel points belong, wherein the chromaticity values of all the pixel points in each pixel class belong to the same chromaticity subarea.
Further, the chromaticity value includes a first color ratio which is a ratio of two colors of red, blue and green, and a second color ratio which is a ratio of two colors of red, blue and green that are not completely the same as the two colors involved in the first color ratio;
the pixel dividing module 801 is specifically configured to uniformly divide a rectangular chromaticity region with chromaticity values (max 1, max 2), (max 1, min 2), (min 1, max 2), and (min 1, min 2) as vertexes into a plurality of chromaticity subregions, where max1 is a maximum value of a first color ratio of a pixel point in an image block to be counted, max2 is a maximum value of a second color ratio of the pixel point in the image block to be counted, min1 is a minimum value of the first color ratio of the pixel point in the image block to be counted, and min2 is a minimum value of the second color ratio of the pixel point in the image block to be counted.
Further, the pixel division module 801 is specifically configured to cluster the pixels in the image block to be counted according to the chromaticity values of the pixels by using a preset clustering algorithm to obtain a plurality of pixel classes, where the chromaticity value similarity between the pixels in each pixel class is higher than a preset similarity threshold.
Further, the color averaging module 802 is specifically configured to separately count color average values of effective pixel points in the multiple pixel classes, to obtain respective color average values of the multiple pixel classes, and use the color average values as a white balance statistical result of the image block to be counted, where the effective pixel points are pixel points whose middle values satisfy a preset threshold condition, and the threshold condition includes one or more of the following three conditions: the brightness of the pixel point is smaller than the preset brightness upper limit value, the brightness of the pixel point is larger than the preset brightness lower limit value, and the chromaticity value of the pixel point belongs to the preset chromaticity value range.
Further, referring to fig. 8b, the apparatus further includes a tone mapping module 803, configured to compress a luminance range of an original image of a shooting scene through tone mapping before, for each image block of the image to be counted, dividing pixel points in the image block into a plurality of pixel classes according to chromaticity values of the pixel points, so as to obtain the image to be counted.
Referring to fig. 9a, fig. 9a shows an exposure statistics apparatus according to an embodiment of the present invention, the apparatus includes:
the coefficient determining module 901 is configured to determine, based on a color temperature of an image to be counted, weighting coefficients of a red channel, a green channel, and a blue channel according to a preset correspondence between the color temperature and the weighting coefficients of the red channel, the green channel, and the blue channel, where the correspondence satisfies the following conditions: for any two different color temperatures, the weighting coefficient of the red channel corresponding to the highest color temperature value is greater than or equal to the weighting coefficient of the red channel corresponding to the lowest color temperature value, the weighting coefficient of the blue channel corresponding to the highest color temperature value is less than the weighting coefficient of the blue channel corresponding to the lowest color temperature value, and for any continuous different color temperatures, the weighting coefficient of the blue channel corresponding to the higher color temperature value is less than or equal to the weighting coefficient of the blue channel corresponding to the lower color temperature value, and the color temperature is calculated based on the white balance statistical result obtained by any white balance statistical method in the above embodiments;
the luminance calculating module 902 is configured to, for each image block of the image to be counted, perform weighted average on the values of the red channel, the green channel, and the blue channel of each pixel in the image block based on the determined weighting coefficients of the red channel, the green channel, and the blue channel, to obtain luminance of the image block, and use the luminance as an exposure statistical result of the image block.
Further, the coefficient determining module 901 is specifically configured to determine that the weighting coefficient of the red channel is rR if the color temperature of the image to be counted is lower than the preset color temperature limit value 1 The weighting coefficient of the green channel is rG, and the weighting coefficient of the blue channel is rB 1 Wherein, rR 1 、rG、rB 1 Is a preset value;
if the color temperature of the image to be counted is higher than the preset color temperature lower limit value and lower than the preset color temperature upper limit value, determining the weighting coefficient of the red channel as rR 2 The weighting coefficient of the green channel is rG, and the weighting coefficient of the blue channel is rB 1 Wherein, rR 2 Is a preset value, and rR 2 Greater than rR 1 ;
If the color temperature of the image to be counted is higher than the preset upper limit of the color temperatureValue, determine weighting factor of red channel as rR 2 The weighting coefficient of the green channel is rG, and the weighting coefficient of the blue channel is rB 2 Wherein, rB 2 Is a preset value, and rB 2 Less than rB 1 。
Further, the luminance calculating module 902 is further configured to perform, for each image block of the image to be counted, weighted averaging on the values of the red channel, the green channel, and the blue channel of each pixel in the image block based on the determined weighting coefficients of the red channel, the green channel, and the blue channel to obtain the luminance of the image block, and perform, as an exposure statistical result of the image block, weighted averaging on the luminances of all image blocks of the image to be counted based on the weighting coefficients preset for each image block of the image to be counted to obtain the luminance of the image to be counted, which is used as the exposure statistical result of the image to be counted;
taking the brightness of all image blocks in the image to be counted as an exposure counting result, wherein the exposure counting result comprises the following steps:
and taking the brightness of all image blocks in the image to be counted and the brightness of the image to be counted as exposure counting results.
Further, referring to fig. 9b, the apparatus further includes a histogram statistics module 903, configured to, after determining weighting coefficients of a red channel, a green channel, and a blue channel based on the color temperature of the image to be counted, perform weighted average on a value of the red channel, a value of the green channel, and a value of the blue channel of each pixel point of the image to be counted based on the determined weighting coefficients of the red channel, the green channel, and the blue channel, so as to obtain brightness of the pixel point;
and counting to obtain a brightness histogram of the image to be counted based on the obtained brightness of each pixel point of the image to be counted, wherein the brightness histogram is used for representing the number of the pixel points in each brightness region in the image to be counted.
Further, the histogram statistics module 903 is further configured to perform gamma correction on the image to be processed before performing weighted average on the value of the red channel, the value of the green channel, and the value of the blue channel of each pixel point of the image to be counted based on the determined weighting coefficients of the red channel, the green channel, and the blue channel to obtain the brightness of the pixel point;
the histogram statistics module 903 is specifically configured to perform, for each pixel point of the image to be counted, weighted averaging on a value of the red channel, a value of the green channel, and a value of the blue channel of the pixel point after gamma correction based on the determined weighting coefficients of the red channel, the green channel, and the blue channel, so as to obtain brightness of the pixel point.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiment of the apparatus, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (9)
1. A white balance statistical method, the method comprising:
dividing a chromaticity region including chromaticity values of all pixel points in the image block to be counted into a plurality of chromaticity subregions;
dividing the pixel points in the image block to be counted into a plurality of pixel classes according to the chromaticity subregions to which the chromaticity values of the pixel points belong, wherein the chromaticity values of all the pixel points in each pixel class belong to the same chromaticity subregion, and the chromaticity values represent the content of red, green and blue in the colors of the pixel points;
wherein the plurality of chromaticity subregions comprise: uniformly dividing a rectangular chromaticity region with chromaticity values (max 1, max 2), (max 1, min 2), (min 1, max 2) and (min 1, min 2) as vertexes into a plurality of chromaticity subregions, wherein max1 is the maximum value of a first color ratio of a pixel point in an image block to be counted, max2 is the maximum value of a second color ratio of the pixel point in the image block to be counted, min1 is the minimum value of the first color ratio of the pixel point in the image block to be counted, and min2 is the minimum value of the second color ratio of the pixel point in the image block to be counted;
and respectively counting the color average values of the pixel points in the plurality of pixel classes to obtain the respective color average values of the plurality of pixel classes, and taking the color average values as the white balance statistical result of the image block to be counted.
2. The method of claim 1, wherein the chromaticity values include a first color ratio of two of red, blue, and green, and a second color ratio of two of red, blue, and green that are not exactly the same as the two colors involved in the first color ratio.
3. The method according to claim 1, wherein the dividing the pixels of the image block to be counted into a plurality of pixel classes according to the chromaticity values of the pixels comprises:
clustering the pixels of the image block to be counted in the image block to be counted according to the color values of the pixels by using a preset clustering algorithm to obtain a plurality of pixel classes, wherein the similarity of the color values between the pixels in each pixel class is higher than a preset similarity threshold.
4. The method according to claim 1, wherein the separately counting the color average values of the pixels in the pixel class to obtain the respective color average values of the pixel classes, as the white balance statistical result of the image block to be counted, comprises:
respectively counting the color average values of effective pixel points in the plurality of pixel classes to obtain the respective color average values of the plurality of pixel classes as the white balance statistical result of the image block to be counted, wherein the effective pixel points are pixel points which meet the preset threshold condition, and the threshold condition comprises one or more of the following three conditions: the brightness of the pixel point is smaller than the preset brightness upper limit value, the brightness of the pixel point is larger than the preset brightness lower limit value, and the chromaticity value of the pixel point belongs to the preset chromaticity value range.
5. The method as claimed in claim 1, wherein before the dividing the pixels of the image block to be counted into the plurality of pixel classes according to the chromaticity values of the pixels, the method further comprises:
and compressing the brightness range of the original image of the shot scene through tone mapping to obtain the image to be counted.
6. A statistical method of exposure, the method comprising:
determining the weighting coefficients of the red channel, the green channel and the blue channel according to the preset corresponding relationship between the color temperature of the image to be counted and the weighting coefficients of the red channel, the green channel and the blue channel, wherein the corresponding relationship meets the following conditions: the weighting coefficient of the red channel corresponding to the highest color temperature value is greater than the weighting coefficient of the red channel corresponding to the lowest color temperature value, for any two different color temperatures, the weighting coefficient of the red channel corresponding to the higher color temperature is greater than or equal to the weighting coefficient of the red channel corresponding to the lower color temperature, the weighting coefficient of the blue channel corresponding to the highest color temperature value is less than the weighting coefficient of the blue channel corresponding to the lowest color temperature value, for any continuous different color temperatures, the weighting coefficient of the blue channel corresponding to the higher color temperature is less than or equal to the weighting coefficient of the blue channel corresponding to the lower color temperature, and the color temperature is calculated based on the white balance statistical result obtained by the white balance statistical method of any one of claims 1-5;
and for each image block of the image to be counted, carrying out weighted average on the red channel value, the green channel value and the blue channel value of each pixel point in the image block based on the determined weighting coefficients of the red channel, the green channel and the blue channel to obtain the brightness of the image block as an exposure counting result of the image block.
7. The method of claim 6, wherein determining the weighting coefficients of the red channel, the green channel, and the blue channel according to a preset corresponding relationship between color temperature and the weighting coefficients of the red channel, the green channel, and the blue channel based on the color temperature of the image to be counted comprises:
if the color temperature of the image to be counted is lower than the preset color temperature limit value, determining the weighting coefficient of the red channel as rR 1 The weighting coefficient of the green channel is rG, and the weighting coefficient of the blue channel is rB 1 Wherein, rR 1 、rG、rB 1 Is a preset value;
if the color temperature of the image to be counted is higher than a preset color temperature lower limit value and lower than a preset color temperature upper limit value, determining that the weighting coefficient of the red channel is rR 2 The weighting coefficient of the green channel is rG, and the weighting coefficient of the blue channel is rB 1 Wherein, rR 2 Is a preset value, and rR 2 Greater than rR 1 ;
If the color temperature of the image to be counted is higher than the preset color temperature upper limit value, determining that the weighting coefficient of the red channel is rR 2 The weighting coefficient of the green channel is rG, and the weighting coefficient of the blue channel is rB 2 Wherein, rB 2 Is a preset value, and rB 2 Less than rB 1 。
8. The method according to claim 6, wherein after the weighted average is performed on the values of the red channel, the green channel, and the blue channel of each pixel point in each image block based on the determined weighting coefficients of the red channel, the green channel, and the blue channel to obtain the brightness of the image block, which is used as the exposure statistical result of the image block, for each image block of the image to be statistical, the method further comprises:
and carrying out weighted average on the brightness of all image blocks of the image to be counted based on a preset weighting coefficient aiming at each image block of the image to be counted to obtain the brightness of the image to be counted as an exposure counting result of the image to be counted.
9. The method according to claim 6, wherein after determining the weighting coefficients of the red channel, the green channel and the blue channel based on the color temperature of the image to be counted, the method further comprises:
for each pixel point of the image to be counted, carrying out weighted average on the value of the red channel, the value of the green channel and the value of the blue channel of the pixel point based on the determined weighting coefficients of the red channel, the green channel and the blue channel to obtain the brightness of the pixel point;
and counting to obtain a brightness histogram of the image to be counted based on the obtained brightness of each pixel point of the image to be counted, wherein the brightness histogram is used for representing the number of the pixel points in each brightness area in the image to be counted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910238466.8A CN111757079B (en) | 2019-03-27 | 2019-03-27 | White balance statistical method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910238466.8A CN111757079B (en) | 2019-03-27 | 2019-03-27 | White balance statistical method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111757079A CN111757079A (en) | 2020-10-09 |
CN111757079B true CN111757079B (en) | 2022-12-06 |
Family
ID=72672208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910238466.8A Active CN111757079B (en) | 2019-03-27 | 2019-03-27 | White balance statistical method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111757079B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20220140369A (en) * | 2021-04-09 | 2022-10-18 | 에스케이하이닉스 주식회사 | Image sensing device and operating method thereof |
CN117710489A (en) * | 2023-05-18 | 2024-03-15 | 荣耀终端有限公司 | Image color edge quantization method, apparatus, storage medium, and program product |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003298319A (en) * | 2002-03-29 | 2003-10-17 | Ojima Shisaku Kenkyusho:Kk | Electromagnetic wave transmission circuit element and its manufacturing method |
CN105872500A (en) * | 2015-12-08 | 2016-08-17 | 乐视移动智能信息技术(北京)有限公司 | Adjusting method and device for white balance of image |
CN105898263B (en) * | 2016-05-24 | 2017-08-25 | 厦门美图之家科技有限公司 | A kind of image white balance method, device and computing device |
-
2019
- 2019-03-27 CN CN201910238466.8A patent/CN111757079B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN111757079A (en) | 2020-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109274985B (en) | Video transcoding method and device, computer equipment and storage medium | |
US9087385B2 (en) | Method for improving images captured underwater | |
JP5646705B1 (en) | Image processing apparatus, image processing method, and image processing program | |
CN111311513B (en) | Method, device and computer storage medium for unifying color and style of image | |
CN111757079B (en) | White balance statistical method and device | |
CN112788251B (en) | Image brightness processing method and device, and image processing method and device | |
WO2019210707A1 (en) | Image sharpness evaluation method, device and electronic device | |
CN111724316B (en) | Method and apparatus for processing high dynamic range image | |
JP4154128B2 (en) | Image processing apparatus, image processing method, and recording medium on which program for executing the method is recorded | |
WO2023000868A1 (en) | Image processing method and apparatus, device, and storage medium | |
CN112929625A (en) | Display material rendering method and device | |
CN115334295B (en) | Image white balance processing method and electronic equipment | |
CN117499616A (en) | Control method, system, equipment and medium for camera module lens shading correction | |
CN117835082A (en) | Multi-band flat field correction method, system and medium with self-adaptive environment temperature | |
WO2020140241A1 (en) | Adaptive adjustment method based on ambient light distribution field | |
TWI438718B (en) | Image processing method and system by using adaptive inverse hyperbolic curve | |
CN113099191B (en) | Image processing method and device | |
CN110633065B (en) | Image adjusting method and device and computer readable storage medium | |
CN114630095B (en) | Automatic white balance method and device for target scene image and terminal | |
JP2007288245A (en) | Imaging apparatus, image processing method, and image processing program | |
WO2024082288A1 (en) | Video processing method and apparatus, and display device | |
TWI792454B (en) | Adaptive image shading correction method and image shading correction system | |
CN115205140A (en) | Image color correction method, correction apparatus, and readable storage medium | |
CN115293998A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
WO2022218293A1 (en) | Image processing method 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |