CN111182217B - Image white balance processing method and device - Google Patents

Image white balance processing method and device Download PDF

Info

Publication number
CN111182217B
CN111182217B CN202010013807.4A CN202010013807A CN111182217B CN 111182217 B CN111182217 B CN 111182217B CN 202010013807 A CN202010013807 A CN 202010013807A CN 111182217 B CN111182217 B CN 111182217B
Authority
CN
China
Prior art keywords
white balance
image data
value
camera
current 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.)
Active
Application number
CN202010013807.4A
Other languages
Chinese (zh)
Other versions
CN111182217A (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.)
SHANGHAI SEAGULL DIGITAL CAMERA Co.,Ltd.
Original Assignee
Shanghai Seagull Digital Camera 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 Shanghai Seagull Digital Camera Co ltd filed Critical Shanghai Seagull Digital Camera Co ltd
Priority to CN202010013807.4A priority Critical patent/CN111182217B/en
Publication of CN111182217A publication Critical patent/CN111182217A/en
Application granted granted Critical
Publication of CN111182217B publication Critical patent/CN111182217B/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/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • 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)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The embodiment of the invention discloses a method and a device for processing image white balance, wherein the method comprises the following steps: reading current image data shot by a camera when a shooting trigger signal is received; identifying scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered; and if the scenes at the same positions exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same positions so as to perform white balance compensation processing on the current image data by using the target white balance parameters. By adopting the technical scheme, the consistency and the accuracy of white balance of continuously shot pictures are improved, and the problem of discontinuous color faults among continuously shot pictures is solved.

Description

Image white balance processing method and device
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a device for processing image white balance.
Background
The color temperature changes with the spectral composition of visible light, the white object is red under a low color temperature light source, the white object is blue under a high color temperature light source, and the human brain can automatically compensate the distortion of the object color caused by the environmental light source, so the human vision has an automatic white balance mechanism.
At present, a camera system generally reduces the influence of an external light source on the real color of an object through an automatic white balance algorithm, the general automatic white balance system comprises a hardware information statistical module, a software algorithm module and a graphic processing module, the hardware information statistical module provides statistical information of each color channel according to a software setting mode, the software white balance algorithm calculates a white balance compensation coefficient according to the statistical information provided by the hardware, and sets the white balance compensation coefficient into a camera image processor so as to compensate R and B channels of an image.
For continuously shot photos, when the white balance compensation is carried out by using the current white balance algorithm, the consistency of white balance compensation coefficients is poor, the white balance of the photos is different under the condition of color temperature change or scene change, and the current white balance algorithm has deviation under certain special scenes, such as sunrise and sunset, grassland green trees and other scenes, which are easy to calculate wrongly, so that the color discontinuity fault phenomenon occurs between the photos, and the color discontinuity fault phenomenon occurs to the continuous scenes when the photos are used for splicing or mapping in the later period.
Disclosure of Invention
The embodiment of the invention discloses a method and a device for processing image white balance, which improve the consistency and the accuracy of the white balance of continuous shooting pictures.
In a first aspect, an embodiment of the present invention provides a method for processing white balance of an image, where the method includes:
before receiving a photographing trigger signal, when a camera is in an image preview state, judging whether a white balance instruction triggered by a user is received;
if the white balance instruction is received, calculating a white balance parameter according to preview image data acquired by the camera, and taking the obtained white balance parameter as a default white balance parameter of the camera;
if a white balance instruction triggered by a user is not received, determining target white balance parameters according to the preview image data and coordinate values of the calibrated reference points under different color temperatures; the abscissa value of each datum point is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value;
reading current image data shot by a camera when a shooting trigger signal is received;
identifying scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered;
and if the scenes at the same positions exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same positions so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
Optionally, the method further includes:
if the scene at the same position does not exist in the current image data and the historical image data, judging whether a white balance instruction triggered by a user is received by a camera in a preview state corresponding to the current image data;
and if the white balance instruction is received, taking the default white balance parameter as a target white balance parameter of the current image data.
Optionally, the calculating a white balance parameter according to the preview image data acquired by the camera includes:
counting the ratio of R, G pixel values of all pixels in the preview image data to the pixel values of the B channel;
and taking the R channel value, the G channel value and the B channel value which correspond to the condition that the ratio of the R, G pixel values to the B channel pixel values is compensated to be 1 as a white balance parameter.
Optionally, the performing white balance compensation processing on the current image data by using the target white balance parameter includes:
and setting the target white balance parameters into an image signal processor ISP of the camera so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
In a second aspect, an embodiment of the present invention further provides an apparatus for processing white balance of an image, where the apparatus includes:
the first judgment module is configured to judge whether a white balance instruction triggered by a user is received or not when the camera is in an image preview state before the photographing trigger signal is received;
a first white balance parameter calculation module configured to calculate a white balance parameter from preview image data acquired by the camera if the white balance instruction is received, and to use the obtained white balance parameter as a default white balance parameter of the camera;
the second white balance parameter calculating module is configured to determine target white balance parameters according to the preview image data and coordinate values of the calibrated reference points at different color temperatures if a white balance instruction triggered by a user is not received; the abscissa value of each datum point is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value;
the current image data reading module is configured to read current image data shot by the camera when receiving the shooting trigger signal;
the scene position identification module is configured to identify scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered;
and the white balance compensation processing module is configured to calculate target white balance parameters according to the image data corresponding to the scene at the same position if the scene at the same position exists in the current image data and the historical image data so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
Optionally, the apparatus further comprises:
the second judging module is configured to judge whether the camera receives the white balance instruction in a preview state corresponding to the current image data if the scene at the same position does not exist in the current image data and the historical image data;
and the target white balance parameter updating module is configured to take the default white balance parameter as a target white balance parameter of the current image data if the white balance instruction is received.
Optionally, the white balance parameter first calculating module is specifically configured to:
if the white balance instruction is received, counting the ratio of R, G pixel values of all pixels in the preview image data to the pixel values of the B channel;
and taking the R channel value, the G channel value and the B channel value which correspond to the condition that the ratio of the pixel values of the R, G and the B channel is compensated to be 1 as a white balance parameter, and taking the obtained white balance parameter as a default white balance parameter of the camera.
Optionally, the white balance compensation processing module is specifically configured to:
if the scenes at the same positions exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same positions;
and setting the target white balance parameters into an image signal processor ISP of the camera so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
In a third aspect, an embodiment of the present invention further provides a camera, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program codes stored in the memory to execute part or all of the steps of the image white balance processing method provided by any embodiment of the invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program including instructions for executing part or all of the steps of the processing method for white balance of an image provided in any embodiment of the present invention.
In a fifth aspect, the embodiments of the present invention further provide a computer program product, which when run on a computer, causes the computer to execute part or all of the steps of the processing method for white balance of an image provided in any embodiment of the present invention.
According to the technical scheme provided by the embodiment of the invention, when the camera is in the image preview state, the accuracy of the target white balance parameter is improved by performing white balance processing on the preview data. When the camera is in an image shooting state, scenes at the same positions in the current shot image data and the last shot historical image data are identified, and the image data corresponding to the scenes at the same positions are utilized to calculate white balance parameters, so that the white balance consistency of continuous photos is realized, the accuracy of the white balance parameters of the images is improved, and the problem of discontinuous color faults among the continuously shot photos is solved.
Compared with the prior art, the invention points of the invention comprise:
1. when the camera is in an image preview state, a one-key white balance function is added, namely if a white balance instruction triggered by a user is received, a white balance parameter is calculated according to preview image data acquired by the camera, and the accuracy of the white balance parameter is improved. In addition, when the camera is in a shooting state, scenes at the same positions in the current shot image data and the last shot historical image data are identified, and the image data corresponding to the scenes at the same positions are utilized to calculate white balance parameters, so that the consistency of continuous photo white balance is realized, the accuracy of the image white balance parameters is improved, and the problem of discontinuous color faults between continuously shot photos is solved.
2. When the camera is in an image preview state, if a white balance instruction triggered by a user is not received, the target white balance parameters are determined according to preview image data and coordinate values of all calibrated reference points under different color temperatures, and the accuracy of the target white balance parameters is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a processing method for white balance of an image according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a processing method for white balance of an image according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an image white balance processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a camera according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the embodiments and drawings of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Example one
Referring to fig. 1, fig. 1 is a flowchart illustrating a processing method for white balance of an image according to an embodiment of the present invention. This method is typically applied to white balance processing of continuously taken photographs. The method may be performed by a processing device for white balance of an image, and the device may be implemented by software and/or hardware, and the embodiment of the present invention is not limited. As shown in fig. 1, the method provided in this embodiment specifically includes:
110. and when receiving the photographing trigger signal, reading the current image data photographed by the camera.
Wherein the current image data taken by the camera is raw image data acquired by the camera sensor.
120. And identifying scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered.
Wherein a scene in the image data may be represented by feature points in the image. In this embodiment, the scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered are identified, so as to determine the parts of the current image data that have the same scene position as the previous frame of image data, and calculate the white balance parameters of the image by using the scenes at the same positions, so that the white balance parameters of the continuously photographed photos have consistency.
130. And if the scenes at the same positions exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same positions so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
For example, the present embodiment may calculate the target white balance parameter through a white balance algorithm based on white point detection to improve the accuracy of white balance. The white balance algorithm based on white point detection specifically comprises the steps of calibrating coordinate values of all reference points of images under different color temperatures, and fitting the reference points into a curve in a preset coordinate system according to the sizes of the coordinate values. The abscissa value of each reference point in the preset coordinate system is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value. The current image data may be divided into a plurality of image regions for identification. For each image area, the ratio of the average value of the R channel to the average value of the G channel of all the pixel points in the area can be used as the abscissa value of the area in the preset coordinate system, and the ratio of the average value of the B channel to the average value of the G channel can be used as the ordinate value of the area in the preset coordinate system. And determining a point corresponding to the region in a preset coordinate system, and determining a reference point closest to the point on the fitting curve, wherein the color temperature, the abscissa value and the ordinate value of the reference point can be used as target white balance parameters of the image region.
According to the technical scheme provided by the embodiment, when the camera is in a shooting state, scenes at the same positions in the current shot image data and the last shot historical image data are identified, and the image data corresponding to the scenes at the same positions are utilized to calculate the white balance parameters, so that the continuously shot photos are related in space, the consistency of the white balance of the continuous photos is realized, the accuracy of the white balance parameters of the images is improved, the problem of discontinuous color faults among the continuously shot photos is solved, and the phenomenon of discontinuous color faults of the continuous scenes in the later splicing or mapping process by utilizing the photos is avoided.
Example two
Referring to fig. 2, fig. 2 is a flowchart illustrating a processing method for white balance of an image according to an embodiment of the present invention. The present embodiment is optimized based on the above embodiments, and adds a white balance processing procedure of the image data in the preview state.
As shown in fig. 2, the method includes:
200. the camera is started.
201. When the camera is in an image preview state, judging whether a white balance instruction triggered by a user is received, if so, executing step 202; otherwise, go to step 203;
after the camera is started, the automatic white balance algorithm inside the camera is continuously executed at intervals of a set time, and the automatic white balance algorithm may specifically refer to the description of step 203. After the camera is started, if a white balance instruction triggered by a user is received, the white balance instruction is preferentially responded, namely, the white balance parameters are calculated according to preview image data collected by the camera, so that the environment color temperature can be accurately calculated, and the accuracy of determining the subsequent white balance parameters is ensured.
202. And calculating a white balance parameter according to the preview image data acquired by the camera, taking the obtained white balance parameter as a default white balance parameter of the camera, and continuing to execute the step 204.
Illustratively, the white balance parameter is calculated according to preview image data acquired by a camera, and specifically may be:
and counting the ratio of R, G of all pixels in the preview image data to the pixel value of the B channel, and compensating the ratio of the pixel value of R, G to the pixel value of the B channel to 1 to obtain the corresponding R channel value, G channel value and B channel value as white balance parameters. The white balance parameter may be set as a default white balance parameter to an ISP (Image Signal Processing) of the camera.
203. And determining a target white balance parameter according to the preview image data and the coordinate values of the calibrated reference points under different color temperatures.
For example, the present embodiment may determine the target white balance parameter through a white balance algorithm based on white point detection. The white balance algorithm based on white point detection specifically comprises the steps of calibrating coordinate values of all reference points of images under different color temperatures, and fitting the reference points into a curve in a preset coordinate system according to the coordinate values. The abscissa value of each reference point in the preset coordinate system is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value. For the preview image data, the position of the preview image data in a preset coordinate system can be determined, specifically, the ratio of the average value of the R channel to the average value of the G channel of all the pixel points of the preview image data is used as an abscissa value, and the ratio of the average value of the B channel to the average value of the G channel is used as an ordinate value. After the position of the reference point is determined, the reference point closest to the position on the fitting curve can be determined, and the color temperature, the horizontal coordinate value and the vertical coordinate value corresponding to the reference point are used as target white balance parameters. Compared with the corresponding white balance algorithm when the camera is in the image preview state, when the camera is in the shooting state, the size of the acquired image data is larger than that of the preview image data, so that the white balance algorithm in the shooting state can divide the image data into a plurality of image areas for processing.
204. When the photographing trigger signal is received, the current image data photographed by the camera is read, and the step 205 is continuously executed.
205. Judging whether the current image data and the historical image data acquired when the previous photographing signal is triggered have scenes at the same position, if so, executing a step 206; otherwise, step 207 is performed.
206. And calculating target white balance parameters according to the image data corresponding to the scene at the same position, and performing white balance compensation processing on the current image data by using the target white balance parameters.
207. Judging whether the camera receives a white balance instruction in a preview state corresponding to the current image data, if so, executing step 208; otherwise, return to execute step 203.
208. And taking the default white balance parameter of the current image data in the corresponding image preview state as the target white balance parameter of the current image data.
On the basis of the above embodiment, the present embodiment improves the accuracy of the target white balance parameter by adding the white balance processing procedure of the image data in the preview state.
EXAMPLE III
Referring to fig. 3, fig. 3 is a schematic structural diagram of a processing apparatus for white balance of an image according to an embodiment of the present invention. As shown in fig. 3, the apparatus includes: a first judgment module 310, a first white balance parameter calculation module 320, a second white balance parameter calculation module 330, a current image data reading module 340, a scene position identification module 350 and a white balance compensation processing module 360; wherein the content of the first and second substances,
a first determining module 310, configured to determine whether a white balance instruction triggered by a user is received when the camera is in an image preview state before receiving the photographing trigger signal;
a first white balance parameter calculating module 320 configured to calculate a white balance parameter from preview image data acquired by the camera if the white balance instruction is received, and use the obtained white balance parameter as a default white balance parameter of the camera;
a white balance parameter second calculation module 330 configured to determine a target white balance parameter according to the preview image data and coordinate values of the calibrated reference points at different color temperatures if a white balance instruction triggered by a user is not received; the abscissa value of each datum point is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value;
a current image data reading module 340 configured to read current image data photographed by the camera when receiving the photographing trigger signal;
a scene position identification module 350 configured to identify a scene position in the current image data and the historical image data acquired when the previous photographing signal is triggered;
a white balance compensation processing module 360 configured to, if a scene at the same position exists in the current image data and the historical image data, calculate a target white balance parameter according to image data corresponding to the scene at the same position, so as to perform white balance compensation processing on the current image data by using the target white balance parameter.
Optionally, the apparatus further comprises:
the second judging module is configured to judge whether the camera receives the white balance instruction in a preview state corresponding to the current image data if the scene at the same position does not exist in the current image data and the historical image data;
and the target white balance parameter updating module is configured to take the default white balance parameter as a target white balance parameter of the current image data if the white balance instruction is received.
Optionally, the white balance parameter first calculating module is specifically configured to:
if the white balance instruction is received, counting the ratio of R, G pixel values of all pixels in the preview image data to the pixel values of the B channel;
and taking the R channel value, the G channel value and the B channel value which correspond to the condition that the ratio of the pixel values of the R, G and the B channel is compensated to be 1 as a white balance parameter, and taking the obtained white balance parameter as a default white balance parameter of the camera.
Optionally, the white balance compensation processing module is specifically configured to:
if the scenes at the same positions exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same positions;
and setting the target white balance parameters into an image signal processor ISP of the camera so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
The image white balance processing device provided by the embodiment of the invention can execute the image white balance processing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in the above embodiments, reference may be made to a processing method for white balance of an image provided in any embodiment of the present invention.
Example four
Referring to fig. 4, fig. 4 is a schematic structural diagram of a camera according to an embodiment of the invention. As shown in fig. 4, the camera may include:
a memory 701 in which executable program code is stored;
a processor 702 coupled to the memory 701;
the processor 702 calls the executable program code stored in the memory 701 to execute the processing method for white balance of an image according to any embodiment of the present invention.
The embodiment of the invention discloses a computer-readable storage medium which stores a computer program, wherein the computer program enables a computer to execute the processing method for white balance of an image provided by any embodiment of the invention.
The embodiment of the invention discloses a computer program product, wherein when the computer program product runs on a computer, the computer is enabled to execute part or all of the steps of the processing method for white balance of the image provided by any embodiment of the invention.
In various embodiments of the present invention, it should be understood that the sequence numbers of the above-mentioned processes do not imply an inevitable order of execution, and the execution order of the processes should be determined by their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
In the embodiments provided herein, it should be understood that "B corresponding to A" means that B is associated with A from which B can be determined. It should also be understood, however, that determining B from a does not mean determining B from a alone, but may also be determined from a and/or other information.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a computer accessible memory. Based on such understanding, the technical solution of the present invention, which is a part of or contributes to the prior art in essence, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for causing a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute part or all of the steps of the above-described method of each embodiment of the present invention.
It will be understood by those skilled in the art that all or part of the steps in the methods of the embodiments described above may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), or other Memory, such as a magnetic disk, or a combination thereof, A tape memory, or any other medium readable by a computer that can be used to carry or store data.
The foregoing describes in detail a processing method and apparatus for white balance of an image according to an embodiment of the present invention, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the foregoing embodiments is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for processing white balance of an image, comprising:
before receiving a photographing trigger signal, when a camera is in an image preview state, judging whether a white balance instruction triggered by a user is received;
if the white balance instruction is received, calculating a white balance parameter according to preview image data acquired by the camera, and taking the obtained white balance parameter as a default white balance parameter of the camera;
if a white balance instruction triggered by a user is not received, determining target white balance parameters according to the preview image data and coordinate values of the calibrated reference points under different color temperatures; the abscissa value of each datum point is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value;
reading current image data shot by a camera when a shooting trigger signal is received;
identifying scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered;
if scenes at the same position exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same position so as to perform white balance compensation processing on the current image data by using the target white balance parameters;
wherein the target white balance parameter is determined by:
calibrating coordinate values of all reference points of the image under different color temperatures, and fitting the reference points into a curve in a preset coordinate system according to the size of the coordinate values; the horizontal coordinate value of each datum point in the preset coordinate system is the ratio of the R channel value to the G channel value, and the vertical coordinate value is the ratio of the B channel value to the G channel value;
dividing the current image data into a plurality of image areas for identification;
for each image area, taking the ratio of the average value of R channels to the average value of G channels of all pixel points in the image area as the abscissa value of the area in a preset coordinate system, and taking the ratio of the average value of B channels to the average value of G channels as the ordinate value of the area in the preset coordinate system;
and determining a point corresponding to the image area in a preset coordinate system, and taking the color temperature, the abscissa value and the ordinate value of the reference point as target white balance parameters of the image area by determining the reference point closest to the point on the fitting curve.
2. The method of claim 1, further comprising:
if the scene at the same position does not exist in the current image data and the historical image data, judging whether a white balance instruction triggered by a user is received by a camera in a preview state corresponding to the current image data;
and if the white balance instruction is received, taking the default white balance parameter as a target white balance parameter of the current image data.
3. The method of claim 1, wherein calculating white balance parameters from the preview image data captured by the camera comprises:
counting the ratio of R, G pixel values of all pixels in the preview image data to the pixel values of the B channel;
and taking the R channel value, the G channel value and the B channel value which correspond to the condition that the ratio of the R, G pixel values to the B channel pixel values is compensated to be 1 as a white balance parameter.
4. The method according to claim 1, wherein said performing white balance compensation processing on the current image data using the target white balance parameter comprises:
and setting the target white balance parameters into an image signal processor ISP of the camera so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
5. An apparatus for processing white balance of an image, comprising:
the first judgment module is configured to judge whether a white balance instruction triggered by a user is received or not when the camera is in an image preview state before the photographing trigger signal is received;
a first white balance parameter calculation module configured to calculate a white balance parameter from preview image data acquired by the camera if the white balance instruction is received, and to use the obtained white balance parameter as a default white balance parameter of the camera;
the second white balance parameter calculating module is configured to determine target white balance parameters according to the preview image data and coordinate values of the calibrated reference points at different color temperatures if a white balance instruction triggered by a user is not received; the abscissa value of each datum point is the ratio of the R channel value to the G channel value, and the ordinate value is the ratio of the B channel value to the G channel value;
the current image data reading module is configured to read current image data shot by the camera when receiving the shooting trigger signal;
the scene position identification module is configured to identify scene positions in the current image data and the historical image data acquired when the previous photographing signal is triggered;
a white balance compensation processing module configured to calculate a target white balance parameter according to image data corresponding to a scene at the same position if the scene at the same position exists in the current image data and the historical image data, so as to perform white balance compensation processing on the current image data by using the target white balance parameter;
wherein the target white balance parameter is determined by:
calibrating coordinate values of all reference points of the image under different color temperatures, and fitting the reference points into a curve in a preset coordinate system according to the size of the coordinate values; the horizontal coordinate value of each datum point in the preset coordinate system is the ratio of the R channel value to the G channel value, and the vertical coordinate value is the ratio of the B channel value to the G channel value;
dividing the current image data into a plurality of image areas for identification;
for each image area, taking the ratio of the average value of R channels to the average value of G channels of all pixel points in the image area as the abscissa value of the area in a preset coordinate system, and taking the ratio of the average value of B channels to the average value of G channels as the ordinate value of the area in the preset coordinate system;
and determining a point corresponding to the image area in a preset coordinate system, and taking the color temperature, the abscissa value and the ordinate value of the reference point as target white balance parameters of the image area by determining the reference point closest to the point on the fitting curve.
6. The apparatus of claim 5, further comprising:
the second judging module is configured to judge whether the camera receives the white balance instruction in a preview state corresponding to the current image data if the scene at the same position does not exist in the current image data and the historical image data;
and the target white balance parameter updating module is configured to take the default white balance parameter as a target white balance parameter of the current image data if the white balance instruction is received.
7. The apparatus according to claim 5, wherein the white balance parameter first calculation module is specifically configured to:
if the white balance instruction is received, counting the ratio of R, G pixel values of all pixels in the preview image data to the pixel values of the B channel;
and taking the R channel value, the G channel value and the B channel value which correspond to the condition that the ratio of the pixel values of the R, G and the B channel is compensated to be 1 as a white balance parameter, and taking the obtained white balance parameter as a default white balance parameter of the camera.
8. The apparatus of claim 5, wherein the white balance compensation processing module is specifically configured to:
if the scenes at the same positions exist in the current image data and the historical image data, calculating target white balance parameters according to the image data corresponding to the scenes at the same positions;
and setting the target white balance parameters into an image signal processor ISP of the camera so as to perform white balance compensation processing on the current image data by using the target white balance parameters.
9. A camera, comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the processing method of image white balance according to any one of claims 1 to 4.
10. A computer-readable storage medium storing a computer program including a processing method for performing the image white balance according to any one of claims 1 to 4.
CN202010013807.4A 2020-01-07 2020-01-07 Image white balance processing method and device Active CN111182217B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010013807.4A CN111182217B (en) 2020-01-07 2020-01-07 Image white balance processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010013807.4A CN111182217B (en) 2020-01-07 2020-01-07 Image white balance processing method and device

Publications (2)

Publication Number Publication Date
CN111182217A CN111182217A (en) 2020-05-19
CN111182217B true CN111182217B (en) 2021-08-10

Family

ID=70652530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010013807.4A Active CN111182217B (en) 2020-01-07 2020-01-07 Image white balance processing method and device

Country Status (1)

Country Link
CN (1) CN111182217B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112261303B (en) * 2020-11-19 2021-08-20 贝壳技术有限公司 Three-dimensional color panoramic model generation device and method, storage medium and processor
CN112468795B (en) * 2020-12-09 2022-03-18 山东志盈医学科技有限公司 Method and device for adjusting white balance of camera
CN114793265A (en) * 2021-01-26 2022-07-26 Oppo广东移动通信有限公司 Image processor, electronic device, and image correction method
CN114979607B (en) * 2021-02-20 2024-04-12 Oppo广东移动通信有限公司 Image processing method, image processor and electronic equipment
CN113038094B (en) * 2021-03-29 2022-11-18 维沃移动通信(深圳)有限公司 Image acquisition method and device
CN113240582B (en) * 2021-04-13 2023-12-12 浙江大华技术股份有限公司 Image stitching method and device
CN114040179B (en) * 2021-10-20 2023-06-06 重庆紫光华山智安科技有限公司 Image processing method and device
WO2024000352A1 (en) * 2022-06-30 2024-01-04 Intel Corporation Methods and apparatus to improve camera image quality
CN116048379B (en) * 2022-06-30 2023-10-24 荣耀终端有限公司 Data recharging method and device
CN115914857A (en) * 2022-12-22 2023-04-04 创视微电子(成都)有限公司 Real-time automatic white balance compensation method and device in image sensor

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957396A (en) * 2014-05-14 2014-07-30 姚杰 Image processing method and device used when tongue diagnosis is conducted with intelligent device and equipment
CN104767984A (en) * 2015-03-25 2015-07-08 广东欧珀移动通信有限公司 Color temperature adjusting method for flash lamp and terminal
CN105227945A (en) * 2015-10-21 2016-01-06 维沃移动通信有限公司 A kind of control method of Automatic white balance and mobile terminal
CN105611264A (en) * 2015-12-30 2016-05-25 努比亚技术有限公司 Automatic white balance method and device
CN108040240A (en) * 2017-11-08 2018-05-15 维沃移动通信有限公司 The method, apparatus and mobile terminal of a kind of blank level adjustment
CN108769634A (en) * 2018-07-06 2018-11-06 Oppo(重庆)智能科技有限公司 A kind of image processing method, image processing apparatus and terminal device
CN109729332A (en) * 2018-12-12 2019-05-07 珠海亿智电子科技有限公司 A kind of automatic white balance antidote and system
CN110351537A (en) * 2019-07-31 2019-10-18 深圳前海达闼云端智能科技有限公司 White balance method, device, storage medium and the electronic equipment of Image Acquisition

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7505069B2 (en) * 2005-10-26 2009-03-17 Hewlett-Packard Development Company, L.P. Method and apparatus for maintaining consistent white balance in successive digital images
CN107959840A (en) * 2017-12-07 2018-04-24 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and computer equipment
CN108337433B (en) * 2018-03-19 2020-07-03 Oppo广东移动通信有限公司 Photographing method, mobile terminal and computer readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957396A (en) * 2014-05-14 2014-07-30 姚杰 Image processing method and device used when tongue diagnosis is conducted with intelligent device and equipment
CN104767984A (en) * 2015-03-25 2015-07-08 广东欧珀移动通信有限公司 Color temperature adjusting method for flash lamp and terminal
CN105227945A (en) * 2015-10-21 2016-01-06 维沃移动通信有限公司 A kind of control method of Automatic white balance and mobile terminal
CN105611264A (en) * 2015-12-30 2016-05-25 努比亚技术有限公司 Automatic white balance method and device
CN108040240A (en) * 2017-11-08 2018-05-15 维沃移动通信有限公司 The method, apparatus and mobile terminal of a kind of blank level adjustment
CN108769634A (en) * 2018-07-06 2018-11-06 Oppo(重庆)智能科技有限公司 A kind of image processing method, image processing apparatus and terminal device
CN109729332A (en) * 2018-12-12 2019-05-07 珠海亿智电子科技有限公司 A kind of automatic white balance antidote and system
CN110351537A (en) * 2019-07-31 2019-10-18 深圳前海达闼云端智能科技有限公司 White balance method, device, storage medium and the electronic equipment of Image Acquisition

Also Published As

Publication number Publication date
CN111182217A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN111182217B (en) Image white balance processing method and device
US10997696B2 (en) Image processing method, apparatus and device
CN109767467A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN109712192B (en) Camera module calibration method and device, electronic equipment and computer readable storage medium
CN109922275B (en) Self-adaptive adjustment method and device of exposure parameters and shooting equipment
WO2019085951A1 (en) Image processing method, and device
CN107948617B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN112752023B (en) Image adjusting method and device, electronic equipment and storage medium
CN110660090B (en) Subject detection method and apparatus, electronic device, and computer-readable storage medium
CN108063891B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN108198152A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN110866486B (en) Subject detection method and apparatus, electronic device, and computer-readable storage medium
CN109559353B (en) Camera module calibration method and device, electronic equipment and computer readable storage medium
CN113905183B (en) Color difference correction method and device for wide dynamic range image
CN111277699B (en) Flash lamp color temperature calibration method and device, electronic equipment and readable storage medium
CN110708463B (en) Focusing method, focusing device, storage medium and electronic equipment
WO2022036539A1 (en) Color consistency correction method and device for multiple cameras
CN111246100A (en) Anti-shake parameter calibration method and device and electronic equipment
CN113313626A (en) Image processing method, image processing device, electronic equipment and storage medium
WO2017152822A1 (en) Image processing method and device
CN107920205A (en) Image processing method, device, storage medium and electronic equipment
CN107948511A (en) Brightness of image processing method, device, storage medium and electronic equipment
CN110392211A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN111866369A (en) Image processing method and device
CN107948619B (en) Image processing method, device, computer readable storage medium and mobile terminal

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
TA01 Transfer of patent application right

Effective date of registration: 20210722

Address after: 201613 No.1, Lane 288, Mingnan Road, Songjiang District, Shanghai

Applicant after: SHANGHAI SEAGULL DIGITAL CAMERA Co.,Ltd.

Address before: 201613 No.1, Lane 288, Mingnan Road, Songjiang District, Shanghai

Applicant before: Xu Mengying

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant