IP Library › Granted Patent US 10,674,128
Granted Patent B2
US 10,674,128 · App. 16/121,531 · Granted Jun 2, 2020

White balance processing method, electronic device and computer readable storage medium

Inventor: Huichao Wang (Guangdong, CN)
Assignee: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., LTD.
H04N9/73G06K9/4647G06K9/6256G06K9/6265H04N5/2351
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,674,128
App. No.
16/121,531
Granted
Jun 2, 2020
Kind
B2
Abstract

The present disclosure provides a white balance processing method including processing an image to obtain a color of a light source contained in a scene corresponding to the image; determining whether the color of the light source is identical to a natural color of an object contained in the scene; when the color of the light source is identical to the natural color of the object, determining a type of the scene and performing a white balance processing on the image according to the type of the scene; and when the color of the light source is different from the natural color of the object, determining color temperature of the light source contained in the scene according to the color of the light source and performing the white balance processing on the image according to the color temperature of the light source.

Claims (73)

1. A white balance processing method, comprising:

processing an image to obtain a color of a light source contained in a scene corresponding to the image;

determining whether the color of the light source is identical to a natural color of an object contained in the scene;

in response to determining that the color of the light source is identical to the natural color of the object contained in the scene, determining a type of the scene and performing a white balance processing on the image according to the type of the scene; and

in response to determining that the color of the light source is different from the natural color of the object contained in the scene, determining color temperature of the light source contained in the scene according to the color of the light source and performing the white balance processing on the image according to the color temperature of the light source.

2. The method according to claim 1 , further comprising:

dividing the image into a plurality of regions;

according to a histogram of each region, determining whether the region is a target region having the light source;

determining whether at least two target regions adjacent to each other exist;

in response to determining that the at least two target regions exist, stitching at least two light sources contained in the at least two target regions into the light source contained in the scene; and

in response to determining that the at least two target regions do not exist, determining the light source contained in the target region as the light source contained in the scene.

3. The method according to claim 2 , wherein determining whether the region is the target region having the light source according to the histogram of the region comprises:

determining whether a ratio of a number of pixels each with a pixel value greater than a predetermined value exceeds a predetermined ratio;

when the ratio of the number of pixels each with the pixel value greater than the predetermined value exceeds the predetermined ratio, determining that the region is the target region having the light source according to the histogram of the region; and

when the ratio of the number of pixels each with the pixel value greater than the predetermined value does not exceed the predetermined ratio, determining that the region is not the target region having the light source according to the histogram of the region.

4. The method according to claim 2 , wherein processing the image to obtain the color of the light source contained in the scene corresponding to the image comprises:

determining a first region and a second region according to a brightness distribution along a radial direction from a center of the light source contained in the scene; and

subtracting averaged pixel values of primary color channels of the second region from averaged pixel values of the primary color channels of the first region to determine the color of the light source contained in the scene.

5. The method according to claim 4 , wherein the first region refers to a region defined by pixels each having a brightness value within a first brightness range along the radial direction from the center of the light source, the second region refers to a region defined by pixels each having a brightness value within a second brightness range along the radial direction from the center of the light source, and an upper limit of the second brightness range is less than or equal to a lower limit of the first brightness range.

6. The method according to claim 5 , wherein the first brightness range and the second brightness range are determined according to a brightness distribution along the radial direction from the center of the light source.

7. The method according to claim 1 , wherein determining whether the color of the light source is identical to the natural color of the object contained in the scene comprises:

determining whether the color of the light source is identical to the natural color of the object contained in the scene according to a ratio among pixel values of primary color channels for the color of the light source and a ratio among pixel values of primary color channels for a color of the object in the image.

8. The method according to claim 7 , wherein the color of the object in the image is obtained by superimposing the color of the light source and the natural color of the object contained in the scene; and determining whether the color of the light source is identical to the natural color of the object contained in the scene comprises:

determining whether the color of the light source is identical to the color of the object in the image;

when the color of the light source is different from the color of the object in the image, determining that the color of the light source is different to the natural color of the object contained in the scene; and

when the color of the light source is identical to the color of the object in the image, determining whether the color of the light source is identical to the natural color of the object contained in the scene according to the ratio among pixel values of primary color channels for the color of the light source and the ratio among pixel values of primary color channels for the color of the object in the image.

9. The method according to claim 7 , wherein determining whether the color of the light source is identical to the natural color of the object contained in the scene according to the ratio among pixel values of primary color channels for the color of the light source and the ratio among pixel values of primary color channels for the color of the object in the image comprises:

determining whether the ratio among pixel values of primary color channels for the color of the light source is identical to the ratio among pixel values of primary color channels for the color of the object in the image;

in response to determining that the ratio among pixel values of primary color channels for the color of the light source is identical to the ratio among pixel values of primary color channels for the color of the object in the image, determining that the color of the light source is identical to the natural color of the object contained in the scene; and

in response to determining that the ratio among pixel values of primary color channels for the color of the light source is different from the ratio among pixel values of primary color channels for the color of the object in the image, determining that the color of the light source is different from the natural color of the object contained in the scene.

10. The method according to claim 1 , wherein determining whether the color of the light source is identical to the natural original color of the object contained in the scene comprises:

processing the image using a preset classifier to determine whether the color of the light source is identical to the natural color of the object contained in the scene.

11. The method according to claim 10 , further comprising:

acquiring a plurality of frame images, each frame image comprises a first mark indicating that the color of the light source is identical to the natural color of object contained in the scene and a second mark indicating that the color of the light source is different from the natural color of the object contained in the scene;

dividing the plurality of frame images into training samples and testing samples;

inputting the training samples into a classifier algorithm to generate a classifier;

inputting the testing samples into the classifier to obtain a predicted result indicating whether the color of the light source is identical to the natural color of the object contained in the scene; and

correcting the classifier based on the predicted result to obtain the preset classifier.

12. The method according to claim 1 , wherein in response to determining that the color of the light source is identical to the natural color of the object contained in the scene, determining the type of the scene and performing the white balance processing on the image according to the type of the scene comprises:

processing the image to determine a type of the object in the image;

determining the type of the scene according to the type of the object; and

performing the white balance processing on the image according to the type of the scene and a predetermined correspondence between types of scenes and white balance parameters.

13. The method according to claim 1 , wherein determining the color temperature of the light source contained in the scene according to the color of the light source comprises:

determining the color temperature of the light source contained in the scene according to the color of the light source and a correspondence between colors of light sources and color temperature of the light sources, wherein the correspondence is selected from a group consist of a mapping table and a color temperature curve.

14. The method according to claim 1 , wherein the natural color of the object contained in the scene refers to a color presented by the object contained in the scene under illumination of a standard white light.

15. An electronic device, comprising:

one or more processors;

a memory; and

one or more programs, stored in the memory and configured to be executable by the one or more processors;

wherein the one or more programs comprises instructions, the one or more processors are configured to:

process an image to obtain a color of a light source contained in a scene corresponding to the image;

determine whether the color of the light source is identical to a natural color of an object contained in the scene;

in response to determining that the color of the light source is identical to the natural color of the object contained in the scene, determine a type of the scene and performing a white balance processing on the image according to the type of the scene; and

in response to determining that the color of the light source is different from the natural color of the object contained in the scene, determine color temperature of the light source contained in the scene according to the color of the light source and perform the white balance processing on the image according to the color temperature of the light source.

16. The electronic device according to claim 15 , wherein the one or more processor are configured to process the image to obtain the color of the light source contained in the scene corresponding to the image by acts of:

dividing the image into a plurality of regions;

according to a histogram of each region, determining whether the region is a target region having the light source;

determining whether at least two target regions adjacent to each other are presented;

in response to determining that the at least two target regions are presented, stitching at least two light sources contained in the at least two target regions into the light source contained in the scene; and

in response to determining that the at least two target regions are not presented, determining the light source contained in the target region as the light source contained in the scene.

17. The electronic device according to claim 15 , wherein the one or more processors are configured to process the image to obtain the color of the light source contained in the scene corresponding to the image by acts of:

determining a first region and a second region according to a brightness distribution along a radial direction from a center of the light source contained in the scene; and

subtracting averaged pixel values of primary color channels of the second region from averaged pixel values of the primary color channels of the first region to determine the color of the light source contained in the scene.

18. The electronic device according to claim 15 , wherein the one or more processors are configured to determine whether the color of the light source is identical to the natural color of the object contained in the scene by acts of:

determining whether the color of the light source is identical to the natural color of the object contained in the scene according to a ratio among pixel values of primary color channels for the color of the light source and a ratio among pixel values of primary color channels for a color of the object in the image.

19. The electronic device according to claim 15 , wherein the one or more processors are configured to determine whether the color of the light source is identical to the natural original color of the object contained in the scene by acts of:

processing the image using a preset classifier to determine whether the color of the light source is identical to the natural color of the object contained in the scene.

20. A non-transitory computer readable storage medium, comprising computer programs cooperating with the electronic device,

wherein the computer programs are executed by a processor to execute a white balance processing method, and the white balance processing method comprises:

processing an image to obtain a color of a light source contained in a scene corresponding to the image;

determining whether the color of the light source is identical to a natural color of an object contained in the scene;

in response to determining that the color of the light source is identical to the natural color of the object contained in the scene, determining a type of the scene and performing a white balance processing on the image according to the type of the scene; and

in response to determining that the color of the light source is different from the natural color of the object contained in the scene, determining color temperature of the light source contained in the scene according to the color of the light source and performing the white balance processing on the image according to the color temperature of the light source.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 5, 2018
From: WANG, HUICHAO
To: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., LTD.
Reel/Frame 046787/0489 →
Priority Claims (1)
CN 2017 1 1033365 · Oct 30, 2017 · national
Continuity (1)
Related Publication 20190132563A1 · May 2, 2019