CN111602390A - Terminal white balance processing method, terminal and computer readable storage medium - Google Patents

Terminal white balance processing method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN111602390A
CN111602390A CN201780096515.8A CN201780096515A CN111602390A CN 111602390 A CN111602390 A CN 111602390A CN 201780096515 A CN201780096515 A CN 201780096515A CN 111602390 A CN111602390 A CN 111602390A
Authority
CN
China
Prior art keywords
white balance
terminal
rgb data
color temperature
rgb
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201780096515.8A
Other languages
Chinese (zh)
Inventor
缪威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Transsion Communication Co Ltd
Original Assignee
Shenzhen Transsion Communication 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 Shenzhen Transsion Communication Co Ltd filed Critical Shenzhen Transsion Communication Co Ltd
Publication of CN111602390A publication Critical patent/CN111602390A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths

Abstract

The invention discloses a terminal white balance processing method, a terminal and a computer readable storage medium, wherein the method comprises the steps of starting a color temperature sensor on the terminal when a shooting request is detected, and acquiring the current color temperature value of a shot object in a terminal viewfinder image; determining RGB data of the shot object according to the current color temperature value of the shot object; and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture. The invention can obtain more accurate RGB data, the white balance parameter determined according to the more accurate RGB data is more accurate, the actual color of the shot object can be more truly restored, the effect of the shot object is as close to that of human eyes as possible, and the user experience is improved.

Description

Terminal white balance processing method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of camera technologies, and in particular, to a terminal white balance processing method, a terminal, and a computer-readable storage medium.
Background
With the rapid development of the smart phone industry, people have higher and higher requirements on the camera effect of the terminal, for example, the image color is required to be as vivid as possible and close to the effect of human eyes.
Human eyes have certain adaptability to color temperature, so the observed color is less influenced by color temperature deviation, and a terminal camera does not have the capability, so a shot photo and the color observed by human eyes have larger deviation, and white balance processing is needed. Some white balance methods are based on gray world assumption algorithms,
the algorithm considers that the statistical average of the R, G, B three-color components of the captured image should be equal, so the target image is adjusted by statistically averaging the captured images so that R = G = B of the target image, thereby bringing the image to white balance. Therefore, how to accurately obtain RGB data of a subject becomes a technical problem worthy of study.
In the prior art, generally, an ISP (Image signal processor) on a terminal reads a shot initial Image to obtain RGB data of a shot object, wherein the accuracy of RGB is determined by a camera and the ISP together, and the RGB data is greatly influenced by the camera and the ISP of the terminal, and is easily caused to be inaccurate RGB data due to the change of any factor.
Disclosure of Invention
The invention mainly aims to provide a terminal white balance processing method, aiming at solving the technical problem that the accuracy of RGB data of a shot object for determining white balance parameters is greatly influenced by a terminal camera and an ISP (Internet service provider), and the data is easy to be inaccurate due to the change of any factor.
In order to achieve the above object, the present invention provides a terminal white balance processing method, including:
when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
determining RGB data of the shot object according to the current color temperature value of the shot object;
and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
In an alternative embodiment, the step when the photographing request is detected is followed by:
detecting whether the color temperature sensor has a fault;
if the color temperature sensor is detected to be fault-free, executing the step of starting the color temperature sensor on the terminal;
and if the color temperature sensor is detected to be in fault, acquiring RGB data of the shot object determined according to the image signal processor, determining white balance parameters according to the RGB data, and carrying out white balance processing on the terminal viewfinder image.
In an alternative embodiment, the step of determining white balance parameters from the RGB data comprises:
a reference region in the subject is determined from the RGB data, and white balance parameters are determined from the RGB data of the reference region.
In an alternative embodiment, the step of determining a reference region in the subject from the RGB data comprises:
determining a first ratio of red to blue and a second ratio of red to green according to the RGB data;
if the first ratio is smaller than a first threshold value and the second ratio is smaller than a second threshold value, the area corresponding to the RGB ratio is a first reference area, and the first reference area is a reference area.
In an optional implementation manner, if the first ratio is smaller than a first threshold and the second ratio is smaller than a second threshold, the step of setting the region corresponding to the RGB ratio as a first reference region includes:
if the number of the first reference areas is multiple, comparing the RGB sizes of the multiple first reference areas;
and determining a first reference area with the maximum RGB, wherein the first reference area corresponding to the maximum RGB is the reference area.
In an optional implementation manner, the terminal white balance processing method further includes:
when detecting that the color temperature value of a shot object in a terminal viewfinder image changes, acquiring the current color temperature value of the shot object;
and converting the current color temperature value into RGB data, and updating the white balance parameter according to the RGB data.
In an optional embodiment, the step of determining the RGB data of the subject according to the current color temperature value of the subject includes:
and converting the color temperature values of all the shot objects in the terminal viewfinder image into RGB data, and acquiring the average value of the shot objects in R, G, B three color channels according to the RGB data, wherein the average value is the RGB data of three primary colors of the shot objects.
In an optional embodiment, the step of determining white balance parameters according to the RGB data and performing white balance processing on the original imaged picture includes:
determining a white balance RGB gain value according to the RGB data of the reference region, and determining a final correction value of all the shot objects according to the RGB gain value and the RGB data of all the shot objects;
and adjusting the RGB data of the corresponding areas of all the objects on the original imaging picture to the correction value.
In addition, to achieve the above object, the present invention also provides a terminal, including: the system comprises a processor, a color temperature sensor, a camera, a memory and a terminal white balance processing program which is stored on the memory and can be executed on the processor, wherein when the terminal white balance processing program is executed by the processor, the method comprises the following steps:
when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
determining three primary colors (RGB) data of the shot object according to the current color temperature value of the shot object;
and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a terminal white balance processing program which, when executed by a processor, realizes the steps of:
when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
determining three primary colors (RGB) data of the shot object according to the current color temperature value of the shot object;
and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
The method comprises the steps that when a terminal shoots, a color temperature sensor is started to detect color temperature, the color temperature value obtained by the color temperature sensor is converted into RGB data, the final white balance parameters are determined according to the RGB data, and white balance processing is carried out; because the color temperature sensor has higher accuracy compared with a camera or an ISP (Internet service provider), the detected color temperature value is more accurate, and the RGB data converted from the detected color temperature value is more accurate, the white balance parameter determined according to the more accurate RGB data is more accurate, the actual color of the shot object can be more truly restored, the effect of the human eyes is approached as much as possible, and the user experience is improved.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a terminal white balance processing method according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a step S30 of the terminal white balance processing method according to the third embodiment of the present invention after being refined;
fig. 4 is a flowchart illustrating a prior art related to a terminal white balance processing method according to a seventh embodiment of the present invention;
fig. 5 is a flowchart illustrating a terminal white balance processing method according to a seventh embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal in the embodiment of the present invention may be a PC, a smart phone, a tablet PC, an e-book reader, an MP3 (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3) player, an MP4 (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 3) player, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable media player (PMP media player), a navigation device, a Portable computer, and other Portable terminal devices having a display function, and a fixed terminal such as a desktop computer.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
As shown in fig. 1, the terminal may include: the processor 1001 includes, for example, a CPU, a color temperature sensor 1002, a camera 1003, a memory 1005, and a communication bus 1004. Wherein a communication bus 1004 is used to enable connective communication between these components. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001. The color temperature sensor 1002 may be one chip. The camera 1003 may be one or more cameras.
Optionally, the terminal may further include RF (radio frequency) circuits, sensors, audio circuits, WiFi modules, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, includes a terminal white balance processing program therein.
In the terminal shown in fig. 1, a camera 1003 is used for framing shooting; the color temperature sensor 1002 is used for detecting the color temperature value of a shot object in a camera viewfinder image area; and the processor 1001 may be configured to call the terminal white balance processing program stored in the memory 1005 and perform the following operations:
when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
determining RGB data of the shot object according to the current color temperature value of the shot object;
and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
Further, the processor 1001 may call the terminal white balance processing program stored in the memory 1005, and also perform the following operations:
the step when the photographing request is detected then comprises:
detecting whether the color temperature sensor has a fault;
if the color temperature sensor is detected to be fault-free, executing the step of starting the color temperature sensor on the terminal;
and if the color temperature sensor is detected to be in fault, acquiring RGB data of the shot object determined according to the image signal processor, determining white balance parameters according to the RGB data, and carrying out white balance processing on the terminal viewfinder image.
The step of determining white balance parameters from the RGB data comprises:
a reference region in the subject is determined from the RGB data, and white balance parameters are determined from the RGB data of the reference region.
The step of determining a reference region in a subject from the RGB data includes:
determining a first ratio of red to blue and a second ratio of red to green according to the RGB data;
if the first ratio is smaller than a first threshold value and the second ratio is smaller than a second threshold value, the area corresponding to the RGB ratio is a first reference area, and the first reference area is a reference area.
Further, the processor 1001 may call the terminal white balance processing program stored in the memory 1005, and also perform the following operations:
if the first ratio is smaller than a first threshold and the second ratio is smaller than a second threshold, the step of setting the region corresponding to the RGB ratio as a first reference region includes:
if the number of the first reference areas is multiple, comparing the RGB sizes of the multiple first reference areas;
and determining a first reference area with the maximum RGB, wherein the first reference area corresponding to the maximum RGB is the reference area.
Further, the processor 1001 may call the terminal white balance processing program stored in the memory 1005, and also perform the following operations:
the terminal white balance processing method further comprises the following steps:
when detecting that the color temperature value of a shot object in a terminal viewfinder image changes, acquiring the current color temperature value of the shot object;
and converting the current color temperature value into RGB data, and updating the white balance parameter according to the RGB data.
The step of determining the RGB data of the three primary colors of the object according to the current color temperature value of the object comprises the following steps:
and converting the color temperature values of all the shot objects in the terminal viewfinder image into RGB data, and acquiring the average value of the shot objects in R, G, B three color channels according to the RGB data, wherein the average value is the RGB data of three primary colors of the shot objects.
The step of determining white balance parameters according to the RGB data and performing white balance processing on the original imaging picture comprises the following steps:
determining a white balance RGB gain value according to the RGB data of the reference region, and determining a final correction value of all the shot objects according to the RGB gain value and the RGB data of all the shot objects;
and adjusting the RGB data of the corresponding areas of all the objects on the original imaging picture to the correction value.
Referring to fig. 2, in a first embodiment of the terminal white balance processing method of the present invention, the terminal white balance processing method includes:
step S10, when a shooting request is detected, a color temperature sensor on the terminal is started, and the current color temperature value of a shot object in a terminal view image is obtained;
the terminal generally has a plurality of white balance modes, and the embodiment is one of automatic white balance modes, when the terminal is in the automatic white balance mode, a user inputs a shooting request to the terminal, and the input mode is different according to different terminals. If the terminal is a mobile phone, the user inputs a shooting request by touch, and if the terminal is a camera, the user starts up a button to be the shooting request. When the terminal receives a shooting request input by a user, the terminal processor can detect the shooting request, and start a shooting device (such as a camera) and simultaneously start a color temperature sensor. The color temperature sensor can be adjacent to the camera and can be connected with the camera through a line under the lens so as to obtain the color temperature value of the shot object in the range of the camera viewfinder.
The subject may have one color, or multiple colors. Therefore, the color temperature sensor may detect a plurality of color temperature values of the output.
Step S11, determining three primary colors RGB data of the subject according to the current color temperature value of the subject;
since the subject may be one or more and the color may be one or more, there may be one or more color temperature values and there may be more corresponding RGB data. The RGB data may refer to three values of three colors of red, green and blue, or may refer to a ratio of the three values, and the ratio value may have various forms, such as R: G: B =1:1:2, or R: G =1: 2, and R: b =1: 3. During the adjustment of the ratio, the white balance parameter can be represented by the ratio among the gain coefficients of the three primary colors of red, green and blue, and the three colors of the shot object colors are respectively adjusted according to the ratio among the gain coefficients of the three colors.
The RGB data is obtained according to the color temperature value, and may be calculated according to a specific table or formula, or may be obtained by calling a specific function, and the conversion from the color temperature value to the RGB data belongs to the prior art, and thus is not described in detail.
Step S12, determining white balance parameters according to the RGB data, and performing white balance processing on the original image.
The original image in the present embodiment refers to an initial image captured by the capturing device that has not been subjected to white balance processing. The average RGB data can be obtained according to the RGB data, after algorithm calibration is carried out on the average RGB data, the average RGB data are output to a white balance processing module, the white balance processing module converts the average RGB data into RGB gain parameters for white balance, and white balance processing is carried out; or selecting a special RGB data (such as white or near-white RGB data) from the RGB data, performing algorithm calibration on the RGB data, and outputting the RGB data to a white balance processing module to convert the RGB data into white balance parameters; or selecting special values in the RGB data, performing operation (such as average calculation) to obtain RGB data, performing algorithm calibration, and outputting to a white balance processing module to convert into white balance parameters; or may determine from which RGB data the white balance parameters are determined according to a particular algorithm.
In the prior art, after a sensor in an Image capturing device outputs an original Image, an ISP (Image signal processor) generally counts R/G (red/green) and B/G (blue/green) of the whole Image, and then estimates which images need to be restored to R: G: B: 1:1 by an algorithm. The acquisition of RGB data here involves two key components, one is a camera and one is an ISP, and the accuracy of the final RGB is affected by these two components, but since these two components need to simultaneously assume other functions, the performance requirements for the components are higher, and the acquisition of the RGB of the object to be photographed is not as good as the components whose functions are focused on color acquisition.
In this embodiment, when the terminal shoots, the color temperature sensor is started to detect the color temperature, the color temperature value obtained by the color temperature sensor is converted into RGB data, and the final white balance parameter is determined according to the RGB data to perform white balance processing; because the color temperature sensor has higher accuracy compared with a camera or an ISP (Internet service provider), the detected color temperature value is more accurate, and the RGB data converted from the detected color temperature value is more accurate, the white balance parameter determined according to the more accurate RGB data is more accurate, the actual color of the shot object can be more truly restored, the effect of the human eyes is approached as much as possible, and the user experience is improved.
Further, in the second embodiment of the terminal white balance processing method according to the present invention, based on the first embodiment, the step S10, when detecting the shooting request, includes the following steps:
step S20, detecting whether the color temperature sensor has a fault;
step S21, if it is detected that the color temperature sensor has no fault, executing the step of starting the color temperature sensor on the terminal;
in step S22, if it is detected that the color temperature sensor is malfunctioning, RGB data of the subject determined by the image signal processor is acquired, white balance parameters are determined based on the RGB data, and white balance processing is performed on the terminal through-view image.
The color temperature sensor is used for detecting the color temperature value of a shot object, determining the RGB data of the shot object and further determining the important component of white balance parameters, when a fault occurs, an Image Signal Processor (ISP) can be used as a spare component so as not to influence user experience, namely after a shooting request is detected, if the fault of the color temperature sensor is detected, the Image Signal Processor (ISP) can be used for reading an original image, acquiring the RGB data and carrying out traditional white balance processing; if the color temperature sensor is detected to normally operate, the color temperature sensor is preferentially used for acquiring white balance parameters so as to ensure the accuracy of the parameters.
In the embodiment, the secondary standby component is arranged when the color temperature sensor fails, namely, the image signal processor replaces the color temperature sensor, so that the terminal can still perform normal white balance processing during shooting when the color temperature sensor fails, and good use experience of a user is ensured; meanwhile, if the color temperature sensor has no fault, the color temperature sensor can be preferably used for obtaining important parameters, and the accuracy of the finally obtained white balance parameters is also ensured.
Further, in a third embodiment of the terminal white balance processing method according to the present invention, based on the first embodiment or the second embodiment, the step of determining the white balance parameters according to the RGB data in step S12 includes:
a step S30 of determining a reference region in the subject from the RGB data;
in step S31, white balance parameters are determined from the RGB data of the reference region.
According to a certain algorithm, a reference region in the subject can be determined from the RGB data; the characteristics of the corresponding RGB data can be determined according to the characteristics of the reference region, and then the reference region is determined. When the image pickup apparatus performs white balance processing, it is generally necessary to select a reference point, determine white balance parameters based on RGB data of the reference point, and restore the actual color of the entire image by adjusting the RGB data of the reference point to 1:1: 1. The reference area selected in this embodiment is the reference point.
The RGB data may be represented in (R: G: B) form, generally speaking, the closer the three R, G, B are, the closer the object color is to white or gray or black. According to the conventional white balance technique, generally, white balance calibration is performed by using white or gray or black as a reference point, so that R, G, B three object regions having the closest values can be selected as reference regions.
The reference area of the shot object is determined according to the RGB data converted by the color temperature sensor, the reference area is used as the reference point for the white balance processing of the camera device, the white balance parameters are determined according to the RGB data of the reference area, the white balance parameters can be accurately acquired, the true color of the image is restored to the maximum degree, the image is closer to the color seen by human eyes, and the user experience is improved.
Specifically, as shown in fig. 3, step S30 includes:
step S32, determining a first ratio of red to blue and a second ratio of red to green according to the RGB data;
in step S33, if the first ratio is smaller than a first threshold and the second ratio is smaller than a second threshold, the area corresponding to the RGB ratio is a first reference area, and the first reference area is a reference area.
In this embodiment, the first ratio is a ratio of red to blue, and the second ratio is a ratio of red to green, but in practice, the first ratio may refer to a ratio of any two colors of RGB, such as a red-green ratio, a red-blue ratio, a blue-red ratio, and the like, and the second ratio is determined according to the first ratio, and one color of the first ratio is replaced, and if the first ratio is a red-green ratio, the second ratio may be a red-blue ratio, a green-blue ratio, and the like.
The first threshold and the second threshold may be the same or different, and should be small enough to reduce the determination error, and may be set by the terminal factory or by the user. If the first ratio is smaller than the first threshold and the second ratio is smaller than the second threshold, the RGB values of the corresponding object are relatively close, the corresponding object area is a first reference area, and the first reference area can be determined as a reference area.
This embodiment is through whether the ratio of arbitrary two colours in the comparison RGB tristimulus is less than the threshold value, and then judges whether the RGB tristimulus value is close each other, and then regards the region that the RGB tristimulus value is close as the benchmark region for the RGB data of confirming the white balance parameter is more accurate, and then makes the white balance parameter more accurate the actual color of original object better.
Further, in step S32, if the first ratio is smaller than a first threshold and the second ratio is smaller than a second threshold, the step of setting the area corresponding to the RGB ratio as the first reference area includes:
step S33, if there are a plurality of first reference areas, comparing RGB data sizes of the plurality of first reference areas;
in step S34, a first reference region having the largest RGB data is determined, and the first reference region corresponding to the largest RGB data is used as the reference region.
The RGB data may be represented in (R: G: B) form, generally speaking, the closer the three values of R, G, B, the closer the color of the object is to white or gray or black, and the larger the three values of R, G, B, the closer the object is to white and the smaller the object is to black. A white area in the subject can be determined according to this rule. The white area is more accurate than other colors when used as a reference area for white balance, so that after the first reference area is determined, if a plurality of first reference areas are provided, the white area can be determined according to a certain algorithm or a preset rule.
The method used in this embodiment is to compare the RGB data sizes. Since the RGB data relates to the sizes of three colors, a numerical value is determined if a size comparison is to be made. Since the RGB triples have small differences (the first reference region ratio is smaller than the threshold value, the maximum of the three colors may be selected to be compared with the maximum of the RGB triples in other regions, (e.g., RGB1= (250, 253, 252), RGB2= (250, 254, 252), which may be directly compared), or the average of the three colors may be used for comparison, or the RGB data among them may be selected to be the largest according to a specific algorithm. The first reference region corresponding to the maximum RGB data is a reference region.
In this embodiment, the maximum RGB data is determined from the first reference region, and then the first reference region corresponding to the maximum RGB data is determined as the reference region, so that the white region in the first reference region can be selected as the reference region or the reference region for the final white balance, because of the particularity of white, the final image can be more accurately restored.
Further, in a fourth embodiment of the terminal white balance processing method according to the present invention, based on the first embodiment, the second embodiment, or the third embodiment, the terminal white balance processing method further includes:
step S40, when detecting that the color temperature value of the shot object in the terminal viewfinder image changes, acquiring the current color temperature value of the shot object;
and step S41, converting the current color temperature value into RGB data, and updating the white balance parameter according to the RGB data.
The color temperature sensor monitors the color temperature condition of the shot object in real time in the shooting process, if the color temperature changes in the shooting process, the change should be fed back to the processor, and the current color temperature value of the shot object after the change is returned. And converting the changed color temperature value into RGB data through a certain algorithm, and updating the white balance parameter determined according to the color temperature value before the change according to the RGB data.
In the embodiment, the color temperature sensor responds to the color temperature change in real time, and the changed color temperature value can be fed back in real time, so that the current white balance parameter can be updated along with the change of the color temperature of the shot object, and the picture shot by the terminal at any time can obtain the more accurate white balance parameter to perform white balance processing, thereby restoring the real color of the shot object.
Further, in a fifth embodiment of the terminal white balance processing method according to the present invention, based on the first embodiment, the second embodiment, the third embodiment, or the fourth embodiment, step S11 includes:
step S50, converting the color temperature values of all the objects in the terminal viewfinder image into RGB data, and obtaining the average value of the objects in R, G, B three color channels according to the RGB data, where the average value is the three-primary-color RGB data of the objects.
There may be a plurality of subjects, and there may be a plurality of colors for the same subject or for different subjects, and thus a color temperature sensor may detect many color temperature values. According to a plurality of color temperature values detected by the color temperature sensor, the color temperature values are converted into a plurality of RGB data, and the RGB data can be values of a shot object on R, G, B three color channels. And calculating the average value of all the shot objects in R, G, B three color channels in the whole camera viewfinder image according to all the RGB data, and finally obtaining a unique RGB value which is the RGB data of the three primary colors of the shot objects and is used as the basis for determining white balance parameters in the future.
In the embodiment, the unique RGB data for finally determining the white balance parameter is determined from the plurality of RGB data converted from the plurality of color temperature values, so that the subsequent step of determining the white balance parameter is smoothly performed; the average value of the shot object in R, G, B three color channels is determined as the unique RGB data, the overall RGB data condition of the shot object is integrated, the accuracy of a certain degree is ensured, and the accurate reduction of the actual object color by the subsequent white balance processing is ensured.
Further, in a sixth embodiment of the terminal white balance processing method according to the present invention, based on the first embodiment, the second embodiment, the third embodiment, the fourth embodiment, or the fifth embodiment, step S12 includes:
a step S60 of determining RGB gain values of white balance from the RGB data of the reference region, and determining final correction values of all the subjects from the RGB gain values and the RGB data of all the subjects;
in step S61, the RGB data of the corresponding areas of all the subjects on the original imaging chart are adjusted to the correction values.
In general, after the RGB data as the reference region is adjusted to 1:1:1, the colors of other regions are also restored to their true colors.
The shooting device is internally provided with three CCD electronic coupling elements which respectively sense blue, green and red light rays, the electronic amplification ratios of the three photosensitive circuits are the same under the preset condition and are in a 1:1:1 relationship, and the adjustment of white balance changes the proportional relationship according to the adjusted scenery. For example, the ratio of blue, green and red lights of the scene to be adjusted is 2:1:1 (the ratio of blue light is large, the color temperature is high), then the ratio of white balance adjusted is 1:2:2, the ratio of blue is obviously reduced in the amplification ratio of the adjusted circuit, and the ratio of green and red is increased, so that the ratio of blue, green and red is the same when the scene to be adjusted passes through the white balance adjusting circuit to the shot image. That is, if the adjusted white color is slightly blue, the white balance adjustment changes the normal proportional relationship to weaken the amplification of the blue circuit, and increases the green and red ratio to make the image still white.
In this embodiment, the RGB gain value of the white balance is to adjust the RGB data of the reference region to an amplification ratio of 1:1:1, for example, the RGB data of the reference region is R: G: B =1:1:2, and the required amplification ratio for adjusting the RGB data of the reference region to R: G: B =1:1:1 is R: G: B =2:2: 1.
In this embodiment, the RGB data values of all the subjects take RGB data (ratio of three) of the subjects in the device viewfinder image or the original imaging image, and the final correction values of all the subjects, i.e., the final restored RGB data, are determined according to the RGB gain values of the white balance and the RGB data of the subjects.
After the white balance parameters are determined, the RGB data of the corresponding area of the shot object on the original imaging picture is adjusted to a correction value according to the RGB gain value of the white balance.
According to the method and the device, the white balance RGB gain value is determined according to the RGB value of the reference area, the final correction value of the RGB of the corresponding area of the shot object on the original imaging graph is determined according to the RGB data of the shot object converted according to the color temperature value detected by the color temperature sensor, the inaccuracy of the final correction value caused by the inaccuracy of a camera or an ISP is avoided, the finally restored color is closer to the real color, the image is closer to the view of human eyes, and the user experience is improved.
For convenience of understanding, referring to fig. 4 and 5, in a seventh embodiment of the terminal white balance processing method according to the present invention, the embodiment is described based on the Google Android software architecture. Fig. 4 is a related prior art drawing, and fig. 5 is a schematic diagram of an improvement point of the present embodiment.
The embodiment is implemented based on a Google Android software architecture (which can be an Android6.0 system or above) and a three-party color temperature sensor chip, and related code writing relates to a hal layer (a hardware abstraction layer), a kernel layer (a kernel layer) and a three-party algorithm library.
The shooting of the embodiment is started by a three-party camera application (camera app), a user opens the camera app to start shooting, a three-party library is opened when the hall layer starts ISP processing, specifically, loadSmartCam () is called in a constructor of the hall layer ispluningmgr to open the three-party library libsmartcam _ asb5.so, a color temperature sensor driving interface is called in the three-party library to obtain color temperature, a start function in the library is called in ispluningmgr: (a wawaake interface of the color temperature sensor driving interface is called), a correlation function in the library is called in the ispingmgr:toobtain color temperature and convert the color temperature into a value, an algorithm calibration is performed, and a final RGB value is output to 3A (automatic exposure control (AE), automatic focus control (AF), automatic white balance control (AWB)) to perform AWB processing, and finally image processing is performed by ISP to realize dynamic calibration according to color temperature.
The embodiment can write a driver according to the nxu8010 chip data manual of the color temperature sensor based on kernel-3.18 driver, and mainly realizes the following functional interfaces: the method comprises the steps of initializing nodes, obtaining nodes of RGBW values, enabling the chip to be dormant, waking up the chip, providing factory and engineering mode display information, and viewing working states during debugging.
The embodiment can realize the opening of the three-party library and the processing of the 3A and the ISP based on the 3A and ISP related files of the HAL layer of the MTK platform. The calling and the algorithm processing of the driving interface can be realized based on a trilateral library file libsmartcam _ asb5.so of the NESCHIPS company. Code debugging can be performed based on the Android system compiling environment.
The specific function or proper noun or interface layer in this embodiment is an android system or related prior art, and is not described again.
It can be seen from the technical scheme diagrams and descriptions that the picture color is more real and accurate by compensating the RGB gain of the automatic white balance to make the picture obtain the color similar to the color of eyes.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, on which a terminal white balance processing program is stored, and when the terminal white balance processing program is executed by a processor, the steps of the foregoing embodiment are implemented. Since the specific contents are substantially the same, they will not be described in detail.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

  1. A terminal white balance processing method is characterized by comprising the following steps:
    when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
    determining RGB data of the shot object according to the current color temperature value of the shot object;
    and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
  2. The terminal white balance processing method according to claim 1, wherein the step when the photographing request is detected is followed by:
    detecting whether the color temperature sensor has a fault;
    if the color temperature sensor is detected to be fault-free, executing the step of starting the color temperature sensor on the terminal;
    and if the color temperature sensor is detected to be in fault, acquiring RGB data of the shot object determined according to the image signal processor, determining white balance parameters according to the RGB data, and carrying out white balance processing on the terminal viewfinder image.
  3. The terminal white balance processing method of claim 1, wherein the step of determining white balance parameters based on the RGB data comprises:
    a reference region in the subject is determined from the RGB data, and white balance parameters are determined from the RGB data of the reference region.
  4. The terminal white balance processing method according to claim 3, wherein the step of determining a reference region in a subject from the RGB data comprises:
    determining a first ratio of red to blue and a second ratio of red to green according to the RGB data;
    if the first ratio is smaller than a first threshold value and the second ratio is smaller than a second threshold value, the area corresponding to the RGB ratio is a first reference area, and the first reference area is a reference area.
  5. The method as claimed in claim 4, wherein if the first ratio is smaller than a first threshold and the second ratio is smaller than a second threshold, the step of setting the RGB ratio corresponding to the first reference area as a subsequent step comprises:
    if the number of the first reference areas is multiple, comparing the RGB sizes of the multiple first reference areas;
    and determining a first reference area with the maximum RGB, wherein the first reference area corresponding to the maximum RGB is the reference area.
  6. The terminal white balance processing method of claim 1, wherein the terminal white balance processing method further comprises:
    when detecting that the color temperature value of a shot object in a terminal viewfinder image changes, acquiring the current color temperature value of the shot object;
    and converting the current color temperature value into RGB data, and updating the white balance parameter according to the RGB data.
  7. The terminal white balance processing method according to claim 1, wherein the step of determining the RGB data of the three primary colors of the subject based on the current color temperature value of the subject comprises:
    and converting the color temperature values of all the shot objects in the terminal viewfinder image into RGB data, and acquiring the average value of the shot objects in R, G, B three color channels according to the RGB data, wherein the average value is the RGB data of three primary colors of the shot objects.
  8. The method for processing a white balance of a terminal as set forth in claim 3, wherein the step of determining white balance parameters based on the RGB data and white balancing the original imaged picture comprises:
    determining a white balance RGB gain value according to the RGB data of the reference region, and determining a final correction value of all the shot objects according to the RGB gain value and the RGB data of all the shot objects;
    and adjusting the RGB data of the corresponding areas of all the objects on the original imaging picture to the correction value.
  9. A terminal, characterized in that the terminal comprises: the system comprises a processor, a color temperature sensor, a camera, a memory and a terminal white balance processing program which is stored on the memory and can be executed on the processor, wherein when the terminal white balance processing program is executed by the processor, the method comprises the following steps:
    when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
    determining three primary colors (RGB) data of the shot object according to the current color temperature value of the shot object;
    and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
  10. A computer-readable storage medium, having a terminal white balance processing program stored thereon, the terminal white balance processing program, when executed by a processor, implementing the steps of:
    when a shooting request is detected, starting a color temperature sensor on the terminal to acquire the current color temperature value of a shot object in a terminal viewfinder image;
    determining three primary colors (RGB) data of the shot object according to the current color temperature value of the shot object;
    and determining white balance parameters according to the RGB data, and carrying out white balance processing on the original imaging picture.
CN201780096515.8A 2017-09-06 2017-09-06 Terminal white balance processing method, terminal and computer readable storage medium Pending CN111602390A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/100776 WO2019047077A1 (en) 2017-09-06 2017-09-06 White balance processing method of terminal, and terminal and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN111602390A true CN111602390A (en) 2020-08-28

Family

ID=65633363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201780096515.8A Pending CN111602390A (en) 2017-09-06 2017-09-06 Terminal white balance processing method, terminal and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN111602390A (en)
WO (1) WO2019047077A1 (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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114216573B (en) * 2021-12-13 2023-12-19 Oppo广东移动通信有限公司 Color temperature detection method and device, computer readable medium and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222572A (en) * 2007-01-11 2008-07-16 上海杰得微电子有限公司 White balance processing equipment
JP2009122294A (en) * 2007-11-14 2009-06-04 Nikon Corp Illuminator for photography
CN102651818A (en) * 2011-02-28 2012-08-29 索尼公司 Image processing device, image processing method and program
CN103338383A (en) * 2013-06-25 2013-10-02 深圳市中兴移动通信有限公司 White balance calibrating method and device
CN103634581A (en) * 2012-08-21 2014-03-12 联想(北京)有限公司 White balance control method, device and electronic equipment
CN105100764A (en) * 2015-06-26 2015-11-25 小米科技有限责任公司 Photographing method and device
CN105208364A (en) * 2014-06-27 2015-12-30 联想(北京)有限公司 Image white balance control method, device and electronic apparatus
CN105430366A (en) * 2015-12-24 2016-03-23 广东欧珀移动通信有限公司 Control method, control device and photographing system
CN106303488A (en) * 2015-05-18 2017-01-04 小米科技有限责任公司 Camera lens module, mobile terminal and the method for remedial frames colour cast
CN106791760A (en) * 2016-12-16 2017-05-31 歌尔股份有限公司 Colour temperature detection, the method for regulation white balance, device and camera for camera

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4935049B2 (en) * 2005-10-27 2012-05-23 セイコーエプソン株式会社 Image processing apparatus, image processing method, and image processing program
CN105282451B (en) * 2015-05-26 2018-09-04 维沃移动通信有限公司 Adjust the method and its mobile terminal of the camera white balance of mobile terminal
CN106131526B (en) * 2016-07-13 2018-11-16 凌云光技术集团有限责任公司 A kind of white balancing treatment method and device based on rgb space

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222572A (en) * 2007-01-11 2008-07-16 上海杰得微电子有限公司 White balance processing equipment
JP2009122294A (en) * 2007-11-14 2009-06-04 Nikon Corp Illuminator for photography
CN102651818A (en) * 2011-02-28 2012-08-29 索尼公司 Image processing device, image processing method and program
CN103634581A (en) * 2012-08-21 2014-03-12 联想(北京)有限公司 White balance control method, device and electronic equipment
CN103338383A (en) * 2013-06-25 2013-10-02 深圳市中兴移动通信有限公司 White balance calibrating method and device
CN105208364A (en) * 2014-06-27 2015-12-30 联想(北京)有限公司 Image white balance control method, device and electronic apparatus
CN106303488A (en) * 2015-05-18 2017-01-04 小米科技有限责任公司 Camera lens module, mobile terminal and the method for remedial frames colour cast
CN105100764A (en) * 2015-06-26 2015-11-25 小米科技有限责任公司 Photographing method and device
CN105430366A (en) * 2015-12-24 2016-03-23 广东欧珀移动通信有限公司 Control method, control device and photographing system
CN106791760A (en) * 2016-12-16 2017-05-31 歌尔股份有限公司 Colour temperature detection, the method for regulation white balance, device and camera for camera

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
WO2019047077A1 (en) 2019-03-14

Similar Documents

Publication Publication Date Title
US9692959B2 (en) Image processing apparatus and method
US9451173B2 (en) Electronic device and control method of the same
CN109756671B (en) Electronic device for recording images using multiple cameras and method of operating the same
WO2018176925A1 (en) Hdr image generation method and apparatus
US9906732B2 (en) Image processing device, image capture device, image processing method, and program
CN109194882A (en) Image processing method, device, electronic equipment and storage medium
US11290641B2 (en) Electronic device and method for correcting image corrected in first image processing scheme in external electronic device in second image processing scheme
US11563889B2 (en) Electronic device and method for controlling camera using external electronic device
KR20210053096A (en) Method for providing preview and electronic device using the same
CN113132695B (en) Lens shading correction method and device and electronic equipment
US11416974B2 (en) Image processing method and electronic device supporting the same
CN111742320A (en) Method of providing text translation management data related to application and electronic device thereof
CN113411498A (en) Image shooting method, mobile terminal and storage medium
US10009545B2 (en) Image processing apparatus and method of operating the same
KR102609734B1 (en) electronic device and method for revising image based on transfer status of image
CN111602390A (en) Terminal white balance processing method, terminal and computer readable storage medium
CN111567034A (en) Exposure compensation method, device and computer readable storage medium
WO2019182359A1 (en) Electronic device for notifying of update of image signal processing and method for operating the same
WO2023151210A1 (en) Image processing method, electronic device and computer-readable storage medium
WO2021162263A1 (en) Method for generating image and electronic device therefor
US20150256718A1 (en) Image sensing apparatus and method of controlling operation of same
KR20210144151A (en) Electronic device and method for generating images by performing auto white balance
CN116668838B (en) Image processing method and electronic equipment
WO2021025445A1 (en) Local histogram matching with global regularization and motion exclusion for multi-exposure image fusion
KR20210151613A (en) Image Processing Device and Image Processing Method

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200828