CN113497927A - White balance adjusting method, device, terminal and storage medium - Google Patents

White balance adjusting method, device, terminal and storage medium Download PDF

Info

Publication number
CN113497927A
CN113497927A CN202010192160.6A CN202010192160A CN113497927A CN 113497927 A CN113497927 A CN 113497927A CN 202010192160 A CN202010192160 A CN 202010192160A CN 113497927 A CN113497927 A CN 113497927A
Authority
CN
China
Prior art keywords
gain value
value
image block
color temperature
target image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010192160.6A
Other languages
Chinese (zh)
Other versions
CN113497927B (en
Inventor
张钧凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010192160.6A priority Critical patent/CN113497927B/en
Publication of CN113497927A publication Critical patent/CN113497927A/en
Application granted granted Critical
Publication of CN113497927B publication Critical patent/CN113497927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The embodiment of the application discloses a white balance adjusting method, a white balance adjusting device, a terminal and a storage medium, wherein the method comprises the following steps: acquiring an original image of a target shooting scene and color temperature information acquired by a color temperature sensor; calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block; determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve; and adjusting the first gain value by using the second gain value to obtain the final gain value of the target image block. Therefore, the color temperature sensor can be used for quickly detecting the color temperature information, the white balance algorithm is used for adjusting the second gain value corresponding to the color temperature information to obtain the first gain value, the accuracy of the image gain value is improved, and the white balance adjusting effect is further improved.

Description

White balance adjusting method, device, terminal and storage medium
Technical Field
The present application relates to image processing technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for adjusting white balance.
Background
When a terminal with a shooting function is used for shooting, a color value acquired by a color image and the real color of an object deviate, a human visual system has color constancy and can acquire the invariant characteristic of the surface color of the object under the changing illumination environment and imaging condition, but the imaging equipment does not have the adjusting function, different illumination environments can cause the acquired image color and the real color to deviate to a certain extent, a proper color balance (correction) algorithm needs to be selected, and the influence of the illumination environment on color display is eliminated. The gray world algorithm is the most commonly used balancing algorithm.
However, the gray world algorithm is easy to have obvious misjudgment in some special scenes. In a pure color scene, since the pure color structure has no contrast with other colors, scattered points are presented on the gray world algorithm, and it is difficult to predict the linear light source trend, so the possibility of wrong judgment is quite high. In a mixed light source scene without a human face reference basis, a correct light source in the environment cannot be known, only effect adjustment is relied on, the mixed light source is weighed through a weighting mode, the result is too subjective, and inconsistent results before and after white balance easily occur.
Disclosure of Invention
In order to solve the foregoing technical problem, embodiments of the present application are intended to provide a white balance adjustment method, an apparatus, a terminal, and a storage medium.
The technical scheme of the application is realized as follows:
in a first aspect, a white balance adjustment method is provided, which includes:
acquiring an original image, which is acquired by an image acquisition unit and aims at a target shooting scene, and color temperature information, which is acquired by a color temperature sensor and aims at the target shooting scene;
calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block;
determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve;
and adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block.
In a second aspect, there is provided a white balance adjustment apparatus, the apparatus including:
the acquisition unit is used for acquiring an original image which is acquired by the image acquisition unit and aims at a target shooting scene and color temperature information which is acquired by the color temperature sensor and aims at the target shooting scene;
the calculating unit is used for calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block;
the determining unit is used for determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve;
and the adjusting unit is used for adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block.
In a third aspect, a terminal is provided, where the terminal includes: an image acquisition unit, a color temperature sensor, a processor and a memory configured to store a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the aforementioned method when running the computer program.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the aforementioned method.
The embodiment of the application provides a white balance adjustment method, a white balance adjustment device, a terminal and a storage medium, wherein the method comprises the following steps: acquiring an original image of a target shooting scene and color temperature information acquired by a color temperature sensor; calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block; determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve; and adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block. Therefore, the color temperature sensor can be used for rapidly detecting the color temperature information, the white balance algorithm is used for adjusting the second gain value corresponding to the color temperature information to obtain the first gain value, the accuracy of the image gain value is improved, and the white balance adjusting effect is further improved.
Drawings
Fig. 1 is a first flowchart of a white balance adjustment method according to an embodiment of the present application;
fig. 2 is a second flowchart of a white balance adjustment method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a two-dimensional coordinate system in an embodiment of the present application;
FIG. 4 is a diagram illustrating a mapping relationship between distances and weights in an embodiment of the present application;
FIG. 5 is a schematic diagram of a white balance adjustment apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a terminal in an embodiment of the present application.
Detailed Description
So that the manner in which the features and elements of the present embodiments can be understood in detail, a more particular description of the embodiments, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings.
An embodiment of the present application provides a white balance adjustment method, and fig. 1 is a first flowchart of the white balance adjustment method in the embodiment of the present application, and as shown in fig. 1, the method may specifically include:
step 101: acquiring an original image, which is acquired by an image acquisition unit and aims at a target shooting scene, and color temperature information, which is acquired by a color temperature sensor and aims at the target shooting scene;
the white balance adjusting method provided in the embodiment of the application can be applied to a terminal with an image acquisition function, the terminal comprises an image acquisition unit and a color temperature sensor, and the terminal can be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like. The terminal may include: a photographing unit, an audio input unit, an audio output unit, a display unit, a user input unit, a memory, a processor, and a power supply.
The white balance adjusting method provided in the embodiment of the application can also be applied to a device with a white balance adjusting function, the device acquires an original image acquired by an image acquisition unit on a terminal and color temperature information acquired by a color temperature sensor, and the color temperature information is utilized to perform white balance processing on the original image.
Step 102: calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block;
in practical applications, before the calculating the three-channel response of the target image block in the original image based on the white balance algorithm, the method further includes: dividing the original image into M × N image blocks; wherein M and N are both positive integers; and taking any one image block in the M multiplied by N image blocks as the target image block.
That is, the image is first divided into M × N image blocks, and the number of the image blocks is related to the actual white balance adjustment device. When M and N are 1, the original image is not required to be segmented, and three-channel response of the original image is directly calculated based on a white balance algorithm; when M and N are not all 1, the original image needs to be divided according to a certain division strategy, for example, the division strategy is to divide the original image into rectangular image blocks of M rows and N columns, or to divide the original image into foreground or background according to a shooting object in the original image.
The target image block is obtained as follows: and (3) selecting a target image block by taking the (i, j) th pixel point of the original image as a target vertex according to the preset length w and the preset width h, wherein i is an integer smaller than P, j is an integer smaller than Q, the (P, Q) is the coordinate of the pixel point with the maximum row index and the maximum column index in the original image, and the target vertex is the vertex positioned at the upper left end in the target image block.
In practical application, a human visual system has color constancy, and can acquire the invariant characteristic of the surface color of an object under the changing illumination environment and imaging conditions, but an imaging device does not have the function of such color constancy, different illumination environments can cause the deviation of the acquired image color from the real color to a certain extent, and a proper color balance (correction) algorithm needs to be selected to eliminate the influence of the illumination environment on color display. Therefore, the white balance is needed to make the imaging device correctly conform to the result of human eye observation under various light sources. The gray world algorithm is the most commonly used white balance algorithm.
Illustratively, three-channel responses of each pixel point in the target image block are calculated by using a gray world algorithm, and the three-channel responses refer to Red (R) channel responses, Green (G) channel responses and Blue (B) channel responses of the pixels in the target image block. Since the G response of the camera sensor is far higher than the R response and the B response, the representation can be simplified to be represented by R/G and B/G, and the first gain value of the target image block is obtained by averaging the R/G and the B/G of all pixel points in the target image block.
Step 103: determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve;
the color temperature curve can be a Planck curve, the color temperature value obtained on the color temperature sensor is a color temperature value, the position corresponding to the Planck curve is calibrated on an R/G and B/G coordinate system in advance according to the color temperature information of the Planck curve, so a corresponding relation table of the color temperature, the R/G and the B/G coordinate can be established according to the Planck curve, after the color temperature is detected by the color temperature sensor, the corresponding relation table can be established according to the corresponding relation of the color temperature and the correction parameter calibrated in the Planck curve in advance, and the R/G and B/G values corresponding to the color temperature transmitted by the color temperature sensor, namely a second gain value, can be calculated directly by searching the corresponding relation table.
Step 104: and adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block.
In some embodiments, the step specifically includes: calculating a confidence level of the first gain value based on the second gain value; and adjusting the first gain value based on the reliability of the first gain value to obtain the final gain value of the target image block.
Illustratively, adjusting the first gain value based on the reliability of the first gain value to obtain a final gain value of the target image block includes: when the reliability is greater than or equal to the reliability threshold value, taking the first gain value as a final gain value; and when the reliability is smaller than the reliability threshold value, the first gain value is adjusted by using the reliability to obtain a final gain value.
That is to say, the reliability of the first gain value calculated by the white balance algorithm is determined according to the second gain value determined by the color temperature information, if the reliability is high, the white balance adjustment effect can be better achieved by directly using the first gain value to perform the white balance adjustment, if the reliability is low, the first gain value needs to be adjusted according to the reliability to obtain the final gain value, and then the white balance adjustment is performed by using the final gain value, so that the white balance adjustment effect is improved.
By adopting the technical scheme, the color temperature sensor can be used for quickly detecting the color temperature information, the white balance algorithm is used for adjusting the second gain value corresponding to the color temperature information to obtain the first gain value, the accuracy of the image gain value is improved, and the white balance adjusting effect is further improved.
On the basis of the foregoing embodiments, the present application provides a more specific white balance adjustment method, and fig. 2 is a schematic diagram of a second flow of the white balance adjustment method in the embodiments of the present application, and as shown in fig. 2, the method specifically includes:
step 201: acquiring an original image, which is acquired by an image acquisition unit and aims at a target shooting scene, and color temperature information, which is acquired by a color temperature sensor and aims at the target shooting scene;
in some embodiments, the method further comprises: dividing the original image into M × N image blocks; wherein M and N are both positive integers; and taking any one image block in the M multiplied by N image blocks as the target image block.
Step 202: calculating three-channel response of a target image block in the original image based on a gray world algorithm to obtain a first gain value of the target image block;
the Gray World Algorithm (GWA) is based on a Gray World assumption that considers: for an image with a large color variation, the average of the saturation of the three components Red (R), Green (G) and Blue (B) tends to be the same gray value. That is, the gray world algorithm assumes that the average of the average reflections of light from natural scenes is a constant value overall, and the saturation of R, G, B components in the constant value tends to be consistent. When abundant colors exist in the image, the influence of ambient light can be eliminated better by processing the image through the gray world algorithm.
Specifically, R response, G response and B response of each pixel point in the target image block are calculated based on a gray world algorithm; converting the R response, the G response and the B response of each pixel point into a two-dimensional coordinate system to obtain a two-dimensional coordinate value R/G and G/B of each pixel point; calculating the average values of R/G and G/B of all pixel points in the target image block to obtain the average value of R/G and the average value of G/B of the target image block; and taking the R/G average value and the G/B average value of the target image block as a first gain value of the target image block.
Here, the first gain value includes a first R/G and a first B/G.
Step 203: determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve;
the color temperature curve can be a Planck curve, the color temperature value obtained on the color temperature sensor is a color temperature value, the position corresponding to the Planck curve is calibrated on an R/G and B/G coordinate system in advance according to the color temperature information of the Planck curve, so a corresponding relation table of the color temperature, the R/G and the B/G coordinate can be established according to the Planck curve, after the color temperature is detected by the color temperature sensor, the corresponding relation table can be established according to the corresponding relation of the color temperature and the correction parameter calibrated in the Planck curve in advance, and the R/G and B/G values corresponding to the color temperature transmitted by the color temperature sensor, namely a second gain value, can be calculated directly by searching the corresponding relation table.
Here, the second gain value includes a second R/G and a second B/G.
Step 204: calculating a Euclidean distance between the first gain value and the second gain value;
here, when the first gain value and the second gain value are expressed in a two-dimensional coordinate system formed by R/G and B/G, the distance between two points is long and short, and the longer the distance, the lower the reliability, and the closer the distance, the higher the reliability.
In the embodiment of the present application, when the first gain value and the second gain value are expressed in the form of two-dimensional coordinate points in the sensor space, the reliability of the first gain value is expressed by calculating the euclidean distance between the first gain value and the second gain value.
Fig. 3 is a schematic diagram of a two-dimensional coordinate system of a sensor space in the embodiment of the present application, in fig. 3, an abscissa of the coordinate system is R/G, a total coordinate is B/G, a coordinate point corresponding to a first gain value of Ts, and Os is a coordinate point corresponding to a second gain value, and a distance D between the two-dimensional coordinate points is calculated through a euclidean distance calculation formula.
Specifically, the Euclidean distance calculation formula is
Figure BDA0002416325410000071
Wherein x1 is a first R/G, y1 is a first B/G, x2 is a second R/G, and y2 is a second B/G.
Step 205: determining a weight value of the first gain value based on a mapping relation between a distance and the weight value and the Euclidean distance;
when the second gain value is used for adjusting the first gain value, the Euclidean distance between the first gain value and the second gain value is quantized into a weight value, and the closer the distance is, the greater the weight is given; the smaller the distance, the less weight is given.
That is, the reliability may be expressed by quantizing the reliability into a weight value, and the magnitude of the weight value may be used to indicate the level of reliability, and the reliability may be involved in the adjustment calculation of the first gain value. Here, the higher the reliability is, the higher the weight value corresponding to the higher the reliability is, the lower the weight value corresponding to the lower the reliability is, for example, the weight value range is 0 to 1, and the closer the weight value is to 1, the higher the reliability is, the closer the weight value is to 0, the lower the reliability is.
Illustratively, the mapping relationship between the distance and the weight value includes: when the distance is smaller than or equal to the first distance value, the weight value is equal to the first weight value; when the distance is greater than the first distance value and less than or equal to the second distance value, the weight value and the distance are in a linear relation; and when the distance is greater than the second distance value, the weight value is equal to the second weight value.
The expression formula of the mapping relation between the distance and the weight value is as follows:
Figure BDA0002416325410000081
wherein D1 is the first distance threshold, and D2 is the second distance threshold.
Fig. 4 is a schematic diagram of a mapping relationship between distances and weights in the embodiment of the present application, as shown in fig. 4, an abscissa represents a distance D, an ordinate represents a weight W, and when the distance is less than D1, the weight is a constant value W1; when the distance is greater than D1 and less than D2, W is aD + b, a is W1/(D1-D2), and b is- (D2W 1)/(D1-D2).
Step 206: and multiplying the first gain value by the weight value of the first gain value to obtain the final gain value of the target image block.
Figure BDA0002416325410000082
Wherein, R/G is an ordinate value corresponding to the first gain value, B/G is an ordinate value corresponding to the first gain value, W is a weight value, and (R/G) Final is an abscissa value corresponding to the Final gain value, and (B/G) Final is an ordinate value corresponding to the Final gain value.
In practical applications, after determining the final gain value, the method further includes: and carrying out white balance adjustment on the target image block by using the final gain value of the target image block.
Specifically, a final gain value of each image block in the original image is determined, and white balance adjustment is performed on each image block by using the determined final gain value to obtain an image after white balance adjustment.
Because the calculated response information of each image block depends on the gray-scale world algorithm, if the color distribution of the image block is not uniform or is covered by shadow, the response information may be biased, resulting in incorrect final white balance result. However, the above weight division can effectively reduce the weight of the information of image block deviation or outlier, and can more accurately predict the white balance result.
An embodiment of the present application further provides a white balance adjustment device, as shown in fig. 5, the white balance adjustment device includes:
the acquiring unit 501 is configured to acquire an original image of a target shooting scene acquired by the image acquiring unit and color temperature information of the target shooting scene acquired by the color temperature sensor;
a calculating unit 502, configured to calculate three-channel responses of a target image block in the original image based on a white balance algorithm, so as to obtain a first gain value of the target image block;
a determining unit 503, configured to determine a second gain value corresponding to the color temperature information based on a correspondence between a color temperature and a gain value calibrated in advance in a color temperature curve;
an adjusting unit 504, configured to adjust the first gain value by using the second gain value, so as to obtain a final gain value of the target image block.
In some embodiments, the adjusting unit 504 is configured to calculate a reliability of the first gain value based on the second gain value; and adjusting the first gain value based on the reliability of the first gain value to obtain the final gain value of the target image block.
In some embodiments, the confidence level is a weight value, and the adjusting unit 504 is configured to specifically calculate a euclidean distance between the first gain value and the second gain value; determining a weight value of the first gain value based on a mapping relation between a distance and the weight value and the Euclidean distance; and multiplying the first gain value by the weight value of the first gain value to obtain the final gain value of the target image block.
In some embodiments, the mapping relationship between the distance and the weight value includes: when the distance is smaller than or equal to the first distance value, the weight value is equal to the first weight value; when the distance is greater than the first distance value and less than the second distance value, the weight value and the distance are in a linear relation; and when the distance is greater than or equal to the second distance value, the weight value is equal to the second weight value.
In some embodiments, the computing unit 502 is further configured to divide the original image into M × N image blocks; wherein M and N are both positive integers; and taking any one image block in the M multiplied by N image blocks as the target image block.
In some embodiments, the calculating unit 502 is specifically configured to calculate an R response, a G response, and a B response of each pixel point in the target image block based on a gray-scale world algorithm; converting the R response, the G response and the B response of each pixel point into a two-dimensional coordinate system to obtain a two-dimensional coordinate value R/G and G/B of each pixel point; calculating the average values of R/G and G/B of all pixel points in the target image block to obtain the average value of R/G and the average value of G/B of the target image block; and taking the R/G average value and the G/B average value of the target image block as a first gain value of the target image block.
In some embodiments, the adjusting unit 504 is further configured to perform white balance adjustment on the target image block by using the final gain value of the target image block.
In practical application, the white balance adjusting device can be applied to a terminal with a shooting function, so that when the terminal carries out shooting operation, the color temperature sensor can be used for quickly detecting color temperature information, the white balance algorithm is used for adjusting the second gain value corresponding to the color temperature information to obtain the first gain value, the accuracy of the image gain value is improved, and the white balance adjusting effect is further improved.
An embodiment of the present application further provides a terminal, as shown in fig. 6, where the terminal includes: a processor 601 and a memory 602 configured to store a computer program executable on the processor, as well as an image acquisition unit 603 and a color temperature sensor 604; the steps of the method in the embodiments of the present application are implemented by the processor 601 when executing the computer program in the memory 602.
In practice, of course, the various components of the terminal are coupled together by a bus system 605, as shown in fig. 6. It is understood that the bus system 605 is used to enable communications among the components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 605 in fig. 6.
The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method according to any of the embodiments.
In practical applications, the processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device for implementing the above processor function may be other devices, and the embodiments of the present application are not limited in particular.
The Memory may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (HDD), or a Solid-State Drive (SSD); or a combination of the above types of memories and provides instructions and data to the processor.
It should be noted that: "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or device embodiments provided in the present application may be combined in any combination to arrive at a new method or device embodiment without conflict.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A white balance adjustment method, characterized in that the method comprises:
acquiring an original image, which is acquired by an image acquisition unit and aims at a target shooting scene, and color temperature information, which is acquired by a color temperature sensor and aims at the target shooting scene;
calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block;
determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve;
and adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block.
2. The method according to claim 1, wherein the adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block comprises:
calculating a confidence level of the first gain value based on the second gain value;
and adjusting the first gain value based on the reliability of the first gain value to obtain the final gain value of the target image block.
3. The method of claim 2, wherein the confidence level is a weight value, and the adjusting the first gain value by the second gain value to obtain a final gain value of the target image block comprises:
calculating a Euclidean distance between the first gain value and the second gain value;
determining a weight value of the first gain value based on a mapping relation between a distance and the weight value and the Euclidean distance;
and multiplying the first gain value by the weight value of the first gain value to obtain the final gain value of the target image block.
4. The method of claim 3, wherein the mapping between the distance and the weight value comprises:
when the distance is smaller than or equal to the first distance value, the weight value is equal to the first weight value;
when the distance is greater than the first distance value and less than the second distance value, the weight value and the distance are in a linear relation;
and when the distance is greater than or equal to the second distance value, the weight value is equal to the second weight value.
5. The method of claim 1, wherein prior to calculating the three-channel response of the target image block in the original image based on the white balance algorithm, the method further comprises:
dividing the original image into M × N image blocks; wherein M and N are both positive integers;
and taking any one image block in the M multiplied by N image blocks as the target image block.
6. The method of claim 1, wherein the calculating a three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block comprises:
calculating R response, G response and B response of each pixel point in the target image block based on a gray world algorithm;
converting the R response, the G response and the B response of each pixel point into a two-dimensional coordinate system to obtain a two-dimensional coordinate value R/G and G/B of each pixel point;
calculating the average values of R/G and G/B of all pixel points in the target image block to obtain the average value of R/G and the average value of G/B of the target image block;
and taking the R/G average value and the G/B average value of the target image block as a first gain value of the target image block.
7. The method of claim 1, further comprising:
and carrying out white balance adjustment on the target image block by using the final gain value of the target image block.
8. A white balance adjustment device, characterized in that the device comprises:
the acquisition unit is used for acquiring an original image which is acquired by the image acquisition unit and aims at a target shooting scene and color temperature information which is acquired by the color temperature sensor and aims at the target shooting scene;
the calculating unit is used for calculating three-channel response of a target image block in the original image based on a white balance algorithm to obtain a first gain value of the target image block;
the determining unit is used for determining a second gain value corresponding to the color temperature information based on the corresponding relation between the color temperature and the gain value calibrated in advance in the color temperature curve;
and the adjusting unit is used for adjusting the first gain value by using the second gain value to obtain a final gain value of the target image block.
9. A terminal, characterized in that the terminal comprises: an image acquisition unit, a color temperature sensor, a processor and a memory configured to store a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the method of any one of claims 1 to 7 when running the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010192160.6A 2020-03-18 2020-03-18 White balance adjustment method, device, terminal and storage medium Active CN113497927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010192160.6A CN113497927B (en) 2020-03-18 2020-03-18 White balance adjustment method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010192160.6A CN113497927B (en) 2020-03-18 2020-03-18 White balance adjustment method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN113497927A true CN113497927A (en) 2021-10-12
CN113497927B CN113497927B (en) 2023-08-29

Family

ID=77994471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010192160.6A Active CN113497927B (en) 2020-03-18 2020-03-18 White balance adjustment method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN113497927B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023070412A1 (en) * 2021-10-27 2023-05-04 深圳市大疆创新科技有限公司 Imaging method and imaging device for wading scene

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090009624A1 (en) * 2007-07-08 2009-01-08 Mitac International Corporation Automatic white balance control system, automatic white balance module, and method thereof
CN106709887A (en) * 2017-01-06 2017-05-24 凌云光技术集团有限责任公司 Image gray-world white balance adjustment method and device based on color temperature curve
CN107454345A (en) * 2017-07-12 2017-12-08 广东欧珀移动通信有限公司 White balancing treatment method, device and the terminal device of image
CN110602473A (en) * 2019-10-24 2019-12-20 维沃移动通信有限公司 White balance calibration method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090009624A1 (en) * 2007-07-08 2009-01-08 Mitac International Corporation Automatic white balance control system, automatic white balance module, and method thereof
CN106709887A (en) * 2017-01-06 2017-05-24 凌云光技术集团有限责任公司 Image gray-world white balance adjustment method and device based on color temperature curve
CN107454345A (en) * 2017-07-12 2017-12-08 广东欧珀移动通信有限公司 White balancing treatment method, device and the terminal device of image
CN110602473A (en) * 2019-10-24 2019-12-20 维沃移动通信有限公司 White balance calibration method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023070412A1 (en) * 2021-10-27 2023-05-04 深圳市大疆创新科技有限公司 Imaging method and imaging device for wading scene

Also Published As

Publication number Publication date
CN113497927B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US7626614B1 (en) Transfer function and high dynamic range images
CN108668093B (en) HDR image generation method and device
WO2020093495A1 (en) Method and device for adjusting gamma value of display panel
Chakrabarti et al. Modeling radiometric uncertainty for vision with tone-mapped color images
US9838614B1 (en) Multi-camera image data generation
CN101527860A (en) White balance control apparatus, control method therefor, and image sensing apparatus
US20150109525A1 (en) Image processing apparatus, image processing method, and storage medium
JP5870598B2 (en) Image white balance processing method and apparatus
WO2016081118A1 (en) Measuring accuracy of image based depth sensing systems
CN109785390B (en) Method and device for image correction
CN111861922A (en) Method and device for adjusting color correction matrix and storage medium
WO2019076027A1 (en) White balance information synchronization method and device, and computer readable medium
CN108806638B (en) Image display method and device
CN111369478B (en) Face image enhancement method and device, computer equipment and storage medium
WO2022087973A1 (en) Image processing method and apparatus, computer-readable medium, and electronic device
CN106030664A (en) Transparency determination for overlaying images on an electronic display
WO2020093653A1 (en) Color adjustment method, color adjustment device, electronic device and computer-readable storage medium
KR20140061089A (en) Method and device control stereoscopic camera
CN113177886B (en) Image processing method, device, computer equipment and readable storage medium
CN113497927A (en) White balance adjusting method, device, terminal and storage medium
CN103685854A (en) Image processing apparatus, image processing method, and program
CN107274857B (en) Method for adjusting output image of display and display system
CN116708756A (en) Sensor accuracy detection method, detection device, electronic device, and storage medium
CN113766206A (en) White balance adjusting method, device and storage medium
CN108900825A (en) A kind of conversion method of 2D image to 3D rendering

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