CN106357988B - White balance adjusting method and device and terminal equipment - Google Patents

White balance adjusting method and device and terminal equipment Download PDF

Info

Publication number
CN106357988B
CN106357988B CN201610987692.2A CN201610987692A CN106357988B CN 106357988 B CN106357988 B CN 106357988B CN 201610987692 A CN201610987692 A CN 201610987692A CN 106357988 B CN106357988 B CN 106357988B
Authority
CN
China
Prior art keywords
color
skin
light source
white balance
frame image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201610987692.2A
Other languages
Chinese (zh)
Other versions
CN106357988A (en
Inventor
曾元清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610987692.2A priority Critical patent/CN106357988B/en
Publication of CN106357988A publication Critical patent/CN106357988A/en
Application granted granted Critical
Publication of CN106357988B publication Critical patent/CN106357988B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation

Landscapes

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

Abstract

The invention discloses a white balance adjustment method, a white balance adjustment device and terminal equipment, wherein colors of skin presented under different light sources are measured in advance to obtain a mapping relation between the light source colors and the colors of the skin presented under the light sources, so that when a frame image is subjected to white balance adjustment, the mapping relation between the light source colors and the colors of the skin presented under the light sources is inquired through a first color presented under a target light source in the skin area of the face area of the frame image, a second color of the target light source corresponding to the first color is obtained, and the frame image is subjected to white balance adjustment according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.

Description

White balance adjusting method and device and terminal equipment
Technical Field
The present invention relates to the field of shooting technologies, and in particular, to a method and an apparatus for adjusting white balance, and a terminal device.
Background
White balance is a very important concept in the field of photographic imaging, by which a series of problems of color reduction and tone processing can be solved, and is one of important indexes for evaluating color. White balance is a very abstract concept, and the process of adjusting white balance is called white balance adjustment.
In the prior art, an Automatic White Balance (AWB) adjustment method is generally adopted when performing white balance adjustment. The adjustment method for the main stream is to implement white balance adjustment based on statistical information of the whole frame of picture, but this method is more easily affected by most pictures, for example, when there is a large area of color mixing, the human face in the whole frame of picture is easily affected by the color mixing, and the problem of recognizable color cast occurs, resulting in poor imaging effect.
Disclosure of Invention
The object of the present invention is to solve at least to some extent one of the above mentioned technical problems.
Therefore, a first objective of the present invention is to provide a white balance adjustment method, which predicts a light source environment of a whole frame of picture through a face portion of the whole frame of picture, so as to perform white balance adjustment on the whole frame of picture according to the predicted light source environment, thereby solving a problem of recognizable color cast caused by implementing white balance adjustment based on statistical information of the whole frame of picture in the prior art.
A second object of the present invention is to provide a white balance adjustment device.
A third object of the present invention is to provide a terminal device.
A fourth object of the invention is to propose another terminal device.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a white balance adjustment method, including the following steps:
measuring colors of the skin under different light sources to obtain a mapping relation between the colors of the light sources and the colors of the skin under the light sources;
carrying out color statistics on a face region of a frame image to obtain a first color of skin in the face region under a target light source;
according to the first color, inquiring the mapping relation between the light source color and the color of the skin under the light source to obtain a second color of the target light source corresponding to the first color;
and carrying out white balance adjustment on the frame image according to the second color.
The white balance adjustment method of the embodiment of the invention measures the colors of the skin under different light sources in advance to obtain the mapping relation between the light source colors and the colors of the skin under the light sources, so that when the white balance adjustment is carried out on the frame image, the mapping relation between the light source colors and the colors of the skin under the light sources is inquired through the first color of the skin under the target light sources in the face area of the frame image to obtain the second color of the target light sources corresponding to the first color, and the white balance adjustment is carried out on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In addition, the white balance adjustment method of the embodiment of the invention also has the following additional technical characteristics:
in an embodiment of the present invention, the performing color statistics on a face region of a frame image to obtain a first color of skin in the face region under a target light source includes:
measuring the color of each pixel point in the face region;
and counting the colors of all the pixel points in the face region to obtain the first color which is most matched with the colors of all the pixel points.
In an embodiment of the present invention, the counting the colors of the pixels in the face region to obtain the first color that is most matched with the color of each pixel includes:
and in a color space, counting the colors of all pixel points in the face region to obtain a first color with the minimum sum of the space distances between the first color and the colors of all the pixel points.
In one embodiment of the present invention, the white balance adjustment of the frame image according to the second color includes:
if the reliability of the AWB coefficient of the non-face area of the frame image is lower than a preset threshold value, performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color;
and if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than a preset threshold value, performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color and the weighted value of the AWB coefficient of the non-face area.
In an embodiment of the present invention, after performing color statistics on a face region of a frame image to obtain a first color of skin in the face region under a target light source, the method further includes:
in the color space, counting the colors of the skin under different light sources to obtain a skin color range;
and correcting the first color according to the skin color range.
In an embodiment of the present invention, the correcting the first color according to the skin color range includes:
and correcting the first color to be the color closest to the first color within the skin color range.
In order to achieve the above object, a second embodiment of the present invention provides a white balance adjustment apparatus, including:
the measuring module is used for measuring the colors of the skin under different light sources so as to obtain the mapping relation between the light source colors and the colors of the skin under the light sources;
the statistical module is used for carrying out color statistics on a face region of a frame image so as to obtain a first color of skin in the face region under a target light source;
the query module is used for querying the mapping relation between the light source color and the color of the skin under the light source according to the first color to obtain a second color of the target light source corresponding to the first color;
and the adjusting module is used for carrying out white balance adjustment on the frame image according to the second color.
The white balance adjusting device of the embodiment of the invention measures the colors of the skin under different light sources in advance through the measuring module to obtain the mapping relation between the light source colors and the colors of the skin under the light sources, so that when the white balance of the frame image is adjusted, the query module queries the mapping relation between the light source colors and the colors of the skin under the light sources to obtain the second colors of the target light sources corresponding to the first colors, and the adjusting module performs the white balance adjustment on the frame image according to the second colors. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In addition, the white balance adjustment device according to the embodiment of the present invention has the following additional technical features:
in an embodiment of the present invention, the statistical module includes:
the measuring unit is used for measuring the color of each pixel point in the face area;
and the statistical unit is used for performing statistics on the color of each pixel point in the face region to obtain the first color which is most matched with the color of each pixel point.
In an embodiment of the present invention, the statistical unit is specifically configured to perform statistics on colors of each pixel point in the face region in a color space, so as to obtain a first color with a smallest sum of spatial distances between the first color and the colors of each pixel point.
In an embodiment of the present invention, the adjusting module includes:
the first adjusting unit is used for performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color if the reliability of the AWB coefficient of the non-face area of the frame image is lower than a preset threshold value;
and the second adjusting unit is used for performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color and the weighted value of the AWB coefficient of the non-face area if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than a preset threshold value.
In an embodiment of the present invention, the apparatus further includes:
the correction module is used for counting colors of the skin under different light sources in the color space to obtain a skin color range; and correcting the first color according to the skin color range.
In an embodiment of the present invention, the correction module is specifically configured to count colors of skin under different light sources in a color space to obtain a skin color range; and correcting the first color to be the color closest to the first color within the skin color range.
In order to achieve the above object, an embodiment of a third aspect of the present invention provides a terminal device, including: the white balance adjustment device according to the embodiment of the second aspect of the present invention.
The terminal device of the embodiment of the invention measures the colors of the skin under different light sources in advance to obtain the mapping relation between the light source color and the color of the skin under the light source, so that when the white balance adjustment is carried out on the frame image, the mapping relation between the light source color and the color of the skin under the light source is inquired through the first color of the skin under the target light source in the face area of the frame image to obtain the second color of the target light source corresponding to the first color, and the white balance adjustment is carried out on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In order to achieve the above object, a fourth aspect of the present invention provides another terminal device, including one or more of the following components: the device comprises a shell, a processor and a memory, wherein the processor and the memory are positioned in the shell, the processor executes a program corresponding to executable program codes by reading the executable program codes stored in the memory, and the processor is used for executing the following steps:
measuring colors of the skin under different light sources to obtain a mapping relation between the colors of the light sources and the colors of the skin under the light sources;
carrying out color statistics on a face region of a frame image to obtain a first color of skin in the face region under a target light source;
according to the first color, inquiring the mapping relation between the light source color and the color of the skin under the light source to obtain a second color of the target light source corresponding to the first color;
and carrying out white balance adjustment on the frame image according to the second color.
The terminal device of the embodiment of the invention measures the colors of the skin under different light sources in advance to obtain the mapping relation between the light source color and the color of the skin under the light source, so that when the white balance adjustment is carried out on the frame image, the mapping relation between the light source color and the color of the skin under the light source is inquired through the first color of the skin under the target light source in the face area of the frame image to obtain the second color of the target light source corresponding to the first color, and the white balance adjustment is carried out on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a white balance adjustment method according to an embodiment of the present invention;
fig. 2 is a flowchart of a white balance adjustment method according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating a mapping relationship between colors of a light source and colors of skin under the light source;
FIG. 4 is a schematic diagram of a frame image;
fig. 5 is a schematic structural diagram of a white balance adjustment apparatus 50 according to an embodiment of the present invention;
fig. 6 is a schematic structural view of a white balance adjustment apparatus 50 according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention; and
fig. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The white balance adjustment method, apparatus, and terminal device of the embodiments of the present invention are described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a white balance adjustment method according to an embodiment of the present invention, as shown in fig. 1, the method including:
step 101, measuring the colors of the skin under different light sources to obtain a mapping relation between the light source colors and the colors of the skin under the light sources.
The skin may appear differently under different light sources, for example, under a low color temperature light source, the skin may appear reddish, and under a high color temperature light source, the skin may appear differently from red, that is, the color of the skin under the light source may be in some relation with the light source, and this relation may be used to determine the color of the currently used illumination light source according to the color of the skin under the light source.
Step 102, performing color statistics on a face region of the frame image to obtain a first color of skin in the face region under a target light source.
Optionally, since the face region is composed of thousands of pixels, the color of each pixel in the face region may be counted in the color space to obtain a first color with the smallest sum of spatial distances between the color of each pixel, that is, a color closest to the color of each pixel, as the first color presented by the skin in the face region under the target light source.
Certainly, in the process of determining the first color presented by the skin in the face region under the target light source according to the color of each pixel point in the face region, in this embodiment, only an algorithm of the sum of the spatial distances is listed, but in practical applications, there are other implementation forms, and corresponding algorithms that can be suggested by those skilled in the art according to the examples in this embodiment are all within the scope disclosed in this embodiment.
Step 103, according to the first color, inquiring the mapping relationship between the light source color and the color of the skin presented under the light source to obtain a second color of the target light source corresponding to the first color.
Specifically, the mapping relationship between the color of the light source and the color of the skin under the light source is measured in step 101, and a second color corresponding to the first color can be determined according to the mapping relationship, where the second color is the color of the target light source irradiating the skin.
And 104, performing white balance adjustment on the frame image according to the second color.
Specifically, if the reliability of the AWB coefficient of the non-face area of the frame image is lower than the preset threshold, that is, if the reliability is lower, the AWB color temperature curve may be queried by using a second color to determine the AWB coefficient, and the AWB coefficient performs the white balance adjustment on the frame image. However, if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than the preset threshold, that is, under the condition of higher reliability, the AWB color temperature curve can be queried by using the second color to determine the AWB coefficient, and then the frame image is subjected to white balance adjustment with the weighted value of the AWB coefficient of the non-face area.
In this embodiment, the color of the skin under different light sources is measured in advance to obtain the mapping relationship between the color of the light source and the color of the skin under the light source, so that when the white balance adjustment is performed on the frame image, the mapping relationship between the color of the light source and the color of the skin under the light source is queried through the first color of the skin in the face region of the frame image under the target light source to obtain the second color of the target light source corresponding to the first color, and the white balance adjustment is performed on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In order to more fully describe the white balance adjustment method according to the embodiment of the present invention, the white balance adjustment method will be described in detail below:
fig. 2 is a flowchart of a white balance adjustment method according to another embodiment of the present invention, as shown in fig. 2, the method including:
step 201, measuring the mapping relation between the light source color and the skin color presented under the light source.
Specifically, the color presented by the color card under the irradiation of each light source is measured on the color card of the skin color. For ease of understanding, the illuminant color may be referred to as a illuminant reference point (light _ source _ normal), and the color where the skin tone is presented under the illuminant may be referred to as a skin tone illuminant reference point (light _ source _ skin).
As a possible implementation, such a mapping may be presented in a color space, for example: FIG. 3 is a diagram illustrating a mapping relationship between colors of a light source and colors of skin under the light source.
As shown in fig. 3, the abscissa is R/G, and the ordinate is B/G, it can be clearly seen in fig. 3 that there is an obvious characteristic deformation between the distribution of the skin color light source reference point and the distribution of the light source reference point, that is, there is a greater correlation between the two, and accordingly, a mapping relationship between the light source color and the skin color presented under the light source can be established.
The RGB color scheme is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing the three color channels on each other, and RGB is a color representing three channels of red, green, and blue.
It should be noted that D75, D65, D50, CW, TL84, a and H in fig. 3 are all labels of light sources, and different light sources have certain differences in color, which can be referred to the related description of the standard light source specifically, and the description thereof is not repeated in this embodiment.
Step 202, performing face recognition on the frame image by adopting a face recognition technology to obtain a face region.
The face region is described according to the position center point, the width and the height of the region.
Step 203, according to the color of each pixel point in the face region, a first color which is most matched with the color of each pixel point is obtained through statistics.
As a possible application scenario, fig. 4 is a schematic diagram of a frame image, as shown in fig. 4, a region outlined by a large box is a face region, and a small box is each pixel or a region of each statistical unit, where the statistical unit may include a plurality of pixels.
The color of each statistical unit may be determined according to the color of each pixel point in the statistical unit, for example: the color closest to the color of most of the pixels.
In the color space, the color of each pixel point or statistical unit in the face area is counted to obtain a first color with the minimum sum of the spatial distances between the first color and the color of each pixel point or statistical unit.
Step 204, the first color is corrected according to the skin color range.
The skin color range is obtained by counting the colors of the skin under different light sources in a color space.
Specifically, the color coordinates of the first color measured in the color space are r/g _ skin and b/g _ skin, and if the r/g _ skin and the b/g _ skin exceed the skin color range, the colors r/g _ skin and b/g _ skin which are closest to the r/g _ skin and the b/g _ skin are inquired in the skin color range.
Through the correction of the step, the color distortion of the whole frame picture caused by the deviation on the skin color identification can be avoided. Based on the skin color range, the first color is checked before the white balance adjustment to determine whether there is a deviation in the skin color identification.
Step 205, according to the corrected first color, inquiring the mapping relationship between the light source color and the color of the skin under the light source to obtain a second color corresponding to the corrected first color.
Wherein, the second color is the color of the target light source irradiating the human face skin.
Specifically, according to the mapping relationship between the light source reference point (light _ source _ normal) and the skin color light source reference point (light _ source _ skin), the color coordinate values r/g _ skin and b/g _ skin of the first color obtained by skin color statistics and correction are obtained, and the corresponding color coordinate values r/g _ from _ skin and b/g _ from _ skin can be obtained through the mapping relationship. Here, r/g _ from _ skin and b/g _ from _ skin are the color coordinate values of the target light source.
In the process, the mapping from the skin color under the illumination of the light source to the actual light source color is mainly realized through the mapping relation between the light source color and the color presented by the skin under the light source, namely the mapping relation between the skin color light source reference point and the light source reference point.
And step 206, performing white balance adjustment on the frame image according to the second color.
Specifically, if the reliability of the AWB coefficient of the non-face area of the frame image is lower than the preset threshold, that is, if the reliability is lower, the AWB color temperature curve may be queried by using a second color to determine the AWB coefficient, and the AWB coefficient performs the white balance adjustment on the frame image. However, if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than the preset threshold, that is, under the condition of higher reliability, the AWB color temperature curve can be queried by using the second color to determine the AWB coefficient, and then the frame image is subjected to white balance adjustment with the weighted value of the AWB coefficient of the non-face area.
In this embodiment, the color of the skin under different light sources is measured in advance to obtain the mapping relationship between the color of the light source and the color of the skin under the light source, so that when the white balance adjustment is performed on the frame image, the mapping relationship between the color of the light source and the color of the skin under the light source is queried through the first color of the skin in the face region of the frame image under the target light source to obtain the second color of the target light source corresponding to the first color, and the white balance adjustment is performed on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In order to implement the above embodiment, the present invention further provides a white balance adjustment apparatus 50, fig. 5 is a schematic structural diagram of the white balance adjustment apparatus 50 according to an embodiment of the present invention, and as shown in fig. 5, the white balance adjustment apparatus 50 includes a measurement module 51, a statistics module 52, a query module 53, and an adjustment module 54.
The measuring module 51 is configured to measure colors of the skin under different light sources to obtain a mapping relationship between the light source colors and the colors of the skin under the light sources.
The counting module 52 is configured to perform color counting on a face region of the frame image to obtain a first color presented by skin in the face region under the target light source.
And the query module 53 is configured to query, according to the first color, a mapping relationship between the light source color and a color of skin appearing under the light source, so as to obtain a second color of the target light source corresponding to the first color.
And an adjusting module 54, configured to perform white balance adjustment on the frame image according to the second color.
It should be noted that the foregoing description of the embodiment of the white balance adjustment method is also applicable to the white balance adjustment apparatus according to the embodiment of the present invention, and the implementation principle thereof is similar, and is not repeated herein.
In summary, in the white balance adjustment apparatus according to the embodiment of the present invention, the measurement module measures the color of the skin under different light sources in advance to obtain the mapping relationship between the color of the light source and the color of the skin under the light source, so that when performing white balance adjustment on the frame image, the query module queries the mapping relationship between the color of the light source and the color of the skin under the light source to obtain the second color of the target light source corresponding to the first color, and the adjustment module performs white balance adjustment on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
Further, fig. 6 is a schematic structural diagram of a white balance adjustment device 50 according to another embodiment of the present invention, and as shown in fig. 6, the white balance adjustment device 50 may further include, in addition to fig. 5: and a correction module 61.
The correction module 61 is used for counting colors of the skin under different light sources in the color space to obtain a skin color range; and correcting the first color according to the skin color range.
Specifically, the correction module 61 is specifically configured to count colors of the skin under different light sources in a color space to obtain a skin color range; and correcting the first color to be the color closest to the first color within the skin color range.
As a possible implementation, the adjusting module 54 includes: a first adjusting unit 541 and a second adjusting unit 542.
A first adjusting unit 541, configured to, if the reliability of the AWB coefficient of the non-face area of the frame image is lower than a preset threshold, perform a white balance adjustment on the frame image by using the AWB coefficient determined by the second color.
And a second adjusting unit 542, configured to, if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than the preset threshold, perform white balance adjustment on the frame image by using the AWB coefficient determined by the second color and the weighted value of the AWB coefficient of the non-face area.
Further, the statistic module 52 includes: a measurement unit 521 and a statistics unit 522.
The measuring unit 521 is configured to measure a color of each pixel point in the face region.
The counting unit 522 is configured to count colors of the pixels in the face region to obtain the first color most matched with the color of each pixel.
Specifically, the counting unit 522 is specifically configured to count colors of each pixel point in the face region in a color space, so as to obtain a first color with a smallest sum of spatial distances between the first color and the colors of each pixel point.
It should be noted that the foregoing description of the embodiment of the white balance adjustment method is also applicable to the white balance adjustment apparatus according to the embodiment of the present invention, and the implementation principle thereof is similar, and is not repeated herein.
In summary, in the white balance adjustment apparatus according to the embodiment of the present invention, the measurement module measures the color of the skin under different light sources in advance to obtain the mapping relationship between the color of the light source and the color of the skin under the light source, so that when performing white balance adjustment on the frame image, the query module queries the mapping relationship between the color of the light source and the color of the skin under the light source to obtain the second color of the target light source corresponding to the first color, and the adjustment module performs white balance adjustment on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In order to implement the above embodiment, the present invention further provides a terminal device, and fig. 7 is a schematic structural diagram of the terminal device according to an embodiment of the present invention, as shown in fig. 7, the terminal device includes a white balance adjustment apparatus 50.
It should be noted that the foregoing description of the embodiment of the white balance adjustment apparatus is also applicable to the white balance adjustment apparatus 50 according to the embodiment of the present invention, and the implementation principle thereof is similar, and is not repeated herein.
In summary, in the terminal device according to the embodiment of the present invention, the colors of the skin under different light sources are measured in advance to obtain the mapping relationship between the light source color and the color of the skin under the light source, so that when performing white balance adjustment on the frame image, the mapping relationship between the light source color and the color of the skin under the light source is queried through the first color of the skin under the target light source in the face region of the frame image, so as to obtain the second color of the target light source corresponding to the first color, and perform white balance adjustment on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In order to implement the foregoing embodiment, the present invention further provides another terminal device, fig. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present invention, and as shown in fig. 8, the terminal device 1000 includes: a housing 1100, and a memory 1111 and a processor 1112 located within the housing 1100.
Wherein the processor 1111 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 1112, for performing the steps of:
measuring colors of the skin under different light sources to obtain a mapping relation between the colors of the light sources and the colors of the skin under the light sources;
carrying out color statistics on a face region of a frame image to obtain a first color of skin in the face region under a target light source;
according to the first color, inquiring the mapping relation between the light source color and the color of the skin under the light source to obtain a second color of the target light source corresponding to the first color;
and carrying out white balance adjustment on the frame image according to the second color.
It should be noted that the foregoing description of the embodiment of the white balance adjustment processing method is also applicable to the terminal device 1000 according to the embodiment of the present invention, and the implementation principle is similar, and is not described herein again.
In summary, in the terminal device according to the embodiment of the present invention, the colors of the skin under different light sources are measured in advance to obtain the mapping relationship between the light source color and the color of the skin under the light source, so that when performing white balance adjustment on the frame image, the mapping relationship between the light source color and the color of the skin under the light source is queried through the first color of the skin under the target light source in the face region of the frame image, so as to obtain the second color of the target light source corresponding to the first color, and perform white balance adjustment on the frame image according to the second color. Because the skin color of the human face is relatively stable, the light source color can be obtained, so that the white balance adjustment is carried out on the frame image, the color cast problem under the condition of large-area color mixing is avoided, and the technical problem of poor imaging effect in the prior art is solved.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (6)

1. A white balance adjustment method is characterized by comprising the following steps:
measuring colors of the skin under different light sources to obtain a mapping relation between the colors of the light sources and the colors of the skin under the light sources;
measuring the color of each pixel point in a face region of a frame image, and counting the colors of the pixel points in the face region to obtain a color with the minimum sum of spatial distances between the color and the pixel points as a first color presented by skin in the face region under a target light source, so that the first color is closest to the color of each pixel;
counting colors of skin under different light sources in a color space to obtain a skin color range, determining color coordinates of the first color in the color space, inquiring the color closest to the color coordinates of the first color in the skin color range if the color coordinates of the first color exceed the skin color range, and correcting the first color into the color closest to the first color;
according to the first color, inquiring the mapping relation between the light source color and the color of the skin presented under the light source to obtain a second color of the target light source corresponding to the first color, wherein the second color comprises the color of the target light source irradiating the skin;
and carrying out white balance adjustment on the frame image according to the second color.
2. The method of claim 1, wherein the white balance adjusting the frame image according to the second color comprises:
if the reliability of the AWB coefficient of the non-face area of the frame image is lower than a preset threshold value, performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color;
and if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than a preset threshold value, performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color and the weighted value of the AWB coefficient of the non-face area.
3. A white balance adjustment device, comprising:
the measuring module is used for measuring the colors of the skin under different light sources so as to obtain the mapping relation between the light source colors and the colors of the skin under the light sources;
the statistical module is used for measuring the color of each pixel point in a face area of a frame image, and performing statistics on the color of each pixel point in the face area to obtain a color with the minimum sum of spatial distances between the color of each pixel point and the color of each pixel point, wherein the color is used as a first color presented by skin in the face area under a target light source, so that the first color is closest to the color of each pixel;
the correction module is used for counting colors of skin under different light sources in a color space to obtain a skin color range, determining a color coordinate of the first color in the color space, inquiring a color closest to the color coordinate of the first color in the skin color range if the color coordinate of the first color exceeds the skin color range, and correcting the first color into the color closest to the first color;
the query module is used for querying the mapping relation between the light source color and the color of the skin under the light source according to the first color to obtain a second color of the target light source corresponding to the first color, wherein the second color comprises the color of the target light source irradiating the skin;
and the adjusting module is used for carrying out white balance adjustment on the frame image according to the second color.
4. The white balance adjustment device according to claim 3, wherein the adjustment module includes:
the first adjusting unit is used for performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color if the reliability of the AWB coefficient of the non-face area of the frame image is lower than a preset threshold value;
and the second adjusting unit is used for performing white balance adjustment on the frame image by using the AWB coefficient determined by the second color and the weighted value of the AWB coefficient of the non-face area if the reliability of the AWB coefficient of the non-face area of the frame image is not lower than a preset threshold value.
5. A terminal device characterized by comprising the white balance adjustment apparatus according to any one of claims 3 to 4.
6. A terminal device, comprising one or more of the following components: the device comprises a shell, a processor and a memory, wherein the processor and the memory are positioned in the shell, the processor executes a program corresponding to executable program codes by reading the executable program codes stored in the memory, and the processor is used for executing the following steps:
measuring colors of the skin under different light sources to obtain a mapping relation between the colors of the light sources and the colors of the skin under the light sources;
measuring the color of each pixel point in a face region of a frame image, and counting the colors of the pixel points in the face region to obtain a color with the minimum sum of spatial distances between the color and the pixel points as a first color presented by skin in the face region under a target light source, so that the first color is closest to the color of each pixel;
counting colors of skin under different light sources in a color space to obtain a skin color range, determining color coordinates of the first color in the color space, inquiring the color closest to the color coordinates of the first color in the skin color range if the color coordinates of the first color exceed the skin color range, and correcting the first color into the color closest to the first color;
according to the first color, inquiring the mapping relation between the light source color and the color of the skin presented under the light source to obtain a second color of the target light source corresponding to the first color, wherein the second color comprises the color of the target light source irradiating the skin;
and carrying out white balance adjustment on the frame image according to the second color.
CN201610987692.2A 2016-11-09 2016-11-09 White balance adjusting method and device and terminal equipment Expired - Fee Related CN106357988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610987692.2A CN106357988B (en) 2016-11-09 2016-11-09 White balance adjusting method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610987692.2A CN106357988B (en) 2016-11-09 2016-11-09 White balance adjusting method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN106357988A CN106357988A (en) 2017-01-25
CN106357988B true CN106357988B (en) 2020-03-06

Family

ID=57861537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610987692.2A Expired - Fee Related CN106357988B (en) 2016-11-09 2016-11-09 White balance adjusting method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN106357988B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107437072B (en) * 2017-07-18 2019-01-29 维沃移动通信有限公司 A kind of image processing method, mobile terminal and computer readable storage medium
CN107396079B (en) * 2017-08-31 2019-06-07 Oppo广东移动通信有限公司 White balance adjustment method and device
CN107580205B (en) * 2017-08-31 2019-06-07 Oppo广东移动通信有限公司 White balance adjustment method and device
CN110166681A (en) * 2018-02-11 2019-08-23 东斓视觉科技发展(北京)有限公司 Intelligent photographic regulates and controls terminal, system and its shooting regulation method
CN108600640B (en) * 2018-07-03 2021-02-02 京东方科技集团股份有限公司 Gesture recognition, color white balance adjustment and exposure adjustment method and device in image
CN108737797B (en) * 2018-08-17 2020-03-27 Oppo广东移动通信有限公司 White balance processing method and device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007036462A (en) * 2005-07-25 2007-02-08 Fujifilm Holdings Corp Image processing apparatus
CN101039439A (en) * 2007-04-23 2007-09-19 北京中星微电子有限公司 Method and apparatus for realizing correction of white balance
CN101350883A (en) * 2007-07-17 2009-01-21 富士胶片株式会社 Auto white balance correction value calculation device, method, program, and image pickup device
CN103139573A (en) * 2011-11-22 2013-06-05 三星电子株式会社 Apparatus and method for adjusting white balance
JP2013187596A (en) * 2012-03-06 2013-09-19 Casio Comput Co Ltd Imaging apparatus, image processing method, and program
JP2013207721A (en) * 2012-03-29 2013-10-07 Fujifilm Corp Image pickup device and its white balance correction method and white balance correction program
CN105187810A (en) * 2014-11-11 2015-12-23 怀效宁 Automatic white balance method based on face color features and electronic media device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5066398B2 (en) * 2007-06-29 2012-11-07 富士フイルム株式会社 Image processing apparatus and method, and program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007036462A (en) * 2005-07-25 2007-02-08 Fujifilm Holdings Corp Image processing apparatus
CN101039439A (en) * 2007-04-23 2007-09-19 北京中星微电子有限公司 Method and apparatus for realizing correction of white balance
CN101350883A (en) * 2007-07-17 2009-01-21 富士胶片株式会社 Auto white balance correction value calculation device, method, program, and image pickup device
CN103139573A (en) * 2011-11-22 2013-06-05 三星电子株式会社 Apparatus and method for adjusting white balance
JP2013187596A (en) * 2012-03-06 2013-09-19 Casio Comput Co Ltd Imaging apparatus, image processing method, and program
JP2013207721A (en) * 2012-03-29 2013-10-07 Fujifilm Corp Image pickup device and its white balance correction method and white balance correction program
CN105187810A (en) * 2014-11-11 2015-12-23 怀效宁 Automatic white balance method based on face color features and electronic media device

Also Published As

Publication number Publication date
CN106357988A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN106357988B (en) White balance adjusting method and device and terminal equipment
EP3657785B1 (en) Image white balance processing method and apparatus, and terminal device
CN110136071B (en) Image processing method and device, electronic equipment and storage medium
US10559092B2 (en) Method and device for processing white balance of image and storage medium
US8199202B2 (en) Image processing device, storage medium storing image processing program, and image pickup apparatus
US20190297310A1 (en) Device and method for shadow correction verification parameter determination and shadow correction verification
US20190253683A1 (en) White balance parameter determination method and white balance adjustment method, device, and storage medium thereof
CN111163301B (en) Color adjustment method, device and computer readable storage medium
CN113676639B (en) Image processing method, processing device, electronic apparatus, and medium
WO2015145917A1 (en) Image-correcting device, image correction method, and program-recording medium
TW201830337A (en) Method and device for performing automatic white balance on an image
CN111210764A (en) LED screen correction method and correction device
US9307215B1 (en) Automatic white balance methods and systems for electronic cameras
US20180176420A1 (en) Automatic white balance based on surface reflection decomposition and chromatic adaptation
US20180176528A1 (en) Light locus generation for automatic white balance
KR20110017274A (en) Method for correcting image
US9041815B2 (en) Digital camera imaging evaluation module
US11138761B2 (en) Image processing apparatus, image processing method, and storage medium
US11836948B2 (en) Image calibration method and image calibration device
CN112991286B (en) Image statistical data detection method, device and computer readable storage medium
CN113596427B (en) Image white balance improving method and device, electronic equipment and storage medium
CN114866755B (en) Automatic white balance method and device, computer storage medium and electronic equipment
WO2022228033A1 (en) Image color cast detection and correction method, device, and refrigerator
US10586126B2 (en) Change degree deriving apparatus, change degree deriving method and non-transitory computer readable medium
JP6774004B2 (en) Change degree derivation device, change degree derivation method and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200306