# US 2008/0291475 A1 · Auto white balancing by modified grey world and geometric distortion measurement

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0291475 A1
- Document ID: US20080291475A1
- Status: Published application
- Kind: A1
- Application number: 11/753,687
- Filed: 2007-05-25
- Published: 2008-11-27
- Earliest claimed: 2007-05-25
- Assignees: Hong Kong Applied Science and Technology Research Institute Company Limited
- Inventors: Hon Wah Wong; Kar Kin Edwin Lee
- Web page: https://patentgrep.com/patent/US20080291475A1

## CPC

- H04N 1/4074: {using histograms}
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method, apparatus and computer program product for correcting white balance in a digital image are described. The method comprises determining a number of grey blocks in the digital image (s102), each block comprising a subset of pixels of the image, and if the number of grey blocks is less than a predetermined value, scaling one or more colour channels of the digital image using a first gain value to generate a first intermediate image (s201A) and scaling one or more colour channels of the digital image using a second gain value to generate a second intermediate image (s201B). A number of grey blocks in each of the first and second intermediate images (s202A, s202B) is determined and the gain value resulting in the intermediate image having a greater number of grey blocks is set as the reference gain value (s203). A grey world process is performed on the intermediate image having a greater number of grey blocks (s205). Also described are a method, apparatus and computer program product for computing gain values for correcting a white balance of a digital image. The method comprises receiving an image divided into a number of blocks, removing the three most frequently occurring colours from the image (s204), and scaling one or more colour channels of the image by respective reference gain values derived by a grey world process performed on the image.

## Claims

### Claim 1

A method of correcting white balance in a digital image, the method comprising the steps of:
determining a number of grey blocks in the digital image according to a geometric distortion criteria, each block comprising a subset of the plurality of pixels of the image, said number of determined blocks being less than a predetermined value;
processing the digital image to generate an intermediate image;
determining a number of grey blocks in the intermediate image according to a geometric distortion criteria;
scaling one or more colour channels of the intermediate image by respective reference gain values derived in accordance with a grey world process performed on the intermediate image; and
applying the respective reference gain values to the intermediate image, whereby an image with a corrected white balance is obtained.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising the step of refining the respective reference gain values before applying the respective reference gain values to the intermediate image.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the step of processing the digital image to generate an intermediate image comprises the steps of:
scaling one or more colour channels of the digital image by respective first gain values to generate a first intermediate image;
sealing one or more colour channels of the digital image by respective second gain values to generate a second intermediate image;
determining a number of grey blocks in each of the first and second intermediate image, in accordance with a geometric distortion criteria; and
selecting either the first or second gain values as the reference gain values, in accordance with the determination of which of the first or second intermediate images comprises a greater number of grey blocks.

### Claim 4 (depends on 2)

The method according to claim 2, wherein the step of refining the respective reference gain values comprises:
determining the number of grey blocks in the intermediate image;
computing luminance weights and grey weights;
applying the luminance weights and grey weights to the respective reference grey values to obtain a further intermediate image;
determining the number of grey blocks in the further intermediate image; and
determining if the number of grey blocks exceeds a second predetermined value.

### Claim 5 (depends on 4)

The method according to claim 4, wherein if the number of grey blocks does not exceed the second predetermined value, a gain value of the B channel and a gain value of the R channel are set to 1.

### Claim 6 (depends on 4)

The method according to claim 4, wherein if the number of grey blocks exceeds the second predetermined value, a number of iterations of the step of refining the respective reference gain values is determined.

### Claim 7 (depends on 6)

The method according to claim 6, wherein if the number of iterations exceeds a third predetermined value, a false positive detection and gain adjustment process for further refining the respective reference gain values is performed.

### Claim 8 (depends on 6)

The method according to claim 6, wherein if the number of iterations does not exceed the third predetermined value, the step of refining the respective reference gain values is re-iterated.

### Claim 9 (depends on 4)

The method according to claim 4, wherein the luminance weight is calculated according to the following equation:
LW
i
=
1
-
(

L
i
-
L
_

128
)
2
,
where Li is the average intensity of the ith gray block, and L is the average intensity of the digital image.

### Claim 10 (depends on 4)

The method according to claim 4, wherein the grey weight is calculated according to the following equation:
GWi=1−GDi2,
where GDi2 is the geometric distortion of the ith gray block.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the geometric distortion criteria is:

G
i
R
i
-
1

+

G
i
B
i
-
1

≤
T
g
where
Ri is the accumulated value of a R channel of the image,
Gi is the accumulated value of a G channel of the image,
Bi is the accumulated value of a B channel of the image, and
Tg is an empirically determined threshold,
and a block is grey if the geometric distortion criteria is satisfied.

### Claim 12 (depends on 3)

The method according to claim 3, wherein a first gain value for sealing a B channel of the digital image is calculated as follows:
B
gain
=
median


(
G
i
)
median


(
B
i
)
,
where
Gi is the accumulated value of a G channel of the image, and
Bi is the accumulated value of a B channel of the image.

### Claim 13 (depends on 3)

The method according to claim 3, wherein a first gain value for scaling an R channel of the digital image is calculated as follows:
R
gain
=
median


(
G
i
)
median


(
R
i
)
,
where
Ri is the accumulated value of a R channel of the image, and
Gi is the accumulated value of a G channel of the image.

### Claim 14 (depends on 3)

The method according to claim 3, wherein a second gain value for scaling a B channel of the digital image is calculated as follows:
B
gain
=
mean


(
G
i
)
mean


(
B
i
)
,
where
Gi is the accumulated value of a G channel of the image, and
Bi is the accumulated value of a B channel of the image.

### Claim 15 (depends on 3)

The method according to claim 3, wherein a second gain value for sealing an R channel of the digital image is calculated as follows:
R
gain
=
mean


(
G
i
)
mean


(
R
i
)
,
where
Ri is the accumulated value of a R channel of the image, and
Gi is the accumulated value of a G channel of the image.

### Claim 16

A method for computing one or more gain values for correcting a white balance of a digital image, the method comprising the steps of:
receiving an image divided into a number of blocks, each block including a plurality of pixels;
removing the three most frequently occurring colours from the image; and
scaling one or more colour channels of the image by respective reference gain values derived by a grey world process performed on the image.

### Claim 17 (depends on 16)

The method according to claim 16, wherein the grey world process computes a gain value for a B channel as follows:
B
gain
=
median


(
G
i
)
median


(
B
i
)
,
where
Gi is the accumulated value of a G channel of the image, and
Bi is the accumulated value of a B channel of the image.

### Claim 18 (depends on 16)

The method according to claim 16, wherein the grey world process computes a gain value for an R channel of the image as follows:
R
gain
=
mean


(
G
i
)
mean


(
R
i
)
,
where
Gi is the accumulated value of a G channel of the image, and
Bi is the accumulated value of a B channel of the image.

### Claim 19 (depends on 16)

The method according to claim 16, wherein the step of removing the three most frequently occurring colours comprises the steps of:
transforming each of the plurality of blocks to a hue domain;
quantizing the hue domain of each block; and
generating a histogram of the colours after equalization of the hue domain, whereby the frequency of occurrence of colours in the image is ascertained.

### Claim 20 (depends on 16)

The method according to claim 16, further comprising the step of normalizing each block.

### Claim 21 (depends on 20)

The method according to claim 20, wherein the step of normalizing each block comprises:
transforming each of the plurality of blocks to a hue domain;
quantizing the hue domain of each block;
generating a histogram of the colours after equalization of the hue domain; and
weighting the respective reference gain values.

### Claim 22 (depends on 21)

The method according to claim 21, wherein a gain of the B channel is weighted, as follows:
B
gain
=
∑
∀
i

W
i

G
i
∑
∀
i

W
i

B
i
,

where
W
i
=
1
H

(
C
i
)
,
H(c) is the count of colour C, and
Ci is the quantized colour of block i

### Claim 23 (depends on 21)

The method according to claim 21, wherein a gain of the R channel is weighted as follows:
B
gain
=
∑
∀
i

W
i

G
i
∑
∀
i

W
i

B
i
,

where
W
j
=
1
H

(
C
i
)
,
H(c) is the count of colour C, and
Ci is the quantized colour of block i

### Claim 24

An apparatus for correcting white balance in a digital image, the apparatus comprising:
means for determining a number of grey blocks in the digital image according to a geometric distortion criteria, each block comprising a subset of the plurality of pixels of the image, said number of determined blocks being less than a predetermined value;
processing means for generating an intermediate image;
means for determining a number of grey blocks in the intermediate image according to a geometric distortion criteria;
scaling means for scaling one or more colour channels of the intermediate image by respective reference gain values derived in accordance with a grey world process performed on the intermediate image; and
means for applying the respective reference gain values to the intermediate image, whereby an image with a corrected white balance is obtained.

### Claim 25

A computer program product for correcting white balance in a digital image, said program comprising:
code for determining a number of grey blocks in the digital image according to a geometric distortion criteria, each block comprising a subset of the plurality of pixels of the image, said number of determined blocks being less than a predetermined value;
code for processing the digital image to generate an intermediate image;
code for determining a number of grey blocks in the intermediate image according to a geometric distortion criteria;
code for scaling one or more colour channels of the intermediate image by respective reference gain values derived in accordance with a grey world process performed on the intermediate image; and
code for applying the respective reference gain values to the intermediate image, whereby an image with a corrected white balance is obtained.

### Claim 26

An apparatus for computing one or more gain values for correcting a white balance of a digital image, the apparatus comprising:
means for receiving an image divided in a number of blocks, each block including a plurality of pixels;
means for removing the three most frequently occurring colours from the image; and
means for scaling one or more colour channels of the image by respective reference gain values derived by a grey world process performed on the image.

### Claim 27

A computer program product for computing one or more gain values for correcting a white balance of a digital image, said program comprising;
code for receiving an image divided into a number of blocks, each block including a plurality of pixels;
code for removing the three most frequently occurring colours from the image; and
code for scaling one or more colour channels of the image by respective reference gain values derived by a grey world process performed on the image
