# US 2010/0246951 A1 · Colour correcting foreground colours for visual quality improvement

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

- Number: US 2010/0246951 A1
- Document ID: US20100246951A1
- Status: Published application
- Kind: A1
- Application number: 12/726,665
- Filed: 2010-03-18
- Published: 2010-09-30
- Earliest claimed: 2009-03-31
- Assignees: Canon Kabushiki Kaisha
- Inventors: Yu-Ling Chen; Trevor Lee McDonell
- Web page: https://patentgrep.com/patent/US20100246951A1

## CPC

- H04N 1/58: Edge or detail enhancement; Noise or error suppression, e.g. colour misregistration correction (H04N1/62 takes precedence)
- H04N 1/62: Retouching, i.e. modification of isolated colours only or in isolated picture areas only
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method (199) is disclosed for modifying colours of text extracted from an image of a document page to improve visual quality. The document image comprises text and image regions of various colours. The method divides (100) the document image into a plurality of connected components, the connected components comprising pixels of similar colour that are closely spatially located, and selects from the image a plurality of the connected components that represent text. The plurality of text connected components are grouped to form a logical structure grouping of said page comprising one or more text blocks wherein each said text block represents a text line or paragraph. One or more logically consistent colour sets are then formed (120, 699, 399, 499) for each text block based on the colours of the connected components in the text block. The logically consistent colour sets represent all text of visually similar colour of the corresponding text line or paragraph. The method then applies colour enhancement (130) to the logically consistent colour sets to enhance visual quality and correct image defects in the document image.

## Claims

### Claim 1

A method of modifying colours of text extracted from an image of a document page to improve visual quality, said document image comprising text and image regions of various colours, the method comprising:
(a) dividing the document image into a plurality of connected components, the connected components comprising pixels of similar colour that are closely spatially located, and selecting from said image a plurality of the connected components that represent text;
(b) grouping said plurality of text connected components to form a logical structure grouping of said page comprising one or more text blocks wherein each said text block represents a text line or paragraph;
(c) forming one or more logically consistent colour sets for each said text block based on the colours of said connected components in said text block, wherein said logically consistent colour sets represent all text of visually similar colour of the corresponding text line or paragraph; and
(d) applying colour enhancement to said logically consistent colour sets to enhance visual quality and correct image defects in the document image.

### Claim 2 (depends on 1)

A method according to claim 1, wherein the said logically consistent colour sets of a said text block are formed by the steps of:
(ca) designating each connected component of said text block to a colour set based on colour similarity of said connected component and of a corresponding enclosing background colour, wherein each colour set has a foreground and background colour; and
(cb) merging pairs of said colour sets of said text block based on their foreground and background colour similarity.

### Claim 3 (depends on 2)

A method according to claim 2, wherein step (cb) comprises determining whether to merge a pair of said colour sets of the said text block based on a threshold for a foreground colour distance of said pair, wherein said threshold is determined by a background colour difference of the said pair.

### Claim 4 (depends on 2)

A method according to claim 2, wherein step (cb) comprises the steps of:
(cba) compensating each of the foreground colours of said colour sets based on the corresponding background colour; and
(cbb) determining whether to merge based on a predetermined colour threshold for the difference of the foreground colours of the pair.

### Claim 5 (depends on 2)

A method according to claim 2, wherein the background colour of a said colour set further includes information of any closely spatially located graphic regions, a pixel count, and a minimum bounding rectangle.

### Claim 6 (depends on 2)

A method according to claim 2, wherein the background colour of a said merged colour set pair, where the colour sets have different background colour is determined, in order, by the steps of:
(a) selecting the non-white background colour of the said pair if one of the said pair is non-white;
(b) selecting from said pair the background colour covering the largest area if both of the said colour sets have non-white background colour; and
(c) updating the associated background colour information with:
(i) the sum of background pixel counts of the said pair;
(ii) the sum of the statistics of any closely spatially located graphic regions of the said pair; and
(iii) the minimum bounding rectangle enclosing both of the minimum bounding rectangles of the said pair.

### Claim 7 (depends on 2)

A method according to claim 2 further comprising creating a new colour set if no colour set with a similar foreground and background colour to the said connected component can be found.

### Claim 8 (depends on 1)

A method according to claim 1, wherein the amount of colour correction depends on the edge ratio of the connected components within each of the said logically consistent colour sets.

### Claim 9 (depends on 1)

A method according to claim 1, wherein visually black colours are made blacker, visually white colours are made whiter, and visually non-greyish colours are made more saturated.

### Claim 10 (depends on 9)

A method according to claim 9, wherein visually black colour is determined by the foreground and background of a said colour set comprising one of these criteria:
(a) the foreground is very close to black; or
(b) the foreground has a much lower HSV value component than the background and the hue channel components are similar.

### Claim 11 (depends on 9)

A method according to claim 9, wherein visually white colour is determined by the foreground and background of a said colour set comprising one of these criteria:
(a) the foreground is very close to white; or
(b) the foreground has a much higher HSV value component than the background and the hue channel components are similar.

### Claim 12 (depends on 9)

A method according to claim 9, wherein visually non-greyish colour is determined by HSV saturation and YCbCr luminance of the foreground of a said colour set if HSV saturation is below a predetermined threshold and the sum of HSV saturation and YCbCr luminance is below a second predetermined threshold.

### Claim 13 (depends on 1)

A method according to claim 1, wherein the colour correction is optionally disabled if a said logically consistent colour set is closely spatially located to a significant graphic region.

### Claim 14 (depends on 1)

A method according to claim 1, further comprising merging colour corrected sets across said text blocks with a similar foreground colour.

### Claim 15

A computer readable storage medium having a computer program recorded thereon, the program being executable by computer apparatus to modifying colours of text extracted from an image of a document page to improve visual quality, said document image comprising text and image regions of various colours, the program comprising:
code for dividing the document image into a plurality of connected components, the connected components comprising pixels of similar colour that are closely spatially located, and selecting from said image a plurality of the connected components that represent text;
code for grouping said plurality of text connected components to form a logical structure grouping of said page comprising one or more text blocks wherein each said text block represents a text line or paragraph;
code for forming one or more logically consistent colour sets for each said text block based on the colours of said connected components in said text block, wherein said logically consistent colour sets represent all text of visually similar colour of the corresponding text line or paragraph; and
code for applying colour enhancement to said logically consistent colour sets to enhance visual quality and correct image defects in the document image.

### Claim 16

Computer apparatus comprising a processor, a memory, an input for a document image and an output for a modified document images, said memory having a computer program recorded therein, the program being executable by the processor to modify colours of text extracted from the document image, said document image comprising text and image regions of various colours, the program comprising:
code for dividing the document image into a plurality of connected components, the connected components comprising pixels of similar colour that are closely spatially located, and selecting from said image a plurality of the connected components that represent text;
code for grouping said plurality of text connected components to form a logical structure grouping of said page comprising one or more text blocks wherein each said text block represents a text line or paragraph;
code for forming one or more logically consistent colour sets for each said text block based on the colours of said connected components in said text block, wherein said logically consistent colour sets represent all text of visually similar colour of the corresponding text line or paragraph; and
code for applying colour enhancement to said logically consistent colour sets to enhance visual quality and correct image defects in the document image to form the modified document image.

### Claim 17

A method of modifying colours of text extracted from a document image of a page, the method comprising;
(a) generating a first text connected component and a second text connected component from the document image, said first and second text connected components being a different colour and each having a different enclosing background colour;
(b) determining an output colour based on the colours of the first and second text connected components, the determined output colour being based on a comparison between a colour of at least one text connected component and a threshold, wherein the threshold or colour of the at least one text connected component is adjusted according to the colour of the enclosing background;
(c) setting the colour for the first and second text connected components according to the determined output colour.

### Claim 18 (depends on 17)

A method according to claim 17, wherein step (b) comprises determining the output colour by merging the colours of the first and second text connected components based on a threshold for a colour distance between said text connected component colours, wherein said threshold is determined by a colour difference between the enclosing background colours.

### Claim 19 (depends on 17)

A method according to claim 17, wherein step (b) comprises:
(ba) compensating at least one of the first and second connected component colours based on the enclosing background colour; and
(bb) determining the output colour by merging the text connected component colours based on a predetermined threshold for a colour distance between said compensated text connected component colours.
