# US 12,002,198 B2 · Character defect detection method and device

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

- Number: US 12,002,198 B2
- Document ID: US12002198B2
- Status: Granted
- Kind: B2
- Application number: 17/594,142
- Filed: 2020-10-30
- Published: 2022-06-02
- Granted: 2024-06-04
- Earliest claimed: 2019-12-30
- Assignees: Goertek Inc.
- Applicants: Goertek Inc.
- Inventors: Shiyu Li; Yifan Zhang; Jifeng Tian
- Web page: https://patentgrep.com/patent/US12002198B2

## CPC

- G06T 7/001: {using an image reference approach}
- G06V 30/133: {Evaluation of quality of the acquired characters}
- G06T 3/02: Affine transformations (for image registration G06T3/147; for image mosaicing G06T3/4038)
- G06T 7/90: Determination of colour characteristics
- G06T 11/10: Texturing; Colouring; Generation of textures or colours (retouching, inpainting or scratch removal G06T5/77)
- G06V 30/1444: {Selective acquisition, locating or processing of specific regions, e.g. highlighted text, fiducial marks or predetermined fields}
- G06T 2207/10024: Color image
- G06T 2207/20056: Discrete and fast Fourier transform, [DFT, FFT]
- G06T 2207/30144: Printing quality
- G06T 2207/30176: Document
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A character defect detection method and device are disclosed. The character defect detection method comprises: acquiring an image to be inspected containing a character and a template character image corresponding to the character, and converting the image to be inspected into an image having a format consistent with a format of the template character image; extracting a first valid area containing the character from the image to be inspected, and extracting a second valid area containing a template character from the template character image; obtaining a first image based on the first valid area, and obtaining a second image based on the second valid area; calculating a transformed image indicating an information difference between the first image and the second image based on the first image and the second image; and obtaining a character defect detection result of the image to be inspected based on information of the transformed image.

## Claims

### Claim 1

A character defect detection method, comprising:
acquiring an image to be inspected containing a character and a template character image corresponding to the character, and converting the image to be inspected into an image having a format consistent with a format of the template character image;
extracting a first valid area containing the character from the image to be inspected, and extracting a second valid area containing a template character from the template character image;
obtaining a first image based on the first valid area, and obtaining a second image based on the second valid area;
calculating a transformed image indicating an information difference between the first image and the second image based on the first image and the second image; and
obtaining a character defect detection result of the image to be inspected based on information of the transformed image.

### Claim 2 (depends on 1)

The method according to claim 1, wherein obtaining a character defect detection result of the image to be inspected based on information of the transformed image comprises:
detecting whether the character in the image to be inspected has a stain or character content error according to mask information of a character area in the transformed image; and/or,
detecting whether the character in the image to be inspected has a character color darkness defect according to gray value information of a character area in the transformed image.

### Claim 3 (depends on 1)

The method according to claim 1, wherein
extracting a first valid area containing the character from the image to be inspected comprises: extracting a circular or polygonal area containing the character from the image to be inspected as the first valid area;
extracting a second valid area containing a template character from the template character image comprises: extracting a circular or polygonal area containing the template character from the template character image as the second valid area.

### Claim 4 (depends on 1)

The method according to claim 1, wherein obtaining a first image based on the first valid area, and obtaining a second image based on the second valid area comprises:
selecting a background color picture based on the second valid area and a size determined by a Fourier transform result of the template character image;
superimposing the first valid area on the background color picture to obtain the first image; and
superimposing the second valid area on the background color picture to obtain the second image.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the template character image is a binary image, and the image to be inspected is converted into a binary image, and
the method further comprises:
selecting a white image as the background color picture.

### Claim 6 (depends on 1)

The method according to claim 1, wherein calculating a transformed image indicating an information difference between the first image and the second image based on the first image and the second image comprises:
calculating a displacement offset between the first image and the second image;
calculating a Fourier transform result image according to the first image or the second image and the displacement offset; and
performing spatial transformation according to the Fourier transform result image, the first image and the second image to obtain the transformed image.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
performing color inversion processing on the first image and the second image;
performing Fourier transform on the second image after color inverted to obtain a displacement offset between the first image after color inverted and the second image after color inverted, and reversely moving the second image after color inverted according to the displacement offset to obtain the Fourier transform result image;
constructing respectively a polar coordinate system of the first image after color inverted and a polar coordinate system of the Fourier transform result image, and determining a displacement between the first image after color inverted and the Fourier transform result image according to polar coordinates of pixel points of the first image after color inverted and polar coordinates of pixel points of the Fourier transform result image; and
determining an affine transformation parameter according to the displacement, and performing affine transformation on the second image based on the affine transformation parameter to obtain the transformed image.

### Claim 8 (depends on 2)

The method according to claim 2, wherein detecting whether the character in the image to be inspected has a character color darkness defect according to gray value information of a character area in the transformed image comprises:
setting a normal gray value range, and selecting pixel points whose gray value belongs to the normal gray value range from the transformed image to form a target pixel area; and
calculating an area of the target pixel area, and determining that the character in the image to be inspected has a character color darkness defect when the area of the target pixel area is inconsistent with a preset area threshold.

### Claim 9 (depends on 2)

The method according to claim 2, wherein detecting whether the character in the image to be inspected has a stain or character content error according to mask information of a character area in the transformed image comprises:
calculating a mask of the character area in the transformed image;
setting the character area of the first image to a color indicated by a background color according to the mask, and obtaining a size of an area of the first image whose color is not the background color; and
determining that the character in the image to be inspected has a stain or character content error when the size of the area of the first image whose color is not the background color is greater than a preset threshold.

### Claim 10

A character defect detection device, comprising:
an acquisition module for acquiring an image to be inspected containing a character and a template character image corresponding to the character, and converting the image to be inspected into an image having a format consistent with a format of the template character image;
an extraction module for extracting a first valid area containing the character from the image to be inspected, and extracting a second valid area containing a template character from the template character image;
a determining module for obtaining a first image based on the first valid area, and obtaining a second image based on the second valid area;
a transformation module for calculating a transformed image indicating an information difference between the first image and the second image based on the first image and the second image; and
a detection module for obtaining a character defect detection result of the image to be inspected based on information of the transformed image.

### Claim 11 (depends on 10)

The device according to claim 10, wherein the detection module is specifically for detecting whether the character in the image to be inspected has a stain or character content error according to mask information of a character area in the transformed image; and/or,
detecting whether the character in the image to be inspected has a character color darkness defect according to gray value information of a character area in the transformed image.

### Claim 12 (depends on 10)

The device according to claim 10, wherein the determining module is specifically for selecting a background color picture based on the second valid area and a size determined by a Fourier transform result of the template character image;
superimposing the first valid area on the background color picture to obtain the first image; and
superimposing the second valid area on the background color picture to obtain the second image.

### Claim 13 (depends on 10)

The device according to claim 10, wherein the transformation module is specifically for calculating a displacement offset between the first image and the second image;
calculating a Fourier transform result image according to the first image or the second image and the displacement offset; and
performing spatial transformation according to the Fourier transform result image, the first image and the second image to obtain the transformed image.

### Claim 14 (depends on 10)

The device according to claim 10, wherein the transformation module is specifically for
performing color inversion processing on the first image and the second image;
performing Fourier transform on the second image after color inverted to obtain a displacement offset between the first image after color inverted and the second image after color inverted, and reversely moving the second image after color inverted according to the displacement offset to obtain the Fourier transform result image;
constructing respectively a polar coordinate system of the first image after color inverted and a polar coordinate system of the Fourier transform result image, and determining a displacement between the first image after color inverted and the Fourier transform result image according to polar coordinates of pixel points of the first image after color inverted and polar coordinates of pixel points of the Fourier transform result image; and
determining an affine transformation parameter according to the displacement, and performing affine transformation on the second image based on the affine transformation parameter to obtain the transformed image.

### Claim 15 (depends on 11)

The device according to claim 11, wherein the detection module is specifically for
calculating a mask of the character area in the transformed image;
setting the character area of the first image to a color indicated by a background color according to the mask, and obtaining a size of an area of the first image whose color is not the background color; and
determining that the character in the image to be inspected has a stain or character content error when the size of the area of the first image whose color is not the background color is greater than a preset threshold.

### Claim 16

A computer readable storage medium storing a computer program, wherein the computer program causes a computer to execute the following method:
acquiring an image to be inspected containing a character and a template character image corresponding to the character, and converting the image to be inspected into an image having a format consistent with a format of the template character image;
extracting a first valid area containing the character from the image to be inspected, and extracting a second valid area containing a template character from the template character image;
obtaining a first image based on the first valid area, and obtaining a second image based on the second valid area;
calculating a transformed image indicating an information difference between the first image and the second image based on the first image and the second image; and
obtaining a character defect detection result of the image to be inspected based on information of the transformed image.

### Claim 17 (depends on 16)

The computer readable storage medium according to claim 16, wherein the computer program further causes the computer to execute the following method:
detecting whether the character in the image to be inspected has a stain or character content error according to mask information of a character area in the transformed image; and/or,
detecting whether the character in the image to be inspected has a character color darkness defect according to gray value information of a character area in the transformed image.

### Claim 18 (depends on 16)

The computer readable storage medium according to claim 16, wherein the computer program further causes the computer to execute the following method:
calculating a displacement offset between the first image and the second image;
calculating a Fourier transform result image according to the first image or the second image and the displacement offset;
performing spatial transformation according to the Fourier transform result image, the first image and the second image to obtain the transformed image.

### Claim 19 (depends on 16)

The computer readable storage medium according to claim 16, wherein the computer program further causes the computer to execute the following method:
performing color inversion processing on the first image and the second image;
performing Fourier transform on the second image after color inverted to obtain a displacement offset between the first image after color inverted and the second image after color inverted, and reversely moving the second image after color inverted according to the displacement offset to obtain the Fourier transform result image;
constructing respectively a polar coordinate system of the first image after color inverted and a polar coordinate system of the Fourier transform result image, and determining a displacement between the first image after color inverted and the Fourier transform result image according to polar coordinates of pixel points of the first image after color inverted and polar coordinates of pixel points of the Fourier transform result image;
determining an affine transformation parameter according to the displacement, and performing affine transformation on the second image based on the affine transformation parameter to obtain the transformed image.

### Claim 20 (depends on 17)

The computer readable storage medium according to claim 17, wherein the computer program further causes the computer to execute the following method:
calculating a mask of the character area in the transformed image;
setting the character area of the first image to a color indicated by a background color according to the mask, and obtaining a size of an area of the first image whose color is not the background color; and
determining that the character in the image to be inspected has a stain or character content error when the size of the area of the first image whose color is not the background color is greater than a preset threshold.
