# US 2012/0250985 A1 · Context Constraints for Correcting Mis-Detection of Text Contents in Scanned Images

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

- Number: US 2012/0250985 A1
- Document ID: US20120250985A1
- Status: Published application
- Kind: A1
- Application number: 13/076,026
- Filed: 2011-03-30
- Published: 2012-10-04
- Earliest claimed: 2011-03-30
- Inventors: Jing Xiao
- Web page: https://patentgrep.com/patent/US20120250985A1

## CPC

- G06V 30/413: Classification of content, e.g. text, photographs or tables
- G06V 20/62: Text, e.g. of license plates, overlay texts or captions on TV images
- G06V 30/15: {Cutting or merging image elements, e.g. region growing, watershed or clustering-based techniques}
- G06V 30/10: Character recognition
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

Misclassified text components are identified and corrected by comparing non-text components with their neighboring text components. If a non-text component being examined is found to be substantially aligned with its neighboring text components, and is further found to have a similar average color and size as its neighboring text components, then it is reclassified as a text component. Misclassified non-text components are reduced by restricting text labeling to areas of a document image defined by an edge map. The edge map is made by smoothing the document image, and applying edge detection to the smooth image.

## Claims

### Claim 1

Method of identifying text components within a document image, said method comprising the following steps:
(a) submitting said document image to a text labeling process to define connected components of foreground pixels within at least a region of said document image and to assign said connected components an initial classification of text component or non-text component as determined by said text labeling process;
(b) for each non-text component,
defining a neighborhood region around the non-text component, where text components within said neighborhood region are termed neighboring text components;
IF there is a predefined number of neighboring text-components, THEN
IF the non-text component meets a predefined set of criteria comparing the non-text component to its neighboring text-components, THEN reclassifying the non-text component as a text component;
ELSE maintaining the non-text component's classification of non-text.

### Claim 2 (depends on 1)

The method claim 1, wherein said neighborhood region is defined as an area extending within two times the area of the non-text component's bounding block.

### Claim 3 (depends on 2)

The method of claim 2, wherein said set of predefine criteria includes:
determining if the non-text component's bounding block is aligned with the bounding blocks of its neighboring text components within a predefined margin of error.

### Claim 4 (depends on 3)

The method of claim 3, wherein said margin of error is 40% of the dimensions of the non-text component's bounding block.

### Claim 5 (depends on 1)

The method of claim 1, wherein said predefined number is two.

### Claim 6 (depends on 1)

The method of claim 1, wherein said set of predefine criteria includes:
determining if all the neighboring text components have an average color matching the average color of the non-text component within 40%, and if all the bounding blocks of all the neighboring text components having a size within ±40% of the non-text component's bounding block.

### Claim 7 (depends on 1)

Method of claim 1, wherein in said step (a), said text labeling process is applied only to areas of said document image coinciding to an edge neighborhood defined as areas of said document image corresponding to a local neighborhood of an edge map.

### Claim 8 (depends on 1)

The method of claim 1, wherein said edge map is defined by:
(i) smoothing said document image to create a smooth document image; and
(ii) applying edge detection to said smoothed document image, the resultant detected edges being said edge map.

### Claim 9 (depends on 8)

The method of claim 8, wherein said local neighborhood is the area within ±20 pixels of the smoothed edges of said edge map.

### Claim 10 (depends on 8)

The method of claim 8, wherein in step (i), said document image is smooth by application of a Gaussian filter.

### Claim 11 (depends on 1)

The method of claim 1, further comprising, applying a density filter process after step (a) and prior to step (b), wherein said density filter process includes:
(A) determining if a text component that is not bigger than a predefined size can be identified, the identified text component being termed a candidate half-tone component;
(B) IF no candidate half-tone component is identified, then ending the density filter process;
ELSE:
defining a local neighborhood of minimum size surrounding the candidate half-tone component;
identifying any additional text component within the local neighborhood that are not bigger than the predefined size;
IF the percentage of text pixels within the local neighborhood is greater than a predefine percentage and the number of text components that are not bigger than the predefined size within the local neighborhood is greater than a predefined minimum number, THEN reclassifying all text components within the local window as non-text components;
(C) return to step (A).

### Claim 12 (depends on 11)

The method of claim 11, wherein:
the minimum size of the local neighborhood is three times the area of the candidate half-tone component's bounding box or a 30×30 pixel area, which ever is greater;
said predefine percentage 50%; and
said minimum number is 4.

### Claim 13

A method of identifying text components within a document image, said method comprising:
(i) smoothing said document image to create a smooth document image;
(ii) defining an edge map by applying edge detection to said smoothed document image; and
(iii) submitting select areas of said document image to a text labeling process to assign an initial classification of text component or non-text component to connected components of foreground pixels, wherein said selected areas are defined as coinciding to a local edge neighborhood of said edge map.

### Claim 14 (depends on 13)

The method of claim 13, wherein said local edge neighborhood is the vicinity defined within ±20 pixels of the smoothed edges of said edge map.

### Claim 15 (depends on 13)

The method of claim 13, wherein in step (i), said document image is smoothed by application of a Gaussian filter.

### Claim 16 (depends on 13)

The method of claim 13, further comprising:
(iv) for each non-text component,
defining a neighborhood region around the non-text component, where text components within said neighborhood region are termed neighboring text components;
IF there are at least two neighboring text-components, THEN
IF the non-text component meets a predefined set of criteria comparing the non-text component to its neighboring text-components, THEN reclassifying the non-text component as a text component;
ELSE maintaining the non-text component's initial classification.

### Claim 17 (depends on 16)

The method claim 16, wherein said neighborhood region is defined as an area extending within two times the area of the non-text component's bounding block.

### Claim 18 (depends on 16)

The method of claim 16, wherein said set of predefine criteria includes:
determining if the non-text component's bounding block is aligned with the bounding blocks of its neighboring text components within a predefined margin of error.

### Claim 19 (depends on 18)

The method of claim 18, wherein said margin of error is 40% of the dimensions of the non-text component's bounding block.

### Claim 20 (depends on 16)

The method of claim 16, wherein said set of predefine criteria includes:
determining if all the neighboring text components have an average color matching the average color of the non-text component within 40%, and if all the bounding blocks of all the neighboring text components having a size within ±40% of the non-text component's bounding block.
