CN117835076A - Method, device, equipment and medium for searching white point area - Google Patents

Method, device, equipment and medium for searching white point area Download PDF

Info

Publication number
CN117835076A
CN117835076A CN202410046766.7A CN202410046766A CN117835076A CN 117835076 A CN117835076 A CN 117835076A CN 202410046766 A CN202410046766 A CN 202410046766A CN 117835076 A CN117835076 A CN 117835076A
Authority
CN
China
Prior art keywords
value
color temperature
white point
value set
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410046766.7A
Other languages
Chinese (zh)
Inventor
彭强
董洪涛
张立嵩
华剑雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingwei Hirain Tech Co Ltd
Original Assignee
Beijing Jingwei Hirain Tech 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 Beijing Jingwei Hirain Tech Co Ltd filed Critical Beijing Jingwei Hirain Tech Co Ltd
Priority to CN202410046766.7A priority Critical patent/CN117835076A/en
Publication of CN117835076A publication Critical patent/CN117835076A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera 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)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for searching a white point area. Shooting the 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images; calculating a plurality of Raw images to obtain an R/G value set and a B/G value set; the R/G value is taken as an abscissa, the B/G value is taken as an ordinate, a coordinate system is constructed, the R/G value set and the B/G value set are used for constructing a scatter diagram in the coordinate system, a plurality of color temperature curves are obtained through fitting, the response of the sensor to the light source tone can be reflected more accurately, and according to the plurality of color temperature curves, the R/G value set and the B/G value set, the initial white point area can be subjected to scaling operation to obtain a more accurate white point area, so that the white point area is applied to an AWB algorithm, and the effect of the AWB algorithm can be improved.

Description

Method, device, equipment and medium for searching white point area
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a medium for searching a white point area.
Background
In photography and image processing, automatic white balancing (Automatic white balance, AWB) is a process of globally adjusting colors in an image to remove any undesirable color shift emanating from an illumination source on an imaged scene. The method comprises the following steps that an AWB algorithm for searching white points based on color temperature curve calibration is mainstream in the existing AWB algorithm, and the algorithm firstly carries out color temperature curve calibration on a camera module to acquire priori knowledge; and secondly, searching a white point area in image statistical data by utilizing a color temperature curve, so that quick and accurate image white balance can be realized.
However, the current AWB algorithm only counts one neutral block in the image and generates a corresponding color temperature curve, so that the characteristic of the neutral block under different color temperatures is reflected by the color temperature curve, and thus, inaccuracy can occur in acquiring the white point area in the AWB algorithm.
Disclosure of Invention
The application provides a method, a device, equipment and a medium for searching a white point area, which are used for searching the white point area by utilizing color temperature curves corresponding to neutral blocks with various different gray values, so that the accuracy of the white point area is improved.
In a first aspect, the present application provides a method of finding a white point region, the method comprising:
shooting a standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images, wherein a camera in the camera is required to calibrate a color temperature curve;
calculating a plurality of Raw images to obtain an R/G value set and a B/G value set, wherein the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each Raw image;
constructing a coordinate system by taking an R/G value as an abscissa and a B/G value as an ordinate, constructing a scatter diagram by taking an R/G value set and a B/G value set in the coordinate system, and fitting to obtain a plurality of color temperature curves;
constructing an initial white point area in a coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set and the maximum value in the B/G value set;
and scaling the initial white point area according to the R/G value set and the B/G value set to obtain a white point area in a coordinate system, so that the white point area is applied to an AWB algorithm.
Optionally, calculating the plurality of Raw images to obtain an R/G value set and a B/G value set, including:
for each Raw image: counting the Raw image, and determining coordinate areas of a plurality of neutral blocks in the Raw image; and respectively calculating coordinate areas of the plurality of neutral blocks to obtain R/G values and B/G values corresponding to the plurality of neutral blocks.
Optionally, constructing an initial white point region in the coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set, and the maximum value in the B/G value set, including:
taking a color temperature curve at the periphery of the plurality of color temperature curves as a maximum value curve according to the scatter diagram;
and constructing an initial white point area in a coordinate system according to the maximum curve, the maximum value in the R/G value set and the maximum value in the B/G value set.
Optionally, scaling the initial white point region according to the R/G value set and the B/G value set, comprising:
dividing an initial white point region into a high color temperature region, a medium color temperature region and a low color temperature region according to the slope of the maximum curve;
and scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set respectively.
Optionally, dividing the initial white point region into a high color temperature region, a medium color temperature region and a low color temperature region according to a slope of the maximum curve includes:
taking a region with the slope of the highest curve in the initial white point region being larger than a preset high color temperature curvature value as a high color temperature region;
taking a region with the slope of the most value curve in the initial white point region smaller than a preset low color temperature curvature value as a low color temperature region;
the region between the high color temperature region and the low color temperature region in the initial white point region is taken as a medium color temperature region.
Optionally, scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set, respectively, includes:
calculating the difference between the maximum value in the R/G value set and the minimum value in the R/G value set to obtain an R/G difference;
calculating the difference between the maximum value in the B/G value set and the minimum value in the B/G value set to obtain a B/G difference;
comparing the R/G difference value with the B/G difference value to obtain a smaller value;
scaling a color temperature curve in a high color temperature region by utilizing the R/G difference value and the high region scaling value;
scaling the color temperature curve in the middle color temperature region by using the smaller value and the middle region scaling value;
and scaling the color temperature curve in the low color temperature region by using the B/G difference value and the low region scaling value.
Optionally, the method further comprises:
comparing the R/G value and the B/G value in the image to be processed with a white point area to obtain an image white point of the image to be processed;
calculating an R channel gain value and a B channel gain value of the image white point by using the image white point;
and respectively applying the R channel gain value and the B channel gain value to the R channel and the B channel of the image to be processed so as to enable the image to be processed to realize image white balance by using an AWB algorithm.
In a second aspect, the present application provides an apparatus for searching for a white point region, the apparatus comprising:
the obtaining unit is used for shooting the standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images, wherein a camera in the camera is required to carry out color temperature curve calibration;
the computing unit is used for computing the plurality of Raw images to obtain an R/G value set and a B/G value set, wherein the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each Raw image;
the construction unit is used for constructing a coordinate system by taking the R/G value as an abscissa and the B/G value as an ordinate, constructing a scatter diagram by taking the R/G value set and the B/G value set in the coordinate system, and fitting to obtain a plurality of color temperature curves;
the construction unit is also used for constructing an initial white point area in a coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set and the maximum value in the B/G value set;
and the obtaining unit is also used for scaling the initial white point area according to the R/G value set and the B/G value set to obtain the white point area in the coordinate system so as to apply the white point area to the AWB algorithm.
Optionally, the computing unit is specifically configured to:
for each Raw image: counting the Raw images, and determining the positions of a plurality of neutral blocks in the Raw images; and respectively calculating the positions of the neutral blocks to obtain R/G values and B/G values corresponding to the neutral blocks.
Optionally, the constructing unit is configured to construct the initial white point region in the coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set, and the maximum value in the B/G value set, and includes:
a determining subunit, configured to take a color temperature curve of the periphery of the plurality of color temperature curves as a maximum value curve according to the scatter diagram;
and a construction subunit, configured to construct an initial white point area in the coordinate system according to the maximum curve, the maximum value in the R/G value set and the maximum value in the B/G value set.
Optionally, the obtaining unit is configured to, when scaling the initial white point region according to the R/G value set and the B/G value set, include:
the dividing subunit is used for dividing the initial white point area into a high color temperature area, a medium color temperature area and a low color temperature area according to the slope of the maximum curve;
and the scaling subunit is used for respectively scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set to obtain a white point region.
Optionally, the dividing subunit is specifically configured to:
taking a region with the slope of the highest curve in the initial white point region being larger than a preset high color temperature curvature value as a high color temperature region;
taking a region with the slope of the most value curve in the initial white point region smaller than a preset low color temperature curvature value as a low color temperature region;
the region between the high color temperature region and the low color temperature region in the initial white point region is taken as a medium color temperature region.
Optionally, the scaling subunit is specifically configured to:
calculating the difference between the maximum value in the R/G value set and the minimum value in the R/G value set to obtain an R/G difference;
calculating the difference between the maximum value in the B/G value set and the minimum value in the B/G value set to obtain a B/G difference;
comparing the R/G difference value with the B/G difference value to obtain a smaller value;
scaling a color temperature curve in a high color temperature region by utilizing the R/G difference value and the high region scaling value;
scaling the color temperature curve in the middle color temperature region by using the smaller value and the middle region scaling value;
and scaling the color temperature curve in the low color temperature region by using the B/G difference value and the low region scaling value.
Optionally, the device is further configured to:
comparing the R/G value and the B/G value in the image to be processed with a white point area to obtain an image white point of the image to be processed;
calculating an R channel gain value and a B channel gain value of the image white point by using the image white point;
and respectively applying the R channel gain value and the B channel gain value to the R channel and the B channel of the image to be processed so as to enable the image to be processed to realize image white balance by using an AWB algorithm.
In a third aspect, the present application provides an electronic device, the device comprising a memory and a processor:
the memory is used for storing a computer program;
the processor is configured to perform the method provided in the first aspect above according to a computer program.
In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program for performing the method provided in the first aspect above.
From this, this application has following beneficial effect:
the application provides a method for searching a white point area, which is used for shooting a standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images; calculating a plurality of Raw images to obtain an R/G value set and a B/G value set; then, R/G value is taken as an abscissa, B/G value is taken as an ordinate, a coordinate system is constructed, a scatter diagram is constructed by the R/G value set and the B/G value set in the coordinate system, and a plurality of color temperature curves are obtained through fitting; and finally, scaling the initial white point area according to the R/G value set and the B/G value set to obtain the white point area in the coordinate system so as to apply the white point area to an AWB algorithm. In the process, R/G value sets and B/G value sets are obtained by calculating Raw images obtained through shooting under different color temperatures, a scatter diagram is constructed according to the R/G value sets and the B/G value sets, a plurality of color temperature curves are obtained, so that the response of a sensor to the light source tone is reflected more accurately, an initial white point area can be scaled according to the plurality of color temperature curves, the R/G value sets and the B/G value sets, the white point area in a coordinate system is obtained, and the accuracy of the white point area is improved. In addition, the white point region can be applied to the AWB algorithm, so that the effect of the AWB algorithm is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a flowchart of a method for searching a white point area according to an embodiment of the present application;
FIG. 2 is a flow chart of an embodiment of a method for finding white point areas according to the embodiments of the present application;
FIG. 3 is a schematic diagram of a scatter diagram in a method for finding white point areas according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a method for searching white point areas to divide color temperature areas according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a device for searching for white point areas according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to comply with the related laws and regulations and standards of the related countries and regions.
The color temperature curve calibration is to count the characteristics of white blocks or gray blocks under different color temperatures, and fit the white blocks or gray blocks in a proper coordinate system to obtain a color temperature curve. At present, characteristic statistics for color temperature curve calibration are mainly divided into two types: the first is the ratio of the red (R), blue (B) and green (G) channels, i.e. R/G and B/G values, using the RGB gamut of the image, and the second is the use of the YCrCb gamut chrominance channels (Cr and Cb).
The first characteristic statistics method is to construct a coordinate system by taking an R/G value as an abscissa and taking a B/G value as an ordinate, and fit a curve, so that a color temperature curve is obtained, and white point areas are obtained around the color temperature curve in a certain mode. The sea AWB algorithm constructs a hexagon on the color temperature curve through 6 control parameters, and takes the hexagon as a white point area; there are algorithms that construct ellipses or squares with a certain radius with points on a color temperature curve as the center, and the areas formed by all ellipses and squares are used as white point areas. The second characteristic statistical method is to construct a coordinate system by taking the Cr value as the abscissa and taking the Cb value as the ordinate, and fit a curve, so that the white point area is obtained in a manner basically similar to the first characteristic statistical method.
In this case, a first characteristic statistical method is commonly used, that is, a method for searching for a white point region in an AWB algorithm by using R/G values and B/G values of an RGB color gamut of an image, and since characteristics of neutral blocks with different gray values at the same color temperature remain substantially the same in an ideal sensor, only one neutral block is generally counted, and a corresponding color temperature curve is generated, so that characteristics of the neutral block at different color temperatures are reflected by the color temperature curve. But the characteristics of the neutral blocks of different gray values at the same color temperature are different due to imperfections in the sensor hardware. Therefore, only one color temperature curve corresponding to the neutral patch is used to reflect the characteristics of the neutral patch at different color temperatures, but inaccuracy occurs, and likewise, a white area obtained by only one color temperature curve is inaccurate.
In the embodiment of the application, a plurality of color temperature curves can be generated by introducing statistics on a plurality of neutral blocks, so that the response of the sensor to the light source tone is reflected more accurately, the white point area is determined by the difference value of the plurality of color temperature curves, the difference of different brightness image statistical data under different color temperatures is considered, and a more accurate white point area is constructed.
In particular implementations, the method may include, for example: firstly, shooting a standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images, wherein a camera in the camera is required to calibrate a color temperature curve; calculating the plurality of Raw images to obtain an R/G value set and a B/G value set, wherein the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each Raw image; constructing a coordinate system by taking an R/G value as an abscissa and a B/G value as an ordinate, constructing a scatter diagram by taking an R/G value set and a B/G value set in the coordinate system, and fitting to obtain a plurality of color temperature curves; and finally, scaling the initial white point area according to the R/G value set and the B/G value set to obtain the white point area in the coordinate system so as to apply the white point area to an AWB algorithm.
Therefore, according to the method provided by the implementation of the application, the R/G value set and the B/G value set are obtained, the R/G value set and the B/G value set are used for constructing the scatter diagram in the coordinate system, so that a plurality of color temperature curves are obtained, the response of the sensor to the light source tone can be reflected more accurately, and according to the plurality of color temperature curves, the R/G value set and the B/G value set, the initial white point area can be subjected to scaling operation, the more accurate white point area is obtained, and the effect of the AWB algorithm can be improved.
In order to facilitate understanding of the specific implementation of the method for searching for the white point area provided in the embodiments of the present application, the following description will be made with reference to the accompanying drawings.
It should be noted that, the main body of implementing the method for searching the white point area may be the device for searching the white point area provided in the embodiment of the present application, and the device for searching the white point area may be carried in an electronic device or a functional module of the electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method for searching the white point area in the embodiment of the present application, for example, may be an internet of things (Internet of Things, ioT) device.
Fig. 1 is a flowchart of a method for searching a white point area according to an embodiment of the present application. The method may be applied to a device for searching for a white point area, which may be, for example, the device 500 for searching for a white point area as shown in fig. 5, or may be a functional module integrated into the electronic device 600 as shown in fig. 6.
As shown in fig. 1, the method includes the following S101 to S104:
s101: and shooting the standard 24 color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images, wherein the camera in the camera is required to calibrate a color temperature curve.
In order to obtain a white area, firstly, shooting a standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images; calculating a plurality of Raw images to obtain an R/G value set and a B/G value set; then, taking the R/G value as an abscissa and the B/G value as an ordinate, constructing a coordinate system, and constructing a scatter diagram by the R/G value set and the B/G value set in the coordinate system to obtain a plurality of color temperature curves; and finally, according to the plurality of color temperature curves, the R/G value set and the B/G value set, obtaining a white point area in the coordinate system so as to apply the white point area to the AWB algorithm. Thus, obtaining a plurality of Raw images through S101 provides a precondition for obtaining a set of R/G values and a set of B/G values.
As one example, S101 may include: shooting in color temperature boxes under different color temperatures by using cameras needing to calibrate color temperature curves to obtain a plurality of Raw images.
The color temperature range may be, for example, 2500K-7500K, and a Raw image is taken under 6 light sources with different color temperatures, for example: common light sources such as an A light source (color temperature 2856K), a U30 light source (color temperature 3000K), a U35 light source (color temperature 3500K), a TL84 light source (color temperature 4000K), a D50 light source (color temperature 5000K), a D65 light source (color temperature 6500K) and the like, namely, the obtained plurality of Raw images can be 6 Raw images obtained under the 6 light sources with different color temperatures.
It should be noted that, at a certain color temperature, the illuminance of the light source in the color temperature box is about 1000lux, no influence of other light sources is guaranteed, and in order to guarantee the reliability of data, the 24 color cards in the shot Raw image account for more than 60% of the image and the shot is clear, for example, the gray value of the 19 # neutral block is more than 150 (8 bit data).
S102: and calculating the plurality of Raw images to obtain an R/G value set and a B/G value set, wherein the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each Raw image.
As one example, S102 may include: s1021, reading each Raw image, acquiring coordinate areas of a plurality of neutral blocks in each Raw image, and S1022, respectively calculating according to the coordinate areas of the plurality of neutral blocks in each Raw image to acquire R/G values and B/G values corresponding to the plurality of neutral blocks.
The neutral blocks may be gray blocks in 24 color cards, for example, and only numbers 19-24 in the 24 color cards are neutral blocks, but no 24 is basically used, because the gray values are too low, and errors exist. Thus, here, for example, the obtained R/G values and B/G values corresponding to the plurality of neutral blocks are R/G values and B/G values corresponding to 5 neutral blocks of neutral blocks 19 to 23, that is, the R/G value set and the B/G value set are R/G values and B/G values corresponding to 5 neutral blocks in each of the above 6 Raw images.
It should be noted that, the coordinate area for obtaining the neutral block needs to be as large as possible to avoid the influence of the outlier on the statistics.
S103: and constructing a coordinate system by taking the R/G value as an abscissa and the B/G value as an ordinate, constructing a scatter diagram by the R/G value set and the B/G value set in the coordinate system, and fitting to obtain a plurality of color temperature curves.
As one example, S103 may include: firstly, constructing a coordinate system with an R/G value as an abscissa and a B/G value as an ordinate, then constructing a scatter diagram in the coordinate system according to the R/G value and the B/G value of different neutral blocks under different color temperatures, and finally fitting color temperature curves corresponding to the different neutral blocks through a function fitting tool.
Here, as shown in fig. 2, 5 sets of data are obtained by sorting according to the R/G values and the B/G values corresponding to the 5 neutral blocks in each of the 6 Raw images, and a scatter diagram is drawn by using a function fitting tool to obtain 5 color temperature curves, where the 5 color temperature curves respectively correspond to the 19-23 neutral blocks.
S104: and constructing an initial white point area in a coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set and the maximum value in the B/G value set.
As one example, S104 may include: s1041, taking a color temperature curve of the periphery of the plurality of color temperature curves as a maximum value curve according to the scatter diagram; s1042, constructing an initial white point area in a coordinate system according to the maximum curve, the maximum value in the R/G value set and the maximum value in the B/G value set.
The maximum curves in S1041 are two color temperature curves at the upper and lower outermost peripheries of the distribution area in the scatter diagram, and in S1042, a closed area is constructed in the coordinate system by taking the two color temperature curves, the maximum value in the R/G value set and the maximum value in the B/G value set, which is called an initial white point area.
S105: and scaling the initial white point area according to the R/G value set and the B/G value set to obtain a white point area in a coordinate system, so that the white point area is applied to an AWB algorithm.
As one example, S105 specifically includes: dividing an initial white point region into a high color temperature region, a medium color temperature region and a low color temperature region according to the slope of the maximum curve; and scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set respectively, so as to obtain a white point region.
Here, as shown in fig. 3, the initial white point region of the hatched portion in the figure is obtained from the above-obtained scatter diagram, and then the initial white point region is divided into a high color temperature region, a medium color temperature region, and a low color temperature region according to the slope of the maximum curve, specifically divided into: (1) The color temperature curve in the high color temperature area changes faster, so that the R/G value gradually approaches a certain value, and therefore, the area with the slope of the maximum curve in the initial white point area larger than the preset high color temperature curvature value is used as the high color temperature area, for example, the preset high color temperature curvature value is 3; (2) The color temperature curve of the low color temperature area changes slowly, so that the B/G value gradually approaches to a certain value, and therefore, the area with the slope of the maximum curve smaller than the preset low color temperature curve value in the initial white point area is used as the low color temperature area, for example, the curvature is smaller than 1/3, so that the B/G value gradually approaches to a certain value; the middle color temperature region is between the high color temperature region and the low color temperature region.
The scaling of the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set comprises: firstly, calculating a difference value between a maximum value in an R/G value set and a minimum value in the R/G value set to obtain an R/G difference value; calculating the difference between the maximum value in the B/G value set and the minimum value in the B/G value set to obtain a B/G difference; comparing the R/G difference value with the B/G difference value to obtain a smaller value;
there are different zoom operations for different color temperature areas, as described in detail below:
(1) For the high color temperature region: since the R/G value gradually tends to a certain value as the B/G value gradually becomes smaller, the color temperature curve in the high color temperature region is scaled by the R/G difference value and the high region scaling value; for example, the high region scaling value is 0-0.5, then the maximum value of the color temperature curve in the high color temperature region is right shifted by 0.5 times the R/G difference value, for example.
(2) For the medium color temperature region: because the R/G value and the B/G value change smoothly, the color temperature curve in the middle color temperature area is scaled by utilizing the smaller value and the middle area scaling value; for example, if the middle region scaling value is 0-0.5, for example, if the smaller value is the R/G difference (B/G difference), the minimum value of the color temperature curve in the middle color temperature region is shifted left (shifted down) by a smaller value of 0.25 times, and the maximum value is shifted right (shifted up) by a smaller value of 0.25 times.
(3) For low color temperature regions: because the B/G value gradually approaches to a certain value, the B/G difference value of the color temperature curve and the scaling value of the low region are utilized to scale the color temperature curve in the low color temperature region; for example, the low region scaling value is 0.5-1.5, then the minimum value of the color temperature curve in the low color temperature region is shifted down by a factor of 1 by the B/G difference value, for example.
By utilizing the characteristics of the white areas, the three color temperature areas in the initial white areas are scaled, so that a more accurate white area can be obtained, the white area is applied to the AWB algorithm, and the effect of the AWB algorithm is improved.
In addition to obtaining a final white area, the white area can be applied to an AWB algorithm to realize image white balance, so that the embodiment of the application further includes a method for utilizing the AWB algorithm, which specifically includes: firstly, comparing an R/G value and a B/G value in an image to be processed with a white point area to obtain an image white point of the image to be processed; calculating an R channel gain value and a B channel gain value of the image white point by utilizing the image white point, wherein the R channel gain value is a G/R value, and the B channel gain value is a G/B value; and finally, respectively applying the R channel gain value and the B channel gain value to the R channel and the B channel of the image to be processed so as to enable the image to be processed to realize image white balance by utilizing an AWB algorithm.
Therefore, according to the embodiment of the application, the R/G value set and the B/G value set are obtained, the R/G value set and the B/G value set are combined in the coordinate system to form the scatter diagram, so that a plurality of color temperature curves are obtained, the response of the sensor to the light source tone can be reflected more accurately, and according to the plurality of color temperature curves, the R/G value set and the B/G value set, the white point areas of different color temperature areas can be scaled to obtain more accurate white point areas, so that the effect of an AWB algorithm can be improved.
In order to make the method provided by the embodiments of the present application clearer and easier to understand, a specific example of the method is described below with reference to fig. 4.
As shown in fig. 4, this embodiment may include:
s401: and shooting the standard 24 color card under 6 color temperatures based on a camera to obtain 6 Raw images.
As one example, S401 may include: and shooting 24-color card Raw images corresponding to 6 light sources of A, U, U35, TL84, D50 and D65 under 6 color temperatures, and obtaining 6 Raw images.
S402: and counting the 6 Raw images, determining coordinate areas of 5 neutral blocks in each Raw image, respectively calculating the coordinate areas of 5 neutral blocks, and taking R/G values and B/G values corresponding to the 5 neutral blocks in each Raw image in the 6 Raw images as an R/G value set and a B/G value set.
As one example, S402 may include: and sequentially reading 6 Raw images, counting 1 Raw image each time to obtain a corresponding coordinate area of the 19-23 number neutral block, calculating an R/G value and a B/G value according to the coordinate area of the 19-23 number neutral block, and obtaining an R/G value set and a B/G value set after the calculation of the 6 Raw images is completed.
S403: and constructing a coordinate system by taking the R/G value as an abscissa and the B/G value as an ordinate.
In order to obtain the color temperature curve, a coordinate system is constructed by taking the R/G value as an abscissa and taking the B/G value as an ordinate.
S404: and constructing a scatter diagram of the R/G value set and the B/G value set in a coordinate system, and fitting to obtain 5 color temperature curves.
And (3) sorting the R/G value set and the B/G value set to obtain 5 groups of data, and respectively fitting the 5 groups of data by using a function fitting tool to obtain 5 color temperature curves.
S405: according to the scatter diagram, the color temperature curve of the periphery of the 5 color temperature curves is taken as the maximum value curve.
And taking two outermost curves in the 5 color temperature curves as the maximum curves.
S406: and constructing an initial white point area in a coordinate system according to the maximum curve, the maximum value in the R/G value set and the maximum value in the B/G value set.
S407: the initial white point region is divided into a high color temperature region, a medium color temperature region and a low color temperature region according to the slope of the maximum curve.
For example, if the curvature of the maximum curve is greater than 3, the region is divided into a high color temperature region, and if the curvature of the maximum curve is less than 1/3, the region is divided into a low color temperature region, and finally, a medium color temperature region is interposed between the high color temperature region and the low color temperature region.
S408: and obtaining an R/G difference value, a B/G difference value and a smaller value according to the R/G value set and the B/G value set, wherein the smaller value is the smaller value in the R/G difference value and the B/G difference value.
S409: and scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G difference value, the B/G difference value, the smaller value and the scaling value of each region to obtain a white region.
As one example, S409 may include: s4091, scaling a color temperature curve in a high color temperature region by utilizing the R/G difference value and a high region scaling value, wherein the high region scaling value is 0-0.5; s4092, scaling a color temperature curve in the middle color temperature region by using a smaller value and a middle region scaling value, wherein the middle region scaling value is 0-0.5; s4093, scaling the color temperature curve in the low color temperature region by using the B/G difference value and the low region scaling value, wherein the low region scaling value is 0.5-1.5.
And scaling the initial white point areas of different color temperature areas by utilizing the characteristics of the white areas to obtain more accurate white point areas.
S410: and comparing the R/G value and the B/G value in the image to be processed with the white point area to obtain the image white point of the image to be processed.
And taking the point of which the R/G value and the B/G value fall in the white point area in the image to be processed as the image white point of the image to be processed.
S411: the R-channel gain value and B-channel gain value of the image white point are calculated using the image white point.
As one example, S411 may include: and calculating the R/G value and the B/G value of the image white point, and then calculating the R channel gain value and the B channel gain value by utilizing the R/G value and the B/G value.
S412: and respectively applying the R channel gain value and the B channel gain value to the R channel and the B channel of the image to be processed so as to enable the image to be processed to realize image white balance by using an AWB algorithm.
The embodiment provides a method for searching a white point area, which comprises the steps of obtaining different Raw images through different color temperatures, calculating color temperature curves of neutral blocks with different gray values, reflecting the response of a sensor to the tone of a light source more accurately, scaling the white point area of the different color temperature areas by utilizing the characteristics of the white point area to obtain more accurate white point areas, further searching the white point of the images more accurately, and improving the effect of an AWB algorithm.
Referring to fig. 5, an embodiment of the present application provides an apparatus 500 for searching for a white point area, the apparatus including:
an obtaining unit 501, configured to obtain a plurality of Raw images based on a camera shooting a standard 24-color card under a plurality of color temperatures, where a camera in the camera needs to perform color temperature curve calibration;
the computing unit 502 is configured to compute a plurality of Raw images to obtain an R/G value set and a B/G value set, where the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each of the plurality of Raw images;
a construction unit 503, configured to construct a coordinate system with R/G values as abscissa and B/G values as ordinate, and construct a scatter diagram with R/G value sets and B/G value sets in the coordinate system, so as to obtain a plurality of color temperature curves;
a construction unit 503, configured to construct an initial white point region in a coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set, and the maximum value in the B/G value set;
the obtaining unit 501 is further configured to scale the initial white point area according to the R/G value set and the B/G value set, and obtain a white point area in a coordinate system, so that the white point area is applied to the AWB algorithm.
Optionally, the computing unit 502 is specifically configured to:
for each Raw image: counting the Raw images, and determining the positions of a plurality of neutral blocks in the Raw images; and respectively calculating the positions of the neutral blocks to obtain R/G values and B/G values corresponding to the neutral blocks.
Optionally, the constructing unit 503 is configured to construct an initial white point area in a coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set, and the maximum value in the B/G value set, and includes:
a determining subunit, configured to take a color temperature curve of the periphery of the plurality of color temperature curves as a maximum value curve according to the scatter diagram;
and a construction subunit, configured to construct an initial white point area in the coordinate system according to the maximum curve, the maximum value in the R/G value set and the maximum value in the B/G value set.
Optionally, the obtaining unit 501 is configured to, when scaling the initial white point area according to the R/G value set and the B/G value set, include:
the dividing subunit is used for dividing the initial white point area into a high color temperature area, a medium color temperature area and a low color temperature area according to the slope of the maximum curve;
and the scaling subunit is used for respectively scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set to obtain a white point region.
Optionally, the dividing subunit is specifically configured to:
taking a region with the slope of the highest curve in the initial white point region being larger than a preset high color temperature curvature value as a high color temperature region;
taking a region with the slope of the most value curve in the initial white point region smaller than a preset low color temperature curvature value as a low color temperature region;
the region between the high color temperature region and the low color temperature region in the initial white point region is taken as a medium color temperature region.
Optionally, the scaling subunit is specifically configured to:
calculating the difference between the maximum value in the R/G value set and the minimum value in the R/G value set to obtain an R/G difference;
calculating the difference between the maximum value in the B/G value set and the minimum value in the B/G value set to obtain a B/G difference;
comparing the R/G difference value with the B/G difference value to obtain a smaller value;
scaling a color temperature curve in a high color temperature region by utilizing the R/G difference value and the high region scaling value;
scaling the color temperature curve in the middle color temperature region by using the smaller value and the middle region scaling value;
and scaling the color temperature curve in the low color temperature region by using the B/G difference value and the low region scaling value.
Optionally, the apparatus 500 is further configured to:
comparing the R/G value and the B/G value in the image to be processed with a white point area to obtain an image white point of the image to be processed;
calculating an R channel gain value and a B channel gain value of the image white point by using the image white point;
and respectively applying the R channel gain value and the B channel gain value to the R channel and the B channel of the image to be processed so as to enable the image to be processed to realize image white balance by using an AWB algorithm.
It should be noted that, the specific implementation manner and the achieved effect of the apparatus 500 for searching for the white point area may be referred to the related description in the method provided in fig. 1 or fig. 4, and will not be repeated here.
The embodiment of the application further provides an electronic device 600, as shown in fig. 6, where the device 600 includes a memory 601 and a processor 602:
the memory 601 is for storing a computer program;
the processor 602 is configured to perform the methods provided in fig. 1 or fig. 4 described above in accordance with a computer program.
Furthermore, the present application provides a computer readable storage medium for storing a computer program for executing the method provided in fig. 1 or fig. 4.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus general hardware platforms. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, or the like, including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the methods described in the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The apparatus embodiments described above are merely illustrative, in which the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, may be located in one place, or may be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the objective of the embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application.

Claims (10)

1. A method of finding a white point region, the method comprising:
shooting a standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images, wherein a camera in the camera is required to calibrate a color temperature curve;
calculating the plurality of Raw images to obtain an R/G value set and a B/G value set, wherein the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each Raw image;
constructing a coordinate system by taking an R/G value as an abscissa and a B/G value as an ordinate, constructing a scatter diagram by the R/G value set and the B/G value set in the coordinate system, and fitting to obtain a plurality of color temperature curves;
constructing an initial white point area in the coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set and the maximum value in the B/G value set;
and scaling the initial white point area according to the R/G value set and the B/G value set to obtain a white point area in the coordinate system, so that the white point area is applied to an AWB algorithm.
2. The method of claim 1, wherein the computing the plurality of Raw images to obtain a set of R/G values and a set of B/G values comprises:
for each Raw image: counting the Raw image, and determining coordinate areas of a plurality of neutral blocks in the Raw image; and respectively calculating the coordinate areas of the plurality of neutral blocks to obtain R/G values and B/G values corresponding to the plurality of neutral blocks.
3. The method of claim 1, wherein said constructing an initial white point region in said coordinate system from said plurality of color temperature curves, a maximum value in said set of R/G values, and a maximum value in said set of B/G values comprises:
taking a color temperature curve at the periphery of the plurality of color temperature curves as a maximum value curve according to the scatter diagram;
and constructing an initial white point area in the coordinate system according to the maximum value curve, the maximum value in the R/G value set and the maximum value in the B/G value set.
4. The method of claim 3, wherein said scaling the initial white point region according to the R/G value set and B/G value set comprises:
dividing the initial white point region into a high color temperature region, a medium color temperature region and a low color temperature region according to the slope of the maximum curve;
and scaling the high color temperature region, the medium color temperature region and the low color temperature region according to the R/G value set and the B/G value set respectively.
5. The method of claim 4, wherein the dividing the initial white point region into a high color temperature region, a medium color temperature region, and a low color temperature region according to the slope of the maximum curve comprises:
taking a region with the slope of the maximum curve larger than a preset high color temperature curvature value in the initial white point region as the high color temperature region;
taking a region with the slope of the maximum curve smaller than a preset low color temperature curvature value in the initial white point region as the low color temperature region;
and taking a region between the high color temperature region and the low color temperature region in the initial white point region as the medium color temperature region.
6. The method of claim 4, wherein scaling the high, medium, and low color temperature regions according to the R/G and B/G value sets, respectively, comprises:
calculating the difference between the maximum value in the R/G value set and the minimum value in the R/G value set to obtain an R/G difference;
calculating the difference between the maximum value in the B/G value set and the minimum value in the B/G value set to obtain a B/G difference;
comparing the R/G difference value with the B/G difference value to obtain a smaller value;
scaling a color temperature curve in the high color temperature region by using the R/G difference value and a high region scaling value;
scaling a color temperature curve in the middle color temperature region by using the smaller value and the middle region scaling value;
and scaling the color temperature curve in the low color temperature region by using the B/G difference value and the low region scaling value.
7. The method according to any one of claims 1-6, further comprising:
comparing the R/G value and the B/G value in the image to be processed with the white point area to obtain an image white point of the image to be processed;
calculating an R channel gain value and a B channel gain value of the image white point by utilizing the image white point;
and respectively acting the R channel gain value and the B channel gain value on the R channel and the B channel of the image to be processed so as to enable the image to be processed to realize image white balance by using an AWB algorithm.
8. An apparatus for locating white point areas, the apparatus comprising:
the obtaining unit is used for shooting the standard 24-color card under a plurality of color temperatures based on a camera to obtain a plurality of Raw images, wherein a camera in the camera is required to carry out color temperature curve calibration;
the computing unit is used for computing the plurality of Raw images to obtain an R/G value set and a B/G value set, wherein the R/G value set and the B/G value set are sets of R/G values and B/G values corresponding to a plurality of neutral blocks in each Raw image;
the construction unit is used for constructing a coordinate system by taking the R/G value as an abscissa and the B/G value as an ordinate, constructing a scatter diagram by the R/G value set and the B/G value set in the coordinate system, and fitting to obtain a plurality of color temperature curves;
the construction unit is further used for constructing an initial white point area in the coordinate system according to the plurality of color temperature curves, the maximum value in the R/G value set and the maximum value in the B/G value set;
the obtaining unit is further configured to scale the initial white point area according to the R/G value set and the B/G value set, and obtain a white point area in the coordinate system, so that the white point area is applied to an AWB algorithm.
9. An electronic device, characterized in that the device comprises a memory and a processor for executing a program stored in the memory, running the method according to any one of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium is for storing a computer program for executing the method of any one of claims 1-7.
CN202410046766.7A 2024-01-11 2024-01-11 Method, device, equipment and medium for searching white point area Pending CN117835076A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410046766.7A CN117835076A (en) 2024-01-11 2024-01-11 Method, device, equipment and medium for searching white point area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410046766.7A CN117835076A (en) 2024-01-11 2024-01-11 Method, device, equipment and medium for searching white point area

Publications (1)

Publication Number Publication Date
CN117835076A true CN117835076A (en) 2024-04-05

Family

ID=90515301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410046766.7A Pending CN117835076A (en) 2024-01-11 2024-01-11 Method, device, equipment and medium for searching white point area

Country Status (1)

Country Link
CN (1) CN117835076A (en)

Similar Documents

Publication Publication Date Title
CN110830778B (en) Imaging device color correction method, imaging device color correction device, electronic device and storage medium
CN101272508B (en) Imaging device and method of processing imaging result in imaging device
CN107197225A (en) Color digital camera white balance correcting based on chromatic adaptation model
CN105578166B (en) A kind of colour temperature determines method and device
CN108551576B (en) White balance method and device
CN110248170B (en) Image color adjusting method and device
CN107483908A (en) White balance calibration method and electronic equipment
CN111311513B (en) Method, device and computer storage medium for unifying color and style of image
CN112655193A (en) Camera, alignment method and device thereof and cradle head
CN105898263B (en) A kind of image white balance method, device and computing device
CN111163301B (en) Color adjustment method, device and computer readable storage medium
CN114745532B (en) Mixed color temperature scene white balance processing method and device, storage medium and terminal
CN112788251B (en) Image brightness processing method and device, and image processing method and device
CN111314684B (en) Metamerism-based white balance correction method
CN111670575B (en) White balance processing method and device for image
EP1146726A1 (en) Method for optimising the colour target for a printer model
CN114866754A (en) Automatic white balance method and device, computer readable storage medium and electronic equipment
CN112689140A (en) White balance synchronization method and device, electronic equipment and storage medium
CN112788322B (en) Adaptive white balance processing method, device, medium, and electronic apparatus
US20010038459A1 (en) Method for optimising the colour target for a printer model
CN110751607A (en) Skin color correction method and device, storage medium and electronic device
CN103686113B (en) Based on the white balance system of raw data and the method for digital camera
CN117835076A (en) Method, device, equipment and medium for searching white point area
CN111757079B (en) White balance statistical method and device
CN115965541A (en) Color correction method, color correction device, electronic device, and storage medium

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