CN106791758B - The judgment method and device of natural light mixing colour temperature in a kind of image - Google Patents
The judgment method and device of natural light mixing colour temperature in a kind of image Download PDFInfo
- Publication number
- CN106791758B CN106791758B CN201611117128.1A CN201611117128A CN106791758B CN 106791758 B CN106791758 B CN 106791758B CN 201611117128 A CN201611117128 A CN 201611117128A CN 106791758 B CN106791758 B CN 106791758B
- Authority
- CN
- China
- Prior art keywords
- colour temperature
- natural light
- direction vector
- image
- unit direction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/73—Colour balance circuits, e.g. white balance circuits or colour temperature control
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Processing Of Color Television Signals (AREA)
- Color Television Image Signal Generators (AREA)
Abstract
The present invention discloses the judgment method and device of natural light mixing colour temperature in a kind of image, the method includes:Multiple rectangular areas are divided an image into, determine the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area;Corresponding each first coordinate points in each rectangular area are determined according to the parameter;First coordinate points are divided into the first cluster and the second cluster, according to the central point of each cluster, determine the first unit direction vector;When the first unit direction vector and the angle of the second unit direction vector pre-saved are less than the first given threshold, determining image to be corrected, there are natural light mixing colour temperatures.Since in embodiments of the present invention, the angle of the first unit direction vector and the second unit direction vector reflects the possibility degree that image mixes colour temperature for natural light, therefore, judge that image to be corrected is more accurate with the presence or absence of natural light mixing colour temperature.
Description
Technical field
The present invention relates to a kind of judgment methods of natural light mixing colour temperature in technical field of image processing more particularly to image
And device.
Background technology
With the continuous development of image processing techniques, white balance correcting is also increasingly perfect, in the prior art,
When treating correction image progress white balance correction, mostly using method for correcting automatic white balance, Fig. 1 is of the prior art automatic white
Method for correcting balance, detailed process include:
S101:The reference white point of image to be corrected is acquired, and determines that reference white point-rendering refers to white area.
S102:It calculates image to be corrected and currently falls into reference white point quantity with reference to white area, if reference white point quantity
Less than or equal to the first predetermined threshold value, S105 is carried out, otherwise, carries out S103.
S103:Judge that image to be corrected mixes colour temperature with the presence or absence of natural light, if carrying out S105, otherwise, carry out S104.
S104:White point quantity according to falling into reference to white area calculates white balance gains, and uses the white balance gains pair
The image to be corrected carries out complementary color correction.
S105:Go out white balance gains, and school is treated to described using the white balance gains using preset algorithm policy calculation
Positive image carries out complementary color correction.
This method by image to be corrected fall into reference to white area white point carry out dynamic birds of the same feather flock together, white point is divided into two clusters
In class, when the white point number in two cluster classes meets preset condition, then judge image to be corrected there are natural light mix colour temperature,
But the rule of natural light mixing colour temperature is not considered when being judged.For example, when having white road and green plants in image
When, white and green are divided into two cluster classes by dynamically birdsing of the same feather flock together, through judging, the white point number in white and green cluster class expires
Sufficient preset condition, then this method thinks image there are natural light mixing colour temperature, and calculates white balance increasing respectively with green to white
Benefit, and not there are natural lights to mix colour temperature for the actual conditions images.It allows for mixing image with the presence or absence of natural light in this way
Colour temperature error in judgement thereby reduces the accuracy of white balance correction.
Invention content
The embodiment of the present invention provides the judgment method and device of natural light mixing colour temperature in a kind of image, existing to solve
The problem of judgement of natural light mixing colour temperature is inaccurate in technology image.
The method of the present invention includes a kind of judgment method of natural light mixing colour temperature in image, and this method includes:
For image to be corrected, described image is divided into multiple rectangular areas according to the rule of setting, according to each
The red R of rectangular area, green G, indigo plant B mean values determine the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area;
The value that colour temperature evaluation parameter is mixed according to a pair of of natural light of each rectangular area determines in the coordinate system of structure
Corresponding each first coordinate points in each rectangular area, wherein coordinate system are made with the pair of natural light mixing colour temperature evaluation parameter
For horizontally and vertically;
The first coordinate points in the coordinate system are divided into the first cluster and the second cluster, according to the center of each cluster
Point determines the first unit direction vector, wherein the direction of the first unit direction vector is low colour temperature to high color temperature direction;
Whether the angle of the second unit direction vector for judging the first unit direction vector and pre-saving is less than setting
First threshold, wherein, the second unit direction vector is to be predefined according to the target image that colour temperature is mixed there are natural light
And preserve;
If so, image to be corrected is determined there are natural light mixing colour temperature, otherwise, it determines image to be corrected is not present
Natural light mixes colour temperature.
Further, it is determined that the process of the second unit direction vector includes:
For the target image of natural light mixing colour temperature acquired in advance, the target image is drawn according to the rule of setting
It is divided into multiple rectangular areas, according to R, G, B mean value of each rectangular area, determines a pair of of natural light mixing of each rectangular area
The value of colour temperature evaluation parameter;
The value that colour temperature evaluation parameter is mixed according to a pair of of natural light of each rectangular area determines in the coordinate system of structure
Corresponding each second coordinate points in each rectangular area, wherein coordinate system mix colour temperature evaluation parameter with the pair of natural light
As horizontally and vertically;
According to coordinate of each second coordinate points in the coordinate system, the second unit direction vector is determined, wherein described
The direction of second unit direction vector is low colour temperature to high color temperature direction.
Further, coordinate of each second coordinate points of the basis in the coordinate system, determines the second unit direction
Vector includes:
The coordinate information of two coordinate points input by user is obtained, determines the direction vector of described two coordinate points, and will
The corresponding unit vector of the direction vector is as the second unit direction vector;Or
According to least square method, the corresponding linear equation of the second coordinate points in the coordinate system is determined, according to the straight line
Equation determines the corresponding second unit direction vector of the linear equation;Or
According to the method for principal component analysis, the covariance matrix of the point set of the second coordinate points composition is determined, according to institute
The feature vector for stating covariance matrix determines the second unit direction vector.
Further, after the determining image to be corrected mixes colour temperature there are natural light, the method further includes:
White balance gains are determined according to natural light mixing colour temperature white balance algorithm and described image is corrected.
Further, it is described to determine that white balance gains include according to natural light mixing colour temperature white balance algorithm:
According to the first unit direction vector and the angle and setup parameter of the second unit direction vector, use is preset
Algorithm determines the angle and the corresponding natural light mixing colour temperature parameter value of the setup parameter;
Colour temperature parameter value is mixed according to the natural light and determines that monochromatic warm white balance algorithm and natural light mixing colour temperature are put down in vain
Corresponding first weight of method and the second weight are accounted, colour temperature white balance is mixed according to the monochromatic warm white balance algorithm and natural light
Algorithm and corresponding first weight and the second weight, determine white balance gains.
Further, it is described that colour temperature parameter value is mixed according to the natural light, determine monochromatic warm white balance algorithm and nature
Corresponding first weight of light mixing colour temperature white balance algorithm and the second weight include:
The natural light is mixed into colour temperature parameter value as the second weight, using 1 with the difference of second weight as first
Weight.
Further, it is described according to the first unit direction vector and the folder of the second unit direction vector pre-saved
Angle and setup parameter using preset algorithm, determine the angle and the corresponding natural light mixing colour temperature ginseng of the setup parameter
Numerical value includes:
According to the first unit direction vector and the angle of the second unit direction vector pre-saved, the folder is calculated
Angle and the product of parameter preset;The cosine value of the product is determined as the natural light and mixes colour temperature parameter value.
Further, described to determine that image to be corrected is not present after natural light mixing colour temperature, the method further includes:
White balance gains are determined according to monochromatic warm white balance algorithm and described image is corrected.
Further, the first unit direction vector of the judgement is with the angle of the second unit direction vector pre-saved
No to be less than before the first threshold of setting, the method further includes:
The ambient light illumination of image is determined according to the camera of preservation shooting aperture time, gain parameter, aperture, when the environment
When illumination is more than the second given threshold, continue subsequent step;Or
When the distance between central point for judging the first cluster and the second cluster is more than third given threshold, continue follow-up step
Suddenly;Or
Judge the first cluster abscissa corresponding with the colour temperature that the abscissa of the central point of the second cluster is respectively positioned on natural light
In the range of, and the first cluster ordinate range corresponding with the colour temperature that the ordinate of the central point of the second cluster is respectively positioned on natural light
When interior, continue subsequent step.
Further, the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area includes:
Each G/R values of rectangular area and G/B values;Or
Each logarithm of G/R of rectangular area and the logarithm of G/B;Or
Each logarithm of R/G of rectangular area and the logarithm of B/G.
On the other hand, an embodiment of the present invention provides a kind of judgment means of natural light mixing colour temperature in image, the dresses
Put including:
Described image for being directed to image to be corrected, is divided into multiple by the first determining module according to the rule of setting
Rectangular area according to the red R of each rectangular area, green G, indigo plant B mean values, determines a pair of of natural light secondary colour of each rectangular area
The value of warm evaluation parameter;
Second determining module, for mixing the value of colour temperature evaluation parameter according to a pair of of natural light of each rectangular area in structure
Corresponding each first coordinate points in each rectangular area are determined in the coordinate system built, wherein coordinate system is mixed with the pair of natural light
Colour temperature evaluation parameter is closed as horizontally and vertically;
Third determining module, for the first coordinate points in the coordinate system to be divided into the first cluster and the second cluster,
According to the central point of each cluster, the first unit direction vector is determined, wherein the direction of the first unit direction vector is low
Colour temperature is to high color temperature direction;
First judgment module, for the folder of the second unit direction vector for judging the first unit direction vector Yu pre-saving
Whether angle is less than the first threshold of setting, wherein, the second unit direction vector is to mix colour temperature according to there are natural lights
What target image was predefined and was preserved;
4th determining module if the judging result for the first judgment module is yes, determines that image to be corrected exists
Natural light mixes colour temperature, if the judging result of the first judgment module is no, determines image to be corrected there is no natural lights to mix
Close colour temperature.
Further, first determining module is additionally operable to for the target figure of natural light mixing colour temperature acquired in advance
The target image is divided into multiple rectangular areas by picture according to the rule of setting, equal according to R, G, B of each rectangular area
Value determines the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area;
Second determining module is additionally operable to mix colour temperature evaluation parameter according to a pair of of natural light of each rectangular area
Value determines corresponding each second coordinate points in each rectangular area in the coordinate system of structure, wherein coordinate system with the pair of
Natural light mixing colour temperature evaluation parameter is as horizontally and vertically;
The third determining module is additionally operable to the coordinate in the coordinate system according to each second coordinate points, determines
Two unit direction vectors, wherein the direction of the second unit direction vector is low colour temperature to high color temperature direction.
Further, the third determining module, specifically for obtaining the coordinate information of two coordinate points input by user,
Determine the direction vector of described two coordinate points, and using the corresponding unit vector of the direction vector as the second unit side
To vector;Or, according to least square method, the corresponding linear equation of the second coordinate points in the coordinate system is determined, according to described straight
Line equation determines the corresponding second unit direction vector of the linear equation;Or, the method according to principal component analysis, determine institute
The covariance matrix of the point set of the second coordinate points composition is stated, the second unit side is determined according to the feature vector of the covariance matrix
To vector.
Further, described device further includes:
5th determining module after determining that image to be corrected mixes colour temperature there are natural light, is mixed according to natural light
Colour temperature white balance algorithm is closed to determine white balance gains and be corrected described image.
Further, the 5th determining module, specifically for according to the first unit direction vector and the second unit
The angle and setup parameter of direction vector using preset algorithm, determine the angle and the corresponding nature of the setup parameter
Light mixes colour temperature parameter value;Colour temperature parameter value is mixed according to the natural light and determines monochromatic warm white balance algorithm and natural light mixing
Corresponding first weight of colour temperature white balance algorithm and the second weight, according to the monochromatic warm white balance algorithm and natural light secondary colour
Warm white balance algorithm and corresponding first weight and the second weight, determine white balance gains.
Further, the 5th determining module, specifically for the natural light is mixed colour temperature parameter value as second
Weight, using 1 with the difference of second weight as the first weight.
Further, the 5th determining module, specifically for according to the first unit direction vector and pre-saving
The second unit direction vector angle, calculate the product of the angle and parameter preset;The cosine value of the product is determined
Colour temperature parameter value is mixed for the natural light.
Further, described device further includes:
5th determining module, after determining image to be corrected there is no natural light mixing colour temperature, according to monochromatic temperature
White balance algorithm determines white balance gains and described image is corrected.
Further, described device further includes:
Second judgment module, for determining the ring of image according to the camera of preservation shooting aperture time, gain parameter, aperture
Border illumination when the ambient light illumination is more than the second given threshold, continues subsequent step;Or judge the first cluster and the second cluster
The distance between central point when being more than third given threshold, continue subsequent step;Or judge the first cluster and the second cluster
The abscissa of central point is respectively positioned in the range of the corresponding abscissa of colour temperature of natural light, and the center of the first cluster and the second cluster
When the ordinate of point is respectively positioned in the range of the corresponding ordinate of colour temperature of natural light, the first judgment module is triggered.
Further, first determining module, the G/R of each rectangular area specifically for determining each rectangular area
Value and G/B values;Or, determine the logarithm of G/R of each rectangular area and the logarithm of G/B;Or, determine each rectangular area
Each logarithm of R/G of rectangular area and the logarithm of B/G.
The embodiment of the present invention provides the judgment method and device of natural light mixing colour temperature in a kind of image, the method packet
It includes:For image to be corrected, described image is divided into multiple rectangular areas according to the rule of setting, according to each rectangle region
The red R in domain, green G, indigo plant B mean values determine the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area;According to each
The value of a pair of of natural light mixing colour temperature evaluation parameter of rectangular area determines that each rectangular area corresponds in the coordinate system of structure
Each first coordinate points, wherein coordinate system using the pair of natural light mix colour temperature evaluation parameter as horizontally and vertically;It will
The first coordinate points in the coordinate system are divided into the first cluster and the second cluster, according to the central point of each cluster, determine the
One unit direction vector, wherein the direction of the first unit direction vector is low colour temperature to high color temperature direction;Judge that first is single
Whether position direction vector and the angle of the second unit direction vector pre-saved are less than the first threshold of setting, wherein, it is described
Second unit direction vector is to predefine and preserve according to the target image that colour temperature is mixed there are natural light;If so, really
Fixed image to be corrected is there are natural light mixing colour temperature, otherwise, it determines there is no natural light mixing colour temperatures for image to be corrected.By
In the second unit direction vector be directed to there are natural light mixing colour temperature target image to determine, therefore, when the first unit
The angle of direction vector and the second unit direction vector is less than the first threshold of setting, illustrates the image to be corrected and the presence
The target image of natural light mixing colour temperature is similar, and there is also natural lights to mix colour temperature, thereby may be ensured that image natural light mixes
The accuracy that colour temperature judges, and further ensure the accuracy of follow-up white balance correction.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly introduced, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for this
For the those of ordinary skill in field, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of realizing auto kine bias function process schematic that the prior art provides;
Fig. 2 is the deterministic process schematic diagram that natural light mixes colour temperature in a kind of image that the embodiment of the present invention 1 provides;
Fig. 3 is that the image that the embodiment of the present invention 1 provides divides rectangular area schematic diagram;
Fig. 4 is the corresponding coordinate system schematic diagram of target image that the embodiment of the present invention 2 provides;
Fig. 5 is the deterministic process schematic diagram that natural light mixes colour temperature in a kind of image that the embodiment of the present invention 4 provides;
Fig. 6 is the judgment means structure diagram that natural light mixes colour temperature in a kind of image provided in an embodiment of the present invention.
Specific embodiment
It is more accurate in order to judge image natural light mixing colour temperature, and further make the accurate of follow-up white balance correction
Property improve, an embodiment of the present invention provides in a kind of image natural light mixing colour temperature judgment method and device.
The present invention will be describe below in further detail with reference to the accompanying drawings, it is clear that described embodiment is only this
Invention part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist
The all other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Embodiment 1:
Fig. 2 mixes the deterministic process schematic diagram of colour temperature, the mistake for natural light in a kind of image provided in an embodiment of the present invention
Journey includes the following steps:
S201:For image to be corrected, described image is divided into multiple rectangular areas according to the rule of setting, according to
The red R of each rectangular area, green G, indigo plant B mean values determine a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area
Value.
The judgment method of natural light mixing colour temperature is applied to electronic equipment in a kind of image provided in an embodiment of the present invention.Institute
It states electronic equipment and includes PC, smart television, camera and mobile phone etc..
Image to be corrected is divided into multiple rectangular areas by the electronic equipment according to the rule of setting, to be corrected
Image when being divided, can the long of image be subjected to n deciles, m deciles be carried out to the wide of image, wherein the m and n is identical
Or it is different, multiple rectangular areas are obtained after division.As shown in figure 3, the length and width to image carry out 6 deciles respectively, i.e., image is drawn
It is divided into 36 rectangular areas.According to the red R of each pixel in each rectangular area, green G, indigo plant B values, each rectangle region is determined
R, G, B mean value in domain, so determine each rectangular area a pair of of natural light mixing colour temperature evaluation parameter value, it is the pair of from
The value of right light mixing colour temperature evaluation parameter can be G/R, G/B value of each rectangular area or each rectangular area
The logarithm of G/R, the logarithm of G/B can also be the logarithm of the R/G of each rectangular area, the logarithm of B/G.
S202:The value of colour temperature evaluation parameter is mixed in the coordinate system of structure according to a pair of of natural light of each rectangular area
Determine corresponding each first coordinate points in each rectangular area, wherein coordinate system is with the pair of natural light mixing colour temperature evaluation ginseng
Number is as horizontally and vertically.
The value of the pair of natural light mixing colour temperature evaluation parameter can be G/R, G/B value of each rectangular area, also may be used
Be each rectangular area G/R logarithm, the logarithm of G/B, can also be the R/G of each rectangular area logarithm,
A pair of natural light is mixed colour temperature evaluation parameter as horizontally and vertically, builds coordinate system, determine each by the logarithm of B/G
Corresponding each first coordinate points in rectangular area.
Such as G/R, G/B value that the value of a pair of natural light mixing colour temperature evaluation parameter is each rectangular area, structure
Horizontal axis of the coordinate system using G/R as coordinate system, using G/B as the longitudinal axis of coordinate system.Therefore for each rectangular area, the rectangle
G/R, G/B value in region, it is believed that be the abscissa and ordinate of the rectangular area, therefore the rectangular area is identified to the seat
In mark system, it is believed that be abscissa be its G/R value, ordinate is the coordinate points of its G/B value.
Such as the value of a pair of natural light mixing colour temperature evaluation parameter can also be the logarithm of the G/R of each rectangular area
Value, the logarithm of G/B, the horizontal axis of the coordinate system of structure using the logarithm of G/R as coordinate system, using the logarithm of G/B as seat
Mark the longitudinal axis of system.A pair of natural light mixing colour temperature evaluation parameter value can also be each rectangular area R/G logarithm,
The logarithm of B/G, the horizontal axis of the coordinate system of structure using the logarithm of R/G as coordinate system, using the logarithm of B/G as coordinate system
The longitudinal axis.
S203:The first coordinate points in the coordinate system are divided into the first cluster and the second cluster, according to each cluster
Central point, the first unit direction vector is determined, wherein the direction of the first unit direction vector is low colour temperature to high color temperature
Direction.
The value of colour temperature evaluation parameter is mixed according to a pair of of natural light of each rectangular area, it is determined that each square in coordinate system
After corresponding first coordinate points in shape region, clustering algorithm may be used, the first coordinate points in coordinate system are clustered, specifically
In cluster, the first coordinate points in the coordinate system are divided into the first cluster and the second cluster.Wherein in coordinate system
The first coordinate points when being clustered, general clustering method, such as kmeans algorithms, K mean algorithms etc. may be used.
The first coordinate points in the coordinate system can be divided by K mean algorithms in embodiments of the present invention
One cluster and the second cluster.It is divided into after two clusters and mean shift process may be used determines the first cluster and second poly- respectively
The central point of class.
Colour temperature is higher, more inclined blue cast, and B values are bigger;Colour temperature is lower, more inclined red color tone, and R values are bigger.It specifically determines low
The process in colour temperature to high color temperature direction belongs to the prior art, in embodiments of the present invention to the process without repeating.
Specifically using clustering algorithm, by the first coordinate points in coordinate system be divided into the first cluster and the second cluster and
It determines that the process of the central point of the first cluster and the second cluster belongs to the prior art using mean shift process, implements in the present invention
To the process without repeating in example.
S204:Judge whether the first unit direction vector is less than with the angle of the second unit direction vector pre-saved to set
Fixed first threshold, wherein, the second unit direction vector is advance according to the target image that colour temperature is mixed there are natural light
It determines and preserves, if it is, carrying out S205, otherwise, carry out S206.
In embodiments of the present invention according to there are natural light mixing colour temperature target image, generation the second unit direction to
Amount.Because for there are natural light mixing colour temperature target image, when by it according to the regular partition set as multiple rectangle regions
During domain, the value of a pair of of natural light mixing colour temperature evaluation parameter of each of which rectangular area is distributed approximate one directly in a coordinate system
Line, therefore the low colour temperature of this line correspondences can be determined to the unit vector in high color temperature direction according to this feature, by the unit
Vector is used as the second unit direction vector.
S205:Determining image to be corrected, there are natural light mixing colour temperatures.
S206:Determining image to be corrected, there is no natural light mixing colour temperatures.
After the first unit direction vector is determined, according to the first unit direction vector and the folder of the second unit direction vector
Angle, you can judge that image to be corrected mixes colour temperature with the presence or absence of natural light, when the angle is less than the first given threshold, say
The value of a pair of of natural light mixing colour temperature evaluation parameter of rectangular area after bright image division also complies with natural light mixing colour temperature
The distribution characteristics of image, it is thus determined that image to be corrected there are natural light mix colour temperature, when the angle is set not less than first
When determining threshold value, determining image to be corrected, there is no natural light mixing colour temperatures.Wherein first given threshold can be 3 degree, 5 degree
Etc. smaller numerical value.
Due in embodiments of the present invention, being judged according to the angle of the first unit direction vector and the second unit direction vector
Image to be corrected with the presence or absence of natural light mix colour temperature, the second unit direction vector be directed to there are natural light mix colour temperature
Target image predefine and preserve, therefore, when the angle of the first unit direction vector and the second unit direction vector is small
In the first threshold of setting, illustrate that the image to be corrected is similar with the target image there are natural light mixing colour temperature, also deposit
Colour temperature is mixed in natural light, thereby may be ensured that the accuracy that image natural light mixing colour temperature judges, and further ensure
The accuracy of follow-up white balance correction.
Embodiment 2:
On the basis of above-described embodiment, in order to mix the target image of colour temperature according to the natural light acquired in advance, accurately
Determine the second unit direction vector, improve the accuracy that subsequently judges, in embodiments of the present invention, determine second unit
The process of direction vector includes:
For the target image of natural light mixing colour temperature acquired in advance, the target image is drawn according to the rule of setting
It is divided into multiple rectangular areas, according to R, G, B mean value of each rectangular area, determines a pair of of natural light mixing of each rectangular area
The value of colour temperature evaluation parameter;
The value that colour temperature evaluation parameter is mixed according to a pair of of natural light of each rectangular area determines in the coordinate system of structure
Corresponding each second coordinate points in each rectangular area, wherein coordinate system mix colour temperature evaluation parameter with the pair of natural light
As horizontally and vertically;
According to coordinate of each second coordinate points in the coordinate system, the second unit direction vector is determined, wherein described
The direction of second unit direction vector is low colour temperature to high color temperature direction.
Electronic equipment acquires the target image of width natural light mixing colour temperature in advance, has blue sky, sun in the target image
Target image is divided into multiple rectangular areas by the information such as light, shade according to the rule of setting.It is more target image is divided into
During a rectangular area, various ways may be used, as long as the dividing mode phase with the rectangular area of the image in above-described embodiment
With.Such as when being divided to target image, can the long of image be subjected to n deciles, m etc. is carried out to the wide of image
Point, wherein the m and n are identical or different, multiple rectangular areas are obtained after division, specific dividing mode is with reference to Fig. 3.According to every
The red R of each pixel in a rectangular area, green G, indigo plant B values determine R, G, B mean value of each rectangular area, and then determine every
The value of a pair of of natural light mixing colour temperature evaluation parameter of a rectangular area.
The value of the pair of natural light mixing colour temperature evaluation parameter can be G/R, G/B value of each rectangular area, also may be used
Be each rectangular area G/R logarithm, the logarithm of G/B, can also be the R/G of each rectangular area logarithm,
The logarithm of B/G.
For G/R, G/B value by the value of the pair of natural light mixing colour temperature evaluation parameter for each rectangular area, really
After G/R, G/B value for having determined each rectangular area, determine that G/R, G/B value of each rectangular area are corresponding in coordinate system is built
Each second coordinate points, specifically in a coordinate system for there are each second that the target image of natural light mixing colour temperature determines
Coordinate points are referring to Fig. 4.
As can be seen from FIG. 4, there are the target images of natural light mixing colour temperature, after being divided into multiple rectangular areas, root
According to G/R, G/B value of each rectangular area, corresponding second coordinate points in each rectangular area are determined in the coordinate system of structure
Afterwards, the distribution of the second coordinate points is approximate straight line in the coordinate system, therefore the second unit can be determined according to the straight line
Direction vector, wherein the direction of the second unit direction vector is low colour temperature to high color temperature direction.
The value for specifically determining a pair of of mixing colour temperature evaluation parameter of each rectangular area and the method for building coordinate system with
Method in the embodiment of the present invention 1 is identical, is no longer repeated in embodiments of the present invention.
In embodiments of the present invention, the second unit direction vector can be determined by different methods, according to each second
Coordinate of the coordinate points in the coordinate system determines that the second unit direction vector includes:
The coordinate information of two coordinate points input by user is obtained, determines the direction vector of described two coordinate points, and will
The corresponding unit vector of the direction vector is as the second unit direction vector;Or
According to least square method, the corresponding linear equation of the second coordinate points in the coordinate system is determined, according to the straight line
Equation determines the corresponding second unit direction vector of the linear equation;Or
According to the method for principal component analysis, the covariance matrix of the point set of the second coordinate points composition is determined, according to institute
The feature vector for stating covariance matrix determines the second unit direction vector.
The second coordinate points in a coordinate system are similar to straight line, and user can choose two coordinates on the straight line
Point or user input the coordinate of two coordinate points, after electronic equipment determines the coordinate of two coordinate points, and then can determine
The low colour temperature of described two coordinate points and is made the corresponding unit vector of the direction vector to the direction vector in high color temperature direction
For the second unit direction vector.
Such as two coordinate points that electronic equipment determines are A (gr1, gb1) and B (gr2, gb2), then can determine A, B
The corresponding direction vector of two coordinate points is C=B-A, and wherein direction is low colour temperature to high color temperature direction, and it is single to be then obtained second
Position direction vector e=C/ | C |
It can also be coordinate of the electronic equipment according to each second coordinate points in the coordinate system, pass through least square
Method determines the corresponding linear equation gb=k*gr+b of the second coordinate points in the coordinate system, wherein, pass through least square fitting
The process of linear equation belongs to the prior art, in embodiments of the present invention to the realization process without repeating.It is straight when determining
After line equation, any two coordinate points for meeting the linear equation are determined, and then can determine the low color of described two coordinate points
Temperature arrive high color temperature direction direction vector, and using the corresponding unit vector of the direction vector as the second unit direction to
Amount.
, by the method for principal component analysis, described can also be determined according to each second coordinate points in the coordinate system
The covariance matrix of the point set of two coordinate points composition, and asks for the feature vector of the covariance matrix, according to the feature to
Amount, and then determine the second unit direction vector, wherein the direction of the second unit direction vector is low colour temperature to high color temperature side
To.Wherein determine that the process of covariance matrix belongs to the prior art by the method for principal component analysis, in embodiments of the present invention
To the process without repeating.
Embodiment 3:
For the white balance correction to image of realization, on the basis of the various embodiments described above, in embodiments of the present invention,
After determining that image to be corrected mixes colour temperature there are natural light, the method further includes:
White balance gains are determined according to natural light mixing colour temperature white balance algorithm and described image is corrected.
The natural light mixing colour temperature white balance algorithm can be gray world algorithm, specifically, being calculated using gray world
Method determines that the process of white balance gains belongs to the prior art, and according to white balance gains, to image, corrected process is also existing
There is technology, in embodiments of the present invention to the process without repeating.
It is described in embodiments of the present invention that colour temperature white balance is mixed according to natural light in order to make white balance correction more accurate
Algorithm determines that white balance gains include:
According to the first unit direction vector and the angle and setup parameter of the second unit direction vector, use is preset
Algorithm determines the angle and the corresponding natural light mixing colour temperature parameter value of the setup parameter;
Colour temperature parameter value is mixed according to the natural light and determines that monochromatic warm white balance algorithm and natural light mixing colour temperature are put down in vain
Corresponding first weight of method and the second weight are accounted, colour temperature white balance is mixed according to the monochromatic warm white balance algorithm and natural light
Algorithm and corresponding first weight and the second weight, determine white balance gains.
The direction of the first unit direction vector and the second unit direction vector be all by low colour temperature to high color temperature direction,
According to the parameter that the angle and electronic equipment of the first unit direction vector and the second unit direction vector are set, use is preset
Algorithm determines the angle and the corresponding natural light mixing colour temperature parameter value of the setup parameter.Wherein, preset algorithm can be with
For the angle according to the first unit direction vector and the second unit direction vector, multiplying for the angle and parameter preset is calculated
Product;The cosine value of the product is determined as the natural light and mixes colour temperature parameter value.
Specifically, the angle of the first unit direction vector and the second unit direction vector is α, setup parameter k, according to institute
The angle α of the second unit direction vector and the product of parameter preset k stated the first unit direction vector and pre-saved;By institute
The cosine value for stating product is determined as the natural light mixing colour temperature parameter value, i.e., described natural light mixing colour temperature parameter value is cos
(kα)。
In the present embodiment, monochromatic warm white balance algorithm can be dynamic threshold algorithm, and natural light mixes colour temperature white balance
Algorithm can be gray world algorithm.
After being determined that natural light mixes colour temperature parameter value, can colour temperature parameter value be mixed according to the natural light and determine monochrome
Second weight of the first weight and natural light the mixing colour temperature white balance algorithm of warm white balance algorithm, the natural light is mixed
Color temperature parameters value is as the second weight, and using 1 with the difference of second weight as the first weight, i.e. dynamic threshold algorithm is corresponding
First weight is 1-cos (k α), and corresponding second weight of gray world algorithm is cos (k α).Certainly in determining monochrome Wen Baiping
When accounting method and corresponding first weight of natural light mixing colour temperature white balance algorithm and the second weight, its other party can also be used
Method, if can ensure the second weight and first weight and the second weight and ratio be equal to the natural light secondary colour
Warm parameter value.
After the first weight and the second weight is determined, colour temperature is mixed by monochromatic warm white balance algorithm and natural light and is put down in vain
It accounts method and its corresponding first weight and the second weight calculation goes out the final white balance gains of image to be corrected, algorithm
Shown in equation below:
RGain=(1-cos (k α)) * RGain1+cos (k α) * RGain2;
BGain=(1-cos (k α)) * BGain1+cos (k α) * BGain2;
Wherein, RGain1, BGain1 are the R calculated according to monochromatic warm white balance algorithm, the white balance gains of B,
RGain2, BGain2 are to mix the R that calculates of colour temperature white balance algorithm according to natural light, the white balance gains of B, RGain,
BGain is the final white balance gains of the image to be corrected calculated.
Image is corrected according to the final white balance gains of the image to be corrected calculated, specifically, according to white
To image, corrected process belongs to the prior art to balancing gain, in embodiments of the present invention to the process without repeating.
In embodiments of the present invention, when carrying out white balance correction to image to be corrected, only to the R in image, B component
It is corrected, keeps G components constant, so that the brightness after image progress white balance correction to be corrected is kept not
Become.
Due to according to monochromatic warm white balance algorithm and mixing colour temperature white balance algorithm and its corresponding first weight and second
Weight calculation goes out final white balance gains so as to carry out white balance school to there are the images to be corrected of natural light mixing colour temperature
Timing can mix colour temperature degree according to the natural light of image to be corrected, which is corrected, thereby may be ensured that white
The accuracy of balance correction.
For the white balance correction to image of realization, on the basis of the various embodiments described above, in embodiments of the present invention,
After determining image to be corrected there is no natural light mixing colour temperature, the method further includes:
White balance gains are determined according to monochromatic warm white balance algorithm and described image is corrected.
The monochromatic warm white balance algorithm can be dynamic threshold algorithm, specifically, using dynamic threshold algorithm, determine white
The process of balancing gain belongs to the prior art, and according to white balance gains, to image, corrected process is also the prior art,
To the process without repeating in the embodiment of the present invention.
Embodiment 4:
On the basis of embodiment 1, judge in image with the presence or absence of the standard of natural light mixing colour temperature to further improve
Whether true property, the angle of the second unit direction vector for judging the first unit direction vector and pre-saving are less than the first of setting
Threshold value, wherein, the second unit direction vector is to predefine and protect according to the target image that colour temperature is mixed there are natural light
Before depositing, the method further includes:
The ambient light illumination of image is judged according to the camera of preservation shooting aperture time, gain parameter, aperture, works as ambient light illumination
During more than the second given threshold, continue subsequent step;Or
When the distance between central point for judging the first cluster and the second cluster is more than third given threshold, continue follow-up step
Suddenly;Or
Judge the first cluster abscissa corresponding with the colour temperature that the abscissa of the central point of the second cluster is respectively positioned on natural light
In the range of, and the first cluster ordinate range corresponding with the colour temperature that the ordinate of the central point of the second cluster is respectively positioned on natural light
When interior, continue subsequent step.
In embodiments of the present invention, since the illumination where natural light secondary colour thermal field scape is all bigger, electronic equipment root
The ambient light illumination of image is judged according to camera shooting aperture time, gain parameter, the aperture of preservation, when ambient light illumination is set more than second
When determining threshold value, then it is assumed that image to be corrected there is a possibility that natural light mixing colour temperature is big, at this point, continuing subsequent step, i.e.,
Whether the angle of the second unit direction vector for judging the first unit direction vector and pre-saving is less than the first threshold set.
Since in natural light secondary colour thermal field scape, colour temperature differs greatly, and is divided by the first coordinate points in coordinate system
First cluster and the second cluster, according to the central point of each cluster, if two central points are nearer, it is easy to because in one of them
The minute movement of heart point so that the first unit direction vector changes a lot, therefore is also just likely to be such that the first unit
Direction vector and the angle α of the second unit direction vector pre-saved have greatly changed, and stability is poor.Therefore, exist
Whether the angle of the second unit direction vector for judging the first unit direction vector and pre-saving is less than the first threshold set
Before, judge whether the distance of the central point of two clusters is more than third given threshold, if greater than then judging the first unit side
Whether it is less than the first threshold of setting to vector and the angle of the second unit direction vector pre-saved.
In order to avoid a certain color in image is mistakenly considered a kind of natural light of colour temperature, saved in electronic equipment certainly
The reference color temperature of right light mixes the value of colour temperature evaluation parameter according to a pair of of natural light of determining rectangular area and builds coordinate system
Method determines the corresponding abscissa range of reference color temperature of natural light and ordinate range, if it is determined that the first cluster and second
The abscissa of the central point of cluster is in the range of the corresponding abscissa of colour temperature of natural light, the first cluster and the second cluster
When the ordinate of central point is in the range of the corresponding ordinate of colour temperature of natural light, then it is assumed that image to be corrected exists certainly
The possibility of right light mixing colour temperature is big, at this point, continuing subsequently to judge the first unit direction vector and the second unit pre-saved
The step of whether angle of direction vector is less than the first threshold of setting.
Whether it is less than setting in the angle of the second unit direction vector for judging the first unit direction vector and pre-saving
First threshold before any of the above-described method may be used judged or above two or three kinds of combination can also be used
Judged, using above-mentioned three kinds of methods with reference to as shown in Figure 5 come the process that is judged.
Fig. 5 mixes the deterministic process schematic diagram of colour temperature, the mistake for natural light in a kind of image provided in an embodiment of the present invention
Journey includes the following steps:
S501:For image to be corrected, described image is divided into multiple rectangular areas according to the rule of setting, according to
The red R of each rectangular area, green G, indigo plant B mean values determine a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area
Value.
S502:The value of colour temperature evaluation parameter is mixed in the coordinate system of structure according to a pair of of natural light of each rectangular area
Determine corresponding each first coordinate points in each rectangular area, wherein coordinate system is with the pair of natural light mixing colour temperature evaluation ginseng
Number is as horizontally and vertically.
S503:The first coordinate points in the coordinate system are divided into the first cluster and the second cluster, according to each cluster
Density center, the first unit direction vector is determined, wherein the direction of the first unit direction vector is low colour temperature to high color
Warm direction.
S504:The ambient light illumination of image is judged according to the camera of preservation shooting aperture time, gain parameter, aperture, works as ring
When border illumination is more than the second given threshold, step S505 is carried out, otherwise, carries out step S509.
S505:When the distance between center for judging the first cluster and the second cluster is more than third given threshold, walked
Otherwise rapid S506, carries out step S509.
S506:Judge the first cluster horizontal seat corresponding with the colour temperature that the abscissa of the central point of the second cluster is in natural light
In the range of mark, the first cluster ordinate model corresponding with the colour temperature that the ordinate of the central point of the second cluster is in natural light is judged
When enclosing interior, step S507 is carried out, otherwise, carry out step S509.
S507:Judge whether the first unit direction vector is less than with the angle of the second unit direction vector pre-saved to set
Fixed first threshold, wherein, the second unit direction vector is advance according to the target image that colour temperature is mixed there are natural light
It determines and preserves, if it is, carrying out S508, otherwise, carry out S509.
S508:Determining image to be corrected, there are natural light mixing colour temperatures.
S509:Determining image to be corrected, there is no natural light mixing colour temperatures.
Fig. 6 is the judgment means structure diagram that natural light mixes colour temperature in a kind of image provided in an embodiment of the present invention,
Applied to electronic equipment, which includes:
Described image for being directed to image to be corrected, is divided into more by the first determining module 61 according to the rule of setting
A rectangular area according to the red R of each rectangular area, green G, indigo plant B mean values, determines a pair of of natural light mixing of each rectangular area
The value of colour temperature evaluation parameter;
Second determining module 62, the value for mixing colour temperature evaluation parameter according to a pair of of natural light of each rectangular area exist
Corresponding each first coordinate points in each rectangular area are determined in the coordinate system of structure, wherein coordinate system is with the pair of natural light
Colour temperature evaluation parameter is mixed as horizontally and vertically;
Third determining module 63 is gathered for the first coordinate points in the coordinate system to be divided into the first cluster and second
Class according to the central point of each cluster, determines the first unit direction vector, wherein the direction of the first unit direction vector is
Low colour temperature is to high color temperature direction;
First judgment module 64, for judging the first unit direction vector and the second unit direction vector for pre-saving
Whether angle is less than the first threshold of setting, wherein, the second unit direction vector is to mix colour temperature according to there are natural lights
Target image predefine and preserve;
4th determining module 65 if being yes for being used for the judging result of the first judgment module, determines figure to be corrected
Colour temperature is mixed as there are natural lights, if the judging result of the first judgment module is no, determines that image to be corrected is not present certainly
Right light mixing colour temperature.
First determining module 61 is additionally operable to for the target image of natural light mixing colour temperature acquired in advance, according to
The target image is divided into multiple rectangular areas by the rule of setting, according to R, G, B mean value of each rectangular area, is determined every
The value of a pair of of natural light mixing colour temperature evaluation parameter of a rectangular area;
Second determining module 62 is additionally operable to mix colour temperature evaluation parameter according to a pair of of natural light of each rectangular area
Value determine corresponding each second coordinate points in each rectangular area in the coordinate system of structure, wherein coordinate system with described one
To natural light mixing colour temperature evaluation parameter as horizontally and vertically;
The third determining module 63 is additionally operable to the coordinate in the coordinate system according to each second coordinate points, determines
Second unit direction vector, wherein the direction of the second unit direction vector is low colour temperature to high color temperature direction.
The third determining module 63 specifically for obtaining the coordinate information of two coordinate points input by user, determines institute
State the direction vector of two coordinate points, and using the corresponding unit vector of the direction vector as the second unit direction to
Amount;Or according to least square method, the corresponding linear equation of the second coordinate points in the coordinate system is determined, according to the straight line side
Journey determines the corresponding second unit direction vector of the linear equation;Or the method according to principal component analysis, determine described second
Coordinate points composition point set covariance matrix, according to the feature vector of the covariance matrix determine the second unit direction to
Amount.
Described device further includes:
5th determining module 66, after determining that image to be corrected mixes colour temperature there are natural light, according to natural light
Mixing colour temperature white balance algorithm determines white balance gains and described image is corrected.
5th determining module 66, specifically for according to the first unit direction vector and the second unit direction vector
Angle and setup parameter, using preset algorithm, determine the angle and the corresponding natural light secondary colour of the setup parameter
Warm parameter value;Colour temperature parameter value is mixed according to the natural light and determines that monochromatic warm white balance algorithm and natural light mixing colour temperature are put down in vain
Corresponding first weight of method and the second weight are accounted, colour temperature white balance is mixed according to the monochromatic warm white balance algorithm and natural light
Algorithm and corresponding first weight and the second weight, determine white balance gains.
5th determining module 66, specifically for the natural light is mixed colour temperature parameter value as the second weight, by 1
Difference with second weight is as the first weight.
5th determining module 66, specifically for according to the first unit direction vector and the second list pre-saved
The angle of position direction vector calculates the product of the angle and parameter preset;By the cosine value of the product be determined as it is described from
Right light mixing colour temperature parameter value.
Described device further includes:
5th determining module 66, after determining image to be corrected there is no natural light mixing colour temperature, according to monochrome
Warm white balance algorithm determines white balance gains and described image is corrected.
Described device further includes:
Second judgment module 67 determines image for shooting aperture time, gain parameter, aperture according to the camera of preservation
Ambient light illumination when the ambient light illumination is more than the second given threshold, continues subsequent step;Or judge that the first cluster and second is gathered
When the distance between central point of class is more than third given threshold, continue subsequent step;Or judge the first cluster and the second cluster
The abscissa of central point be respectively positioned in the range of the corresponding abscissa of colour temperature of natural light, and in the first cluster and the second cluster
When the ordinate of heart point is respectively positioned in the range of the corresponding ordinate of colour temperature of natural light, the first judgment module 64 is triggered.
First determining module 61, the G/R values and G/B of each rectangular area specifically for determining each rectangular area
Value;Or, determine the logarithm of G/R of each rectangular area and the logarithm of G/B;Or, determine each square of each rectangular area
The logarithm of the R/G in shape region and the logarithm of B/G.
The embodiment of the present invention provides the judgment method and device of natural light mixing colour temperature in a kind of image, the method packet
It includes:For image to be corrected, described image is divided into multiple rectangular areas according to the rule of setting, according to each rectangle region
The red R in domain, green G, indigo plant B mean values determine the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area;According to each
The value of a pair of of natural light mixing colour temperature evaluation parameter of rectangular area determines that each rectangular area corresponds in the coordinate system of structure
Each first coordinate points, wherein coordinate system using the pair of natural light mix colour temperature evaluation parameter as horizontally and vertically;It will
The first coordinate points in the coordinate system are divided into the first cluster and the second cluster, according to the central point of each cluster, determine the
One unit direction vector, wherein the direction of the first unit direction vector is low colour temperature to high color temperature direction;Judge that first is single
Whether position direction vector and the angle of the second unit direction vector pre-saved are less than the first threshold of setting, wherein, it is described
Second unit direction vector is to predefine and preserve according to the target image that colour temperature is mixed there are natural light;If so, really
Fixed image to be corrected is there are natural light mixing colour temperature, otherwise, it determines there is no natural light mixing colour temperatures for image to be corrected.By
It is to be directed to predefine and preserve there are the target image of natural light mixing colour temperature in the second unit direction vector, therefore,
When first threshold of the angle of the first unit direction vector and the second unit direction vector less than setting, illustrate the figure to be corrected
The target image that picture mixes colour temperature with this there are natural light is similar, and there is also natural lights to mix colour temperature, thereby may be ensured that image
The accuracy that natural light mixing colour temperature judges, and further ensure the accuracy of follow-up white balance correction.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then additional changes and modifications may be made to these embodiments.So appended claims be intended to be construed to include it is excellent
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (18)
1. a kind of judgment method of natural light mixing colour temperature in image, which is characterized in that the method includes:
For image to be corrected, described image is divided into multiple rectangular areas according to the rule of setting, according to each rectangle
The red R in region, green G, indigo plant B mean values determine the value of a pair of of natural light mixing colour temperature evaluation parameter of each rectangular area;
The value that colour temperature evaluation parameter is mixed according to a pair of of natural light of each rectangular area determines each in the coordinate system of structure
Corresponding each first coordinate points in rectangular area, wherein coordinate system mix colour temperature evaluation parameter as horizontal stroke using the pair of natural light
Axis and the longitudinal axis;
The first coordinate points in the coordinate system are divided into the first cluster and the second cluster, according to the central point of each cluster,
The first unit direction vector is determined, wherein the direction of the first unit direction vector is low colour temperature to high color temperature direction;
Whether the angle of the second unit direction vector for judging the first unit direction vector and pre-saving is less than the first of setting
Threshold value, wherein, the second unit direction vector is to predefine and protect according to the target image that colour temperature is mixed there are natural light
It deposits;
If so, image to be corrected is determined there are natural light mixing colour temperature, otherwise, it determines nature is not present in image to be corrected
Light mixes colour temperature;
Determine that the process of the second unit direction vector includes:
For the target image of natural light mixing colour temperature acquired in advance, the target image is divided into according to the rule of setting
Multiple rectangular areas according to R, G, B mean value of each rectangular area, determine a pair of of natural light mixing colour temperature of each rectangular area
The value of evaluation parameter;
The value that colour temperature evaluation parameter is mixed according to a pair of of natural light of each rectangular area determines each in the coordinate system of structure
Corresponding each second coordinate points in rectangular area, wherein coordinate system using the pair of natural light mix colour temperature evaluation parameter as
Horizontally and vertically;
According to coordinate of each second coordinate points in the coordinate system, the second unit direction vector is determined, wherein described second
The direction of unit direction vector is low colour temperature to high color temperature direction.
2. according to the method described in claim 1, it is characterized in that, each second coordinate points of the basis are in the coordinate system
Coordinate, determine that the second unit direction vector includes:
The coordinate information of two coordinate points input by user is obtained, determines the direction vector of described two coordinate points, and by described in
The corresponding unit vector of direction vector is as the second unit direction vector;Or
According to least square method, the corresponding linear equation of the second coordinate points in the coordinate system is determined, according to the linear equation,
Determine the corresponding second unit direction vector of the linear equation;Or
According to the method for principal component analysis, the covariance matrix of the point set of the second coordinate points composition is determined, according to the association
The feature vector of variance matrix determines the second unit direction vector.
3. according to the method described in claim 1, it is characterized in that, it is described determine image to be corrected there are natural light secondary colours
After temperature, the method further includes:
White balance gains are determined according to natural light mixing colour temperature white balance algorithm and described image is corrected.
4. according to the method described in claim 3, it is characterized in that, described determine according to natural light mixing colour temperature white balance algorithm
White balance gains include:
According to the first unit direction vector and the angle and setup parameter of the second unit direction vector, using preset calculation
Method determines the angle and the corresponding natural light mixing colour temperature parameter value of the setup parameter;
Colour temperature parameter value is mixed according to the natural light, determines that monochromatic warm white balance algorithm and natural light mixing colour temperature white balance are calculated
Corresponding first weight of method and the second weight mix colour temperature white balance algorithm according to the monochromatic warm white balance algorithm and natural light
And corresponding first weight and the second weight, determine white balance gains.
5. according to the method described in claim 4, it is characterized in that, described mix colour temperature parameter value according to the natural light, really
Order colour temperature white balance algorithm and corresponding first weight of natural light mixing colour temperature white balance algorithm and the second weight include:
The natural light is mixed into colour temperature parameter value as the second weight, using 1 with the difference of second weight as the first weight.
It is 6. according to the method described in claim 4, it is characterized in that, described according to the first unit direction vector and advance guarantor
The angle and setup parameter of the second unit direction vector deposited using preset algorithm, determine the angle and the setting ginseng
The corresponding natural light mixing colour temperature parameter value of number includes:
According to the first unit direction vector and the angle of the second unit direction vector that pre-saves, calculate the angle with
The product of parameter preset;The cosine value of the product is determined as the natural light and mixes colour temperature parameter value.
7. according to the method described in claim 1, it is characterized in that, it is described determine image to be corrected there is no natural light mixing
After colour temperature, the method further includes:
White balance gains are determined according to monochromatic warm white balance algorithm and described image is corrected.
8. according to the method described in claim 1, it is characterized in that, described judge the first unit direction vector and pre-save
Whether the angle of the second unit direction vector is less than before the first threshold of setting, and the method further includes:
The ambient light illumination of image is determined according to the camera of preservation shooting aperture time, gain parameter, aperture, when the ambient light illumination
During more than the second given threshold, continue subsequent step;Or
When the distance between central point for judging the first cluster and the second cluster is more than third given threshold, continue subsequent step;
Or
Judge the first cluster abscissa range corresponding with the colour temperature that the abscissa of the central point of the second cluster is respectively positioned on natural light
It is interior, and in the range of the first cluster ordinate corresponding with the colour temperature that the ordinate of the central point of the second cluster is respectively positioned on natural light
When, continue subsequent step.
9. according to the method described in claim 1, it is characterized in that, a pair of of natural light mixing colour temperature of each rectangular area
The value of evaluation parameter includes:
Each G/R values of rectangular area and G/B values;Or
Each logarithm of G/R of rectangular area and the logarithm of G/B;Or
Each logarithm of R/G of rectangular area and the logarithm of B/G.
10. the judgment means of natural light mixing colour temperature in a kind of image, which is characterized in that described device includes:
For being directed to image to be corrected, multiple rectangles are divided into according to the rule of setting by the first determining module for described image
Region according to the red R of each rectangular area, green G, indigo plant B mean values, determines that a pair of of natural light mixing colour temperature of each rectangular area is commented
The value of valency parameter;
Second determining module, for mixing the value of colour temperature evaluation parameter according to a pair of of natural light of each rectangular area in structure
Corresponding each first coordinate points in each rectangular area are determined in coordinate system, wherein coordinate system is with the pair of natural light secondary colour
Warm evaluation parameter is as horizontally and vertically;
Third determining module, for the first coordinate points in the coordinate system to be divided into the first cluster and the second cluster, according to
The central point each clustered determines the first unit direction vector, wherein the direction of the first unit direction vector is low colour temperature
To high color temperature direction;
First judgment module, for judging that the first unit direction vector is with the angle of the second unit direction vector pre-saved
The no first threshold for being less than setting, wherein, the second unit direction vector is according to there are the targets that natural light mixes colour temperature
What image was predefined and was preserved;
4th determining module if the judging result for the first judgment module is yes, determines that there are natures for image to be corrected
Light mixes colour temperature, if the judging result of the first judgment module is no, determines that natural light secondary colour is not present in image to be corrected
Temperature;
First determining module is additionally operable to for the target image of natural light mixing colour temperature acquired in advance, according to setting
The target image is divided into multiple rectangular areas by rule, according to R, G, B mean value of each rectangular area, determines each rectangle
The value of a pair of of natural light mixing colour temperature evaluation parameter in region;
Second determining module, the value for being additionally operable to mix colour temperature evaluation parameter according to a pair of of natural light of each rectangular area exist
Determine corresponding each second coordinate points in each rectangular area in the coordinate system of structure, wherein coordinate system with the pair of nature
Light mixing colour temperature evaluation parameter is as horizontally and vertically;
The third determining module is additionally operable to the coordinate in the coordinate system according to each second coordinate points, determines that second is single
Position direction vector, wherein the direction of the second unit direction vector is low colour temperature to high color temperature direction.
11. device according to claim 10, which is characterized in that the third determining module, specifically for obtaining user
The coordinate information of two coordinate points of input, determines the direction vector of described two coordinate points, and the direction vector is corresponded to
Unit vector as the second unit direction vector;Or, according to least square method, determine the second coordinate in the coordinate system
The corresponding linear equation of point, according to the linear equation, determines the corresponding second unit direction vector of the linear equation;Or,
According to the method for principal component analysis, the covariance matrix of the point set of the second coordinate points composition is determined, according to the covariance
The feature vector of matrix determines the second unit direction vector.
12. device according to claim 10, which is characterized in that described device further includes:
5th determining module, after determining that image to be corrected mixes colour temperature there are natural light, according to natural light secondary colour
Warm white balance algorithm determines white balance gains and described image is corrected.
13. device according to claim 12, which is characterized in that the 5th determining module, specifically for according to
The angle and setup parameter of first unit direction vector and the second unit direction vector using preset algorithm, determine the folder
Angle and the corresponding natural light mixing colour temperature parameter value of the setup parameter;Colour temperature parameter value is mixed according to the natural light and determines list
Colour temperature white balance algorithm and corresponding first weight of natural light mixing colour temperature white balance algorithm and the second weight, according to the monochrome
Warm white balance algorithm and natural light mixing colour temperature white balance algorithm and corresponding first weight and the second weight, determine that white balance increases
Benefit.
14. device according to claim 13, which is characterized in that the 5th determining module, it is described certainly specifically for general
Right light mixing colour temperature parameter value is as the second weight, using 1 with the difference of second weight as the first weight.
15. device according to claim 13, which is characterized in that the 5th determining module, specifically for according to
First unit direction vector and the angle of the second unit direction vector pre-saved calculate multiplying for the angle and parameter preset
Product;The cosine value of the product is determined as the natural light and mixes colour temperature parameter value.
16. device according to claim 10, which is characterized in that described device further includes:
5th determining module, after determining image to be corrected there is no natural light mixing colour temperature, according to monochromatic Wen Baiping
The method of accounting determines white balance gains and described image is corrected.
17. device according to claim 10, which is characterized in that described device further includes:
Second judgment module determines that the environment of image shines for shooting aperture time, gain parameter, aperture according to the camera of preservation
Degree when the ambient light illumination is more than the second given threshold, continues subsequent step;Or judge in the first cluster and the second cluster
When the distance between heart point is more than third given threshold, continue subsequent step;Or judge the center of the first cluster and the second cluster
The abscissa of point is respectively positioned in the range of the corresponding abscissa of colour temperature of natural light, and the central point of the first cluster and the second cluster
When ordinate is respectively positioned in the range of the corresponding ordinate of colour temperature of natural light, the first judgment module is triggered.
18. device according to claim 10, which is characterized in that first determining module, it is each specifically for determining
The G/R values of each rectangular area of rectangular area and G/B values;Or, determine the logarithm and G/B of the G/R of each rectangular area
Logarithm;Or, determine the logarithm of R/G of each rectangular area of each rectangular area and the logarithm of B/G.
Priority Applications (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611117128.1A CN106791758B (en) | 2016-12-07 | 2016-12-07 | The judgment method and device of natural light mixing colour temperature in a kind of image |
PCT/CN2017/081617 WO2017186071A1 (en) | 2016-04-25 | 2017-04-24 | Methods, systems, and media for image white balance adjustment |
EP17788723.9A EP3449628B1 (en) | 2016-04-25 | 2017-04-24 | Methods, systems, and media for image white balance adjustment |
US16/095,979 US10805588B2 (en) | 2016-04-25 | 2017-04-24 | Methods, systems, and media for image white balance adjustment |
US17/067,700 US11363244B2 (en) | 2016-04-25 | 2020-10-11 | Methods, systems, and media for image white balance adjustment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611117128.1A CN106791758B (en) | 2016-12-07 | 2016-12-07 | The judgment method and device of natural light mixing colour temperature in a kind of image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106791758A CN106791758A (en) | 2017-05-31 |
CN106791758B true CN106791758B (en) | 2018-07-06 |
Family
ID=58877054
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611117128.1A Active CN106791758B (en) | 2016-04-25 | 2016-12-07 | The judgment method and device of natural light mixing colour temperature in a kind of image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106791758B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063891B (en) * | 2017-12-07 | 2020-04-24 | Oppo广东移动通信有限公司 | Image processing method, image processing device, computer-readable storage medium and computer equipment |
CN108063934B (en) * | 2017-12-25 | 2020-01-10 | Oppo广东移动通信有限公司 | Image processing method and device, computer readable storage medium and computer device |
WO2020000262A1 (en) * | 2018-06-27 | 2020-01-02 | 华为技术有限公司 | Light source estimating method, image processing method and related products |
CN109361910B (en) * | 2018-10-23 | 2020-09-01 | 浙江宇视科技有限公司 | Self-adaptive white balance correction method and device |
CN109600606B (en) * | 2018-11-30 | 2019-12-27 | 深圳市华星光电半导体显示技术有限公司 | Method for identifying single tone image |
CN109685348A (en) * | 2018-12-14 | 2019-04-26 | 广东电网有限责任公司 | A kind of power equipment typical mode of operation determines method |
CN113068016B (en) * | 2021-04-02 | 2023-03-24 | 杭州涂鸦信息技术有限公司 | White balance correction method and device and computer equipment |
TWI759188B (en) * | 2021-04-27 | 2022-03-21 | 凌巨科技股份有限公司 | Image processing device and method for adjusting white balance |
CN114745532B (en) * | 2022-04-01 | 2024-04-09 | 北京紫光展锐通信技术有限公司 | Mixed color temperature scene white balance processing method and device, storage medium and terminal |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101193317A (en) * | 2006-11-30 | 2008-06-04 | 北京思比科微电子技术有限公司 | Method and device for automatic white balance processing of the image |
CN101911715A (en) * | 2008-02-13 | 2010-12-08 | 高通股份有限公司 | The white balance calibration that is used for digital camera device |
CN103929632A (en) * | 2014-04-15 | 2014-07-16 | 浙江宇视科技有限公司 | Automatic white balance correcting method and device |
CN104144333A (en) * | 2013-05-08 | 2014-11-12 | 全视科技有限公司 | Automatic white balance based on dynamic mapping |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4740602B2 (en) * | 2005-01-19 | 2011-08-03 | イーストマン コダック カンパニー | Auto white balance device and white balance adjustment method |
US8064110B2 (en) * | 2005-12-08 | 2011-11-22 | Qualcomm Incorporated | Adaptive auto white balance |
JP5744431B2 (en) * | 2010-07-16 | 2015-07-08 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
-
2016
- 2016-12-07 CN CN201611117128.1A patent/CN106791758B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101193317A (en) * | 2006-11-30 | 2008-06-04 | 北京思比科微电子技术有限公司 | Method and device for automatic white balance processing of the image |
CN101911715A (en) * | 2008-02-13 | 2010-12-08 | 高通股份有限公司 | The white balance calibration that is used for digital camera device |
CN104144333A (en) * | 2013-05-08 | 2014-11-12 | 全视科技有限公司 | Automatic white balance based on dynamic mapping |
CN103929632A (en) * | 2014-04-15 | 2014-07-16 | 浙江宇视科技有限公司 | Automatic white balance correcting method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106791758A (en) | 2017-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106791758B (en) | The judgment method and device of natural light mixing colour temperature in a kind of image | |
CN105338262B (en) | A kind of graphic images processing method and processing device | |
WO2020038124A1 (en) | Image contrast enhancement method and apparatus, and device and storage medium | |
EP3188481B1 (en) | Automatic white balance | |
WO2020248564A1 (en) | Systems and methods for automatic exposure control | |
CN103778900B (en) | A kind of image processing method and system | |
CN107343190A (en) | White balance adjusting method, apparatus and terminal device | |
CN106686319A (en) | Control method and device of image exposure | |
CN109361910A (en) | Self-adapted white balance correction method and device | |
CN108259877B (en) | A kind of white balancing treatment method and device | |
CN108322666B (en) | Method and device for regulating and controlling camera shutter, computer equipment and storage medium | |
CN109996054B (en) | White balance adjusting method and device | |
CN105847703A (en) | Image processing method and electronic device | |
CN105959662A (en) | Self-adaptive white balance adjusting method and device | |
US7706676B2 (en) | Automatic exposure control method | |
CN110830778A (en) | Imaging device color correction method, imaging device color correction device, electronic device and storage medium | |
CN101917633A (en) | Image white balance processing method, device and camera thereof | |
CN108024105A (en) | Image color adjusting method, device, electronic equipment and storage medium | |
CN104618645A (en) | Method and device for shooting through two cameras | |
CN107644607A (en) | The color temperature adjusting method and display device of display panel | |
CN104702941A (en) | White-dot area indicating and judging method | |
CN102426828A (en) | Screen edge color adjusting method and device | |
CN111105365A (en) | Color correction method, medium, terminal and device for texture image | |
JP2015158626A5 (en) | ||
CN110175967B (en) | Image defogging processing method, system, computer device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |