CN106572343A - Color cast preventing method and terminal - Google Patents

Color cast preventing method and terminal Download PDF

Info

Publication number
CN106572343A
CN106572343A CN201510657414.6A CN201510657414A CN106572343A CN 106572343 A CN106572343 A CN 106572343A CN 201510657414 A CN201510657414 A CN 201510657414A CN 106572343 A CN106572343 A CN 106572343A
Authority
CN
China
Prior art keywords
values
preview image
colour cast
length
type
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.)
Withdrawn
Application number
CN201510657414.6A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510657414.6A priority Critical patent/CN106572343A/en
Priority to PCT/CN2016/071214 priority patent/WO2016184153A1/en
Publication of CN106572343A publication Critical patent/CN106572343A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Abstract

The embodiment of the invention discloses a color cast preventing method. The method comprises the steps that whether a preview image has color cast is detected; when the situation that preview image has color cast is detected, the color cast type and the color cast degree of the preview image are acquired and processed; and the automatic white balance AWB of a terminal is adjusted and set according to the color cast type and the color cast degree of the preview image. The embodiment of the invention also discloses a color cast preventing terminal.

Description

A kind of anti-bias color method and terminal
Technical field
The present invention relates to image processing field, more particularly to a kind of anti-bias color method and terminal.
Background technology
AWB (AWB, Automatic White Balance) referred to during image procossing, It is that the image of object of white carries out color rendition to script material, by the impact for removing external light source colour temperature, Its image on final photo is set also to be rendered as and original consistent white.
Colour temperature is Kelvin by black matrix (blackbody) this perfect light source, difference at different temperatures Color light is defining.Black matrix is a Utopian concept, refers to so one object, can be lighted, But any light from outside can be sponged, while and can all energy that absorbed are complete in the form of light Discharge.The temperature unit of black matrix is called Kelvin (K), the temperature change from 3300K to 9300K In the case of, its luminous color is respectively red, white, blueness.
Terminal with shoot function can carry out shooting setting when dispatching from the factory according to the one group of parameter debugged, In bulk shipments, due to the difference of module, one group of parameters distribution not all of module, it may appear that individual Do not take pictures colour cast problem.Or, when various scenes are shot, due to light or the problem of angle, terminal exists Colour cast problem occurs under some scenes.After the camera AWB of terminal sets, if actual module or field Scape beyond tuning parameter, the colour temperature of substantial deviation actual scene, the picture for taking is exactly serious colour cast, nothing Method obtains normal picture.Example, the colour temperature debugged of terminal camera is 5600K, if scene light Colour temperature be 5600K, then color rendition will be accurate;If live colour temperature is 3800K, can occur Color offset phenomenon, photo is partially red;If live colour temperature is 8000K, color offset phenomenon can also occur, photo is inclined It is blue.
The content of the invention
In view of this, the embodiment of the present invention is expected to provide a kind of anti-bias color method and terminal, can avoid the occurrence of Color offset phenomenon, obtains the normal picture of color.
To reach above-mentioned purpose, the technical scheme is that what is be achieved in that:
A kind of anti-bias color method, methods described includes:
Detection preview image whether there is colour cast;
When detecting the preview image and there is colour cast, process obtain the colour cast type of the preview image with And colour cast degree;
The AWB that terminal is set is adjusted according to the colour cast type and colour cast degree of the preview image AWB。
In such scheme, the detection preview image includes with the presence or absence of colour cast:
The RGB rectangular histograms of the preview image are obtained, is unimodal in the histogrammic Colours of the RGB Value, and colourity meansigma methodss be more than 1.5 when, determine that the preview image has colour cast;Otherwise, it determines described There is no colour cast in preview image.
It is described to process the colour cast type and colour cast degree for obtaining the preview image in such scheme, including:
The Lab rectangular histograms that the preview image obtains the preview image are processed, in obtaining the preview image The a values and b values of the pixel of the i-th row jth row, calculates according to below equation and obtains da, dbAnd K values:
K=D/L;
Wherein, described M, N are respectively the wide and height of the preview image, in units of pixel;A values are A component values in the Lab rectangular histograms;B values are the b component values in the Lab rectangular histograms;The K is The colour cast factor;
In da>When 0, the colour cast type for determining the preview image is partially red;In da<When 0, it is determined that described The colour cast type of preview image is partially green;In db>When 0, the colour cast type for determining the preview image is Huang partially, In db<When 0, the colour cast type for determining the preview image is partially blue;Obtain the colour cast journey of the preview image Spend for K.
In such scheme, adjusted according to the colour cast type and colour cast degree of the preview image and terminal is set AWB AWB, including:
Obtain the b/g values and r/g values of the preview image;
According to the colour cast type of the preview image and colour cast degree adjust the b/g values of the preview image with R/g values;
The AWB of terminal is arranged according to the b/g values after adjustment, r/g values.
In such scheme, the colour cast type and colour cast degree according to the preview image adjusts described pre- Look at the b/g values and r/g values of image, including:
When K is more than first threshold, the colour cast type of the preview image is partially blue, then r/g values lower first Step-length, b/g values raise the first step-length;The colour cast type of the preview image is Huang partially, then b/g values and r/g Value all lowers the first step-length;The colour cast type of the preview image is partially red, then r/g values raise the first step-length, B/g values lower the first step-length;The colour cast type of the preview image is partially green, then b/g values and r/g values are raised First step-length;
When K is less than or equal to first threshold more than Second Threshold, the colour cast type of the preview image is inclined Indigo plant, then r/g values lower the second step-length, b/g values rise the second step-length;The colour cast type of the preview image is Partially yellow, then b/g values and r/g values all lower the second step-length;The colour cast type of the preview image for partially red, then R/g values raise the second step-length, and b/g values lower the second step-length;The colour cast type of the preview image for partially green, Then b/g values and r/g values raise the second step-length;Wherein, the first step length is long more than second step.
In such scheme, the total step-length for adjusting the b/g values of the preview image is less than 0.15;Adjustment is described Total step-length of the r/g values of preview image is less than 0.15.
A kind of anti-colour cast terminal, the terminal includes:
Detector unit, for detecting that preview image whether there is colour cast;
Processing unit, for when the detector unit detects the preview image and there is colour cast, process to be obtained Take the colour cast type and colour cast degree of the preview image;
Adjustment unit, for the colour cast type of preview image that obtained according to the processing unit and colour cast journey Degree adjustment arranges the AWB AWB of terminal.
In such scheme, the detector unit, the RGB rectangular histograms specifically for obtaining the preview image, Detecting the histogrammic Colours of the RGB for single peak, and colourity meansigma methodss are when being more than 1.5, really There is colour cast in the fixed preview image;Otherwise, it determines there is no colour cast in the preview image.
In such scheme, the processing unit obtains the preview graph specifically for processing the preview image The Lab rectangular histograms of picture, obtain a values and b values of the pixel of the i-th row jth row in the preview image, press Calculate according to below equation and obtain da, dbAnd K values:
K=D/L;
Wherein, described M, N are respectively the wide and height of the preview image, in units of pixel;A values are A component values in the Lab rectangular histograms;B values are the b component values in the Lab rectangular histograms;The K is The colour cast factor;
In da>When 0, the colour cast type for determining the preview image is partially red;In da<When 0, it is determined that described The colour cast type of preview image is partially green;In db>When 0, the colour cast type for determining the preview image is Huang partially, In db<When 0, the colour cast type for determining the preview image is partially blue;Obtain the colour cast journey of the preview image Spend for K.
In such scheme, the adjustment unit, the b/g values and r/g values specifically for obtaining the preview image; The b/g values and r/g values of the preview image are adjusted according to the colour cast type and colour cast degree of the preview image; The AWB of terminal is arranged according to the b/g values after adjustment, r/g values.
In such scheme, the adjustment unit, specifically for when K is more than first threshold, if the preview The colour cast type of image is partially blue, then r/g values lower the first step-length, and b/g values raise the first step-length;If described The colour cast type of preview image is partially yellow, then b/g values and r/g values all lower the first step-length;If the preview graph The colour cast type of picture is partially red, then r/g values raise the first step-length, and b/g values lower the first step-length;If described pre- Look at image colour cast type for partially green, then b/g values and r/g values the first step-length of rise;
When K is less than or equal to first threshold more than Second Threshold, if the colour cast type of the preview image is Partially blue, then r/g values lower the second step-length, and b/g values raise the second step-length;If the colour cast class of the preview image Type is partially yellow, then b/g values and r/g values all lower the second step-length;If the colour cast type of the preview image is inclined Red, then r/g values raise the second step-length, and b/g values lower the second step-length;If the colour cast type of the preview image For partially green, then b/g values and r/g values raise the second step-length;Wherein, the first step length is long more than second step.
In such scheme, the total step-length for adjusting the b/g values of the preview image is less than 0.15;Adjustment is described Total step-length of the r/g values of preview image is less than 0.15.
A kind of anti-bias color method and terminal are embodiments provided, first detects preview image with the presence or absence of inclined Color;When detecting the preview image and there is colour cast, process obtain the colour cast type of the preview image with And colour cast degree;Then adjusted according to the colour cast type and colour cast degree of the preview image and terminal is set AWB AWB, by the picture that colour cast should occur correction, can thus avoid the occurrence of color offset phenomenon, Obtain the normal picture of color.
Description of the drawings
Fig. 1 is the schematic flow sheet of a kind of anti-bias color method that the embodiment of the present invention 1 is provided;
Fig. 2 is a kind of RGB rectangular histograms of image that there is colour cast that the embodiment of the present invention 1 is provided;
Fig. 3 is a kind of RGB rectangular histograms of image that there is no colour cast that the embodiment of the present invention 1 is provided;
Fig. 4 is the structured flowchart of a kind of anti-colour cast terminal that the embodiment of the present invention 2 is provided.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly Chu, it is fully described by.
Embodiment 1
A kind of anti-bias color method is embodiments provided, as shown in figure 1, the process of the present embodiment method Flow process is comprised the following steps:
Step 101, detection preview image whether there is colour cast.
When the shoot function that user opens a terminal is taken pictures, first displayed on the terminals can go out to want shooting image Preview image, now terminal can detect the preview image whether there is colour cast.
Discovery is analyzed to the RGB rectangular histograms of normal picture and colour cast image, if the RGB of the image In rectangular histogram, Colour is distributed concentration for single peak, and colourity meansigma methodss it is larger when, be usually present Colour cast, and colourity meansigma methodss are bigger, and colour cast is more serious (to be illustrated in figure 2 the RGB of the image that there is colour cast Rectangular histogram).If however, Colour has multi-peak in RGB rectangular histograms, and when disperseing, schemed As colour cast degree will mitigate significantly, (RGB of the image that there is no colour cast is illustrated in figure 3 even without colour cast Rectangular histogram).Therefore can pass through to obtain the RGB rectangular histograms of the preview image in the present embodiment, according to described The RGB rectangular histograms of preview image judge that the preview image whether there is colour cast.
In the present embodiment, the terminal can obtain the RGB rectangular histograms of the preview image, in the RGB Histogrammic Colour be single peak, and colourity meansigma methodss be more than 1.5 when, determine that the preview image is deposited In colour cast;Otherwise, it determines there is no colour cast in the preview image.
Certainly, detect that preview image also has other various methods, such as grey balance method, Bai Ping with the presence or absence of colour cast Weighing apparatus method etc., this is no longer going to repeat them.
Step 102, when detecting the preview image and there is colour cast, process and obtain the preview image Colour cast type and colour cast degree.
Terminal is when detecting the preview image and there is colour cast, it is necessary to which adjusting the AWB of terminal makes color Image is returned normally, and in the present embodiment, terminal needs first to process the acquisition preview graph when AWB is adjusted The colour cast type and colour cast degree of picture, then further according to the colour cast type and colour cast journey of the preview image Degree adjustment arranges the AWB of terminal.
Because RGB color is a kind of simplest color space, but RGB color maximum It is limited in that when the difference between two kinds of colors is portrayed with Euclidean distance, two for being calculated kind color Between away from the real difference that cannot correctly characterize between both colors that people are actually perceived.And The distance between the color that CIE Lab color spaces are calculated is basically identical with the difference in actual perceived, Lab rectangular histograms can objectively reflect the colour cast degree of image, and colour cast image oneself is carried out under CIE Lab Dynamic detection is more reasonable.
Lab rectangular histograms include tri- components of L, a, b, and L * component is luminance component, a components and b components For chromatic component, a components for color be from bottle green (bottom brightness value) to Lycoperdon polymorphum Vitt (middle brightness value) again to It is bright pink (high luminance values) chromatic value, b components be from sapphirine (bottom brightness value) to Lycoperdon polymorphum Vitt (in Brightness value) chromatic value of yellow (high luminance values) is arrived again.
Lab is come by RGB conversions, needs for RGB to be first converted into XYZ reconverts into Lab, i.e.,: RGB——XYZ——Lab。
The process that RGB is converted into XYZ is as follows:
Assume r, g, b is three passages of pixel, span is [0,255], then R, the value of G, B It is as follows:
Wherein,
RGB is converted into into XYZ is:
Wherein,
Gamma functions above, are for carrying out non-linear tone editor to image, it is therefore an objective to improve figure Image contrast, in the present embodiment gamma functions be not it is unique, it is above-mentioned to be merely illustrative.
XYZ is converted into into Lab is:
L=116f (Y/Yn)-16;A=500 [f (X/Xn)-f(Y/Yn)];B=200 [f (Y/Yn)-f(Z/Zn)];
Wherein,Xn, Yn, ZnGeneral acquiescence is all 1.
The concept of equivalent circular is introduced in the present embodiment, using image averaging colourity D and colourity centre-to-centre spacing M Ratio, i.e. colour cast factor K carry out the colour cast degree of identification image.Its computational methods such as following formula:
K=D/L;
M, N are respectively the wide and height of image in formula, in units of pixel.On a-b colorimetric planes, etc. The centre coordinate of effect circle is (da, db), radius is L.The center of equivalent circular is to a-b colorimetric plane neutral axis The distance of origin (a=0, b=0) is D.Sentenced by particular location of the equivalent circular on a-b colorimetric planes The overall colour cast type of disconnected image:da>When 0, the colour cast type of the preview image is partially red;da<When 0, The colour cast type of the preview image is partially green;db>When 0, the colour cast type of the preview image is Huang partially, db<When 0, the colour cast type of the preview image is partially blue.
Colour cast factor K identifies the colour cast degree of the preview image, and K values are bigger, and colour cast is more serious.
The adjustment of step 103, the colour cast type according to the preview image and colour cast degree arranges terminal AWB。
Optionally, step 103 includes below scheme:
Step 103a, the b/g values and r/g values that obtain the preview image.
Preview image described in terminal-pair carry out process can obtain the preview image b/g (blue green) values and R/g (red green) value.
Step 103b, the colour cast type according to the preview image and colour cast degree adjust the preview image B/g values and r/g values.
Terminal has known in a step 102 the colour cast type and colour cast degree of the preview image, therefore described Terminal can significantly adjust b/g values and r/g values when colour cast is very serious, by the color of colour cast type to White direction adjustment;When colour cast is not very serious, b/g values and r/g values are adjusted by a small margin, by colour cast class The color of type to white direction adjusts.
Optionally, when K is more than first threshold, the colour cast type of the preview image is indigo plant partially, then r/g Value lowers the first step-length, and b/g values raise the first step-length;The colour cast type of the preview image is Huang partially, then B/g values and r/g values all lower the first step-length;The colour cast type of the preview image is partially red, then in r/g values The first step-length, b/g values is adjusted to lower the first step-length;The colour cast type of the preview image for partially green, then b/g values The first step-length is raised with r/g values;
When K is less than or equal to first threshold more than Second Threshold, the colour cast type of the preview image is inclined Indigo plant, then r/g values lower the second step-length, b/g values rise the second step-length;The colour cast type of the preview image is Partially yellow, then b/g values and r/g values all lower the second step-length;The colour cast type of the preview image for partially red, then R/g values raise the second step-length, and b/g values lower the second step-length;The colour cast type of the preview image for partially green, Then b/g values and r/g values raise the second step-length;Wherein, the first step length is long more than second step.
Example, first threshold can be 3, and Second Threshold can be 1.5;The first step a length of 0.05; The second step a length of 0.03.
Step 103c, the AWB that terminal is set according to the b/g values after adjustment, r/g values.
White balance, literal understanding is the balance of white.White refer to the light that reflexes in human eye due to Blue, green, red three kinds of coloured light ratios are identical and vision response that formed with certain brightness.We know Road white light is made up of seven kinds of coloured light of red, orange, yellow, green, cyan, blue, purple, and this seven kinds of coloured light It is to be mixed to form by different proportion by Red Green Blue.
AWB is usually the default configuration of terminal, in order to debug AWB, nature is divided into various lists Coloured light, standard light source artificial at present mainly has following 10 type:
Simulation blue sky daylight --- D65 light source color temperatures:6500K
Average sunlight --- the D75 light source color temperatures in the simulation north:7500K
Simulated solar irradiation --- D50 light source color temperatures:5000K
The European shop light of simulation --- TL84 light source color temperatures:4000K
Simulation U.S. shop light --- CWF light source color temperatures:4100K
Another kind of U.S.'s shop light of simulation --- U30 light source color temperatures:3000K
Shop light --- the U35 light source color temperatures that simulation is specified:3500K
Analog family hotel warm colour light --- F lamp color temperatures:2700K
Simulation shows Room shot-light --- Inca lamp color temperatures:2856K
Dummy level daylight --- Horizon colour temperatures:2300K
In theory, a kind of light one group of b/g value of correspondence and r/g values, the various light of nature have these simulated lights Source combines, and can be calculated according to the scene colour temperature of actual nature and the value of various monochromatic b/g, r/g Go out actual AWB values;So terminal can just be arranged according to b/g values, the r/g values after the adjustment of step 103b AWB.
After being provided with the AWB of terminal, terminal carries out whether step 101 detection preview image colour cast occurs, Proceed step 102 and 103 if it also there is colour cast, so circulation carries out step 101-103, Zhi Daojian Measure picture and occur without colour cast.
Here it should be noted that for a secondary preview image, in circulation the mistake of step 101-103 is carried out Cheng Zhong, the total step-length for adjusting the b/g values of the preview image is less than 0.15;Adjust the preview image Total step-length of r/g values is less than 0.15.Example, for a secondary preview image, in first time step is carried out During 101-103, adjustment b/g values and r/g values are 0.05, now still carry out colour cast, have been carried out again for the first time Adjust with third time, every time adjustment b/g values and r/g values are 0.05;After the completion of third time is adjusted, adjustment is described Total step-length of the b/g values of preview image is 0.15;The total step-length for adjusting the r/g values of the preview image is also 0.15, if now still detecting preview image has colour cast, no longer adjust b/g values and r/g values, adjustment knot Beam.
Embodiment 2
A kind of anti-colour cast terminal is embodiments provided, as shown in figure 4, the terminal includes:Detection Unit 401, processing unit 402, adjustment unit 403, wherein,
Detector unit 401, for detecting that preview image whether there is colour cast;
Processing unit 402, for when the detector unit 401 detects the preview image and there is colour cast, Process the colour cast type and colour cast degree for obtaining the preview image;
Adjustment unit 403, for the colour cast type of preview image that obtained according to the processing unit 402 with And the adjustment of colour cast degree arranges the AWB AWB of terminal.
Optionally, the detector unit 401, the RGB rectangular histograms specifically for obtaining the preview image, Detecting the histogrammic Colours of the RGB for single peak, and colourity meansigma methodss are when being more than 1.5, really There is colour cast in the fixed preview image;Otherwise, it determines there is no colour cast in the preview image.
Optionally, the processing unit 402, specifically for processing the preview image preview graph is obtained The Lab rectangular histograms of picture, obtain a values and b values of the pixel of the i-th row jth row in the preview image, press Calculate according to below equation and obtain da, dbAnd K values:
K=D/L;
Wherein, described M, N are respectively the wide and height of the preview image, in units of pixel;A values are A component values in the Lab rectangular histograms;B values are the b component values in the Lab rectangular histograms;The K is The colour cast factor;
In da>When 0, the colour cast type for determining the preview image is partially red;In da<When 0, it is determined that described The colour cast type of preview image is partially green;In db>When 0, the colour cast type for determining the preview image is Huang partially, In db<When 0, the colour cast type for determining the preview image is partially blue;Obtain the colour cast journey of the preview image Spend for K.
Optionally, the adjustment unit 403, the b/g values and r/g values specifically for obtaining the preview image; The b/g values and r/g values of the preview image are adjusted according to the colour cast type and colour cast degree of the preview image; The AWB of terminal is arranged according to the b/g values after adjustment, r/g values.
The adjustment unit, specifically for when K is more than first threshold, if the colour cast class of the preview image Type is partially blue, then r/g values lower the first step-length, and b/g values raise the first step-length;If the preview image is inclined Color type is partially yellow, then b/g values and r/g values all lower the first step-length;If the colour cast type of the preview image For partially red, then r/g values raise the first step-length, b/g values the first step-length of downward;If the colour cast of the preview image Type is partially green, then b/g values and r/g values raise the first step-length;
When K is less than or equal to first threshold more than Second Threshold, if the colour cast type of the preview image is Partially blue, then r/g values lower the second step-length, and b/g values raise the second step-length;If the colour cast class of the preview image Type is partially yellow, then b/g values and r/g values all lower the second step-length;If the colour cast type of the preview image is inclined Red, then r/g values raise the second step-length, and b/g values lower the second step-length;If the colour cast type of the preview image For partially green, then b/g values and r/g values raise the second step-length;Wherein, the first step length is long more than second step.
It should be noted that the total step-length for adjusting the b/g values of the preview image is less than 0.15;Adjustment institute The total step-length for stating the r/g values of preview image is less than 0.15.
In actual applications, described in the present embodiment detector unit 401, processing unit 402 and adjustment are single Unit 403 can by the central processing unit (CPU) in the terminal with shoot function, microprocessor (MPU), The device such as digital signal processor (DSP) or field programmable gate array (FPGA) is realized.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or meter Calculation machine program product.Therefore, the present invention can using hardware embodiment, software implementation or with reference to software and The form of the embodiment of hardware aspect.And, the present invention can be adopted and wherein include calculating at one or more Computer-usable storage medium (including but not limited to disk memory and the optical storage of machine usable program code Device etc.) on implement computer program form.
The present invention is with reference to method according to embodiments of the present invention, equipment (system) and computer program Flow chart and/or block diagram describing.It should be understood that can be by computer program instructions flowchart and/or side The knot of each flow process and/or square frame and flow chart and/or the flow process in block diagram and/or square frame in block diagram Close.Can provide these computer program instructions to general purpose computer, special-purpose computer, Embedded Processor or The processor of other programmable data processing devices is producing a machine so that by computer or other can The instruction of the computing device of programming data processing equipment is produced for realizing in one flow process or multiple of flow chart The device of the function of specifying in one square frame of flow process and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or other programmable data processing devices In the computer-readable memory for working in a specific way so that in being stored in the computer-readable memory Instruction produces the manufacture for including command device, and the command device is realized in one flow process of flow chart or multiple streams The function of specifying in one square frame of journey and/or block diagram or multiple square frames.
These computer program instructions also can be loaded in computer or other programmable data processing devices, made Obtain and series of operation steps performed on computer or other programmable devices to produce computer implemented process, So as to the instruction performed on computer or other programmable devices is provided for realizing in one flow process of flow chart Or specify in one square frame of multiple flow processs and/or block diagram or multiple square frames function the step of.
The above, only presently preferred embodiments of the present invention is not intended to limit the protection model of the present invention Enclose.

Claims (12)

1. a kind of anti-bias color method, it is characterised in that methods described includes:
Detection preview image whether there is colour cast;
When detecting the preview image and there is colour cast, process obtain the colour cast type of the preview image with And colour cast degree;
The AWB that terminal is set is adjusted according to the colour cast type and colour cast degree of the preview image AWB。
2. method according to claim 1, it is characterised in that the detection preview image whether there is Colour cast includes:
The RGB rectangular histograms of the preview image are obtained, is unimodal in the histogrammic Colours of the RGB Value, and colourity meansigma methodss be more than 1.5 when, determine that the preview image has colour cast;Otherwise, it determines described There is no colour cast in preview image.
3. method according to claim 1, it is characterised in that the process obtains the preview image Colour cast type and colour cast degree, including:
The Lab rectangular histograms that the preview image obtains the preview image are processed, in obtaining the preview image The a values and b values of the pixel of the i-th row jth row, calculates according to below equation and obtains da, dbAnd K values:
d a = &Sigma; i = 1 M &Sigma; j = 1 N a M N , d b = &Sigma; i = 1 M &Sigma; j = 1 N b M N ;
D = d a 2 + d b 2 , M a = &Sigma; i = 1 M &Sigma; j = 1 N ( a - d a ) 2 M N , M b = &Sigma; i = 1 M &Sigma; j = 1 N ( b - d b ) 2 M N , L = M a 2 + M b 2 ;
K=D/L;
Wherein, described M, N are respectively the wide and height of the preview image, in units of pixel;A values are A component values in the Lab rectangular histograms;B values are the b component values in the Lab rectangular histograms;The K is The colour cast factor;
In da>When 0, the colour cast type for determining the preview image is partially red;In da<When 0, it is determined that described The colour cast type of preview image is partially green;In db>When 0, the colour cast type for determining the preview image is Huang partially, In db<When 0, the colour cast type for determining the preview image is partially blue;Obtain the colour cast journey of the preview image Spend for K.
4. method according to claim 3, it is characterised in that according to the colour cast class of the preview image Type and the adjustment of colour cast degree arrange the AWB of terminal, including:
Obtain the b/g values and r/g values of the preview image;
According to the colour cast type of the preview image and colour cast degree adjust the b/g values of the preview image with R/g values;
The AWB of terminal is arranged according to the b/g values after adjustment, r/g values.
5. method according to claim 4, it is characterised in that described according to the inclined of the preview image Color type and colour cast degree adjust the b/g values and r/g values of the preview image, including:
When K is more than first threshold, the colour cast type of the preview image is partially blue, then r/g values lower first Step-length, b/g values raise the first step-length;The colour cast type of the preview image is Huang partially, then b/g values and r/g Value all lowers the first step-length;The colour cast type of the preview image is partially red, then r/g values raise the first step-length, B/g values lower the first step-length;The colour cast type of the preview image is partially green, then b/g values and r/g values are raised First step-length;
When K is less than or equal to first threshold more than Second Threshold, the colour cast type of the preview image is inclined Indigo plant, then r/g values lower the second step-length, b/g values rise the second step-length;The colour cast type of the preview image is Partially yellow, then b/g values and r/g values all lower the second step-length;The colour cast type of the preview image for partially red, then R/g values raise the second step-length, and b/g values lower the second step-length;The colour cast type of the preview image for partially green, Then b/g values and r/g values raise the second step-length;Wherein, the first step length is long more than second step.
6. the method according to claim 4 or 5, it is characterised in that the adjustment preview image Total step-length of b/g values is less than 0.15;The total step-length for adjusting the r/g values of the preview image is less than 0.15.
7. a kind of anti-colour cast terminal, it is characterised in that the terminal includes:
Detector unit, for detecting that preview image whether there is colour cast;
Processing unit, for when the detector unit detects the preview image and there is colour cast, process to be obtained Take the colour cast type and colour cast degree of the preview image;
Adjustment unit, for the colour cast type of preview image that obtained according to the processing unit and colour cast journey Degree adjustment arranges the AWB AWB of terminal.
8. terminal according to claim 7, it is characterised in that
The detector unit, the RGB rectangular histograms specifically for obtaining the preview image are described detecting The histogrammic Colours of RGB be single peak, and colourity meansigma methodss be more than 1.5 when, determine the preview graph As there is colour cast;Otherwise, it determines there is no colour cast in the preview image.
9. terminal according to claim 7, it is characterised in that
The processing unit, the Lab Nogatas of the preview image are obtained specifically for processing the preview image Figure, obtains a values and b values of the pixel of the i-th row jth row in the preview image, according to below equation meter Calculate and obtain da, dbAnd K values:
d a = &Sigma; i = 1 M &Sigma; j = 1 N a M N , d b = &Sigma; i = 1 M &Sigma; j = 1 N b M N ;
D = d a 2 + d b 2 , M a = &Sigma; i = 1 M &Sigma; j = 1 N ( a - d a ) 2 M N , M b = &Sigma; i = 1 M &Sigma; j = 1 N ( b - d b ) 2 M N , L = M a 2 + M b 2 ;
K=D/L;
Wherein, described M, N are respectively the wide and height of the preview image, in units of pixel;A values are A component values in the Lab rectangular histograms;B values are the b component values in the Lab rectangular histograms;The K is The colour cast factor;
In da>When 0, the colour cast type for determining the preview image is partially red;In da<When 0, it is determined that described The colour cast type of preview image is partially green;In db>When 0, the colour cast type for determining the preview image is Huang partially, In db<When 0, the colour cast type for determining the preview image is partially blue;Obtain the colour cast journey of the preview image Spend for K.
10. terminal according to claim 9, it is characterised in that
The adjustment unit, the b/g values and r/g values specifically for obtaining the preview image;According to described pre- The colour cast type and colour cast degree of image of looking at adjusts the b/g values and r/g values of the preview image;According to adjustment B/g values afterwards, r/g values arrange the AWB of terminal.
11. terminals according to claim 10, it is characterised in that
The adjustment unit, specifically for when K is more than first threshold, if the colour cast class of the preview image Type is partially blue, then r/g values lower the first step-length, and b/g values raise the first step-length;If the preview image is inclined Color type is partially yellow, then b/g values and r/g values all lower the first step-length;If the colour cast type of the preview image For partially red, then r/g values raise the first step-length, b/g values the first step-length of downward;If the colour cast of the preview image Type is partially green, then b/g values and r/g values raise the first step-length;
When K is less than or equal to first threshold more than Second Threshold, if the colour cast type of the preview image is Partially blue, then r/g values lower the second step-length, and b/g values raise the second step-length;If the colour cast class of the preview image Type is partially yellow, then b/g values and r/g values all lower the second step-length;If the colour cast type of the preview image is inclined Red, then r/g values raise the second step-length, and b/g values lower the second step-length;If the colour cast type of the preview image For partially green, then b/g values and r/g values raise the second step-length;Wherein, the first step length is long more than second step.
12. terminals according to claim 10 or 11, it is characterised in that the adjustment preview image B/g values total step-length be less than 0.15;The total step-length for adjusting the r/g values of the preview image is less than 0.15.
CN201510657414.6A 2015-10-13 2015-10-13 Color cast preventing method and terminal Withdrawn CN106572343A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510657414.6A CN106572343A (en) 2015-10-13 2015-10-13 Color cast preventing method and terminal
PCT/CN2016/071214 WO2016184153A1 (en) 2015-10-13 2016-01-18 Method, terminal for preventing color shift and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510657414.6A CN106572343A (en) 2015-10-13 2015-10-13 Color cast preventing method and terminal

Publications (1)

Publication Number Publication Date
CN106572343A true CN106572343A (en) 2017-04-19

Family

ID=57319401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510657414.6A Withdrawn CN106572343A (en) 2015-10-13 2015-10-13 Color cast preventing method and terminal

Country Status (2)

Country Link
CN (1) CN106572343A (en)
WO (1) WO2016184153A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108737797A (en) * 2018-08-17 2018-11-02 Oppo广东移动通信有限公司 White balancing treatment method, device and electronic equipment
CN110996173A (en) * 2019-12-18 2020-04-10 腾讯科技(深圳)有限公司 Image data processing method and device and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402189B (en) * 2018-12-28 2023-10-31 山东华软金盾软件股份有限公司 Video image color cast detection device and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101897192A (en) * 2007-12-11 2010-11-24 奥林巴斯株式会社 White balance adjustment device and white balance adjustment method
CN103067734A (en) * 2012-12-12 2013-04-24 成都三泰电子实业股份有限公司 Video image color cast detecting method of video quality diagnostic system
CN103200349A (en) * 2013-04-08 2013-07-10 武汉大学 Scanned image color cast automatic detection method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103037224A (en) * 2012-12-07 2013-04-10 珠海全志科技股份有限公司 Image white balance processing method and device
CN103020996B (en) * 2012-12-28 2016-01-20 昆山市工业技术研究院有限责任公司 Based on the detection method of the image color cast of Lab space
CN104853172B (en) * 2014-02-19 2017-11-07 联想(北京)有限公司 A kind of information processing method and a kind of electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101897192A (en) * 2007-12-11 2010-11-24 奥林巴斯株式会社 White balance adjustment device and white balance adjustment method
CN103067734A (en) * 2012-12-12 2013-04-24 成都三泰电子实业股份有限公司 Video image color cast detecting method of video quality diagnostic system
CN103200349A (en) * 2013-04-08 2013-07-10 武汉大学 Scanned image color cast automatic detection method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
巢琳,等: "基于图像偏色检测的自动白平衡算法研究", 《设计与实现》 *
徐晓昭,等: "基于图像分析的偏色检测及颜色校正方法", 《测控技术》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108737797A (en) * 2018-08-17 2018-11-02 Oppo广东移动通信有限公司 White balancing treatment method, device and electronic equipment
CN110996173A (en) * 2019-12-18 2020-04-10 腾讯科技(深圳)有限公司 Image data processing method and device and storage medium
CN110996173B (en) * 2019-12-18 2021-11-05 腾讯科技(深圳)有限公司 Image data processing method and device and storage medium

Also Published As

Publication number Publication date
WO2016184153A1 (en) 2016-11-24

Similar Documents

Publication Publication Date Title
CN104485068B (en) Luminance-chrominance correction method and system of LED (Light Emitting Diode) display screen
CN104796683B (en) A kind of method and system of calibration image color
CN107197225A (en) Color digital camera white balance correcting based on chromatic adaptation model
US11277595B2 (en) White balance method for image and terminal device
CN105185315B (en) LED display uniformity correcting method
CN108668411B (en) Color correction method for color lamp
RU2013114372A (en) AUTOMATIC PROCESSING OF WHITE BALANCE WITH FLEXIBLE SELECTION OF COLOR SPACE
CN104897374A (en) Color-correcting method of camera module
CN107483908A (en) White balance calibration method and electronic equipment
CN109151426A (en) A kind of white balance adjustment method, device, camera and medium
CN105898263B (en) A kind of image white balance method, device and computing device
Zapryanov et al. Automatic White Balance Algorithms forDigital StillCameras–a Comparative Study
CN104933706B (en) A kind of imaging system color information scaling method
CN105872500A (en) Adjusting method and device for white balance of image
CN103236251B (en) Method and device for calibrating uniformity of splicing wall
CN106572343A (en) Color cast preventing method and terminal
CN101212693A (en) White balancing method and image adjusting device
CN110322830A (en) LED screen brightness correcting method and device
CN110120207A (en) Splicing large screen chroma-luminance consistency automatic adjustment system and bearing calibration
CN106357988A (en) White balance adjustment method, device and terminal equipment
CN107864369B (en) The compound display acquisition method of LED display
CN101088297A (en) Automatic white balance control
CN107231549A (en) AWB detecting system
Varghese et al. Colorimetric calibration of high dynamic range images with a ColorChecker chart
US9036030B2 (en) Color calibration of an image capture device in a way that is adaptive to the scene to be captured

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20170419

WW01 Invention patent application withdrawn after publication