# US 2025/0209595 A1 · Method for detecting surface defect and apparatus thereof

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

- Number: US 2025/0209595 A1
- Document ID: US20250209595A1
- Status: Published application
- Kind: A1
- Application number: 18/397,542
- Filed: 2023-12-27
- Published: 2025-06-26
- Earliest claimed: 2023-12-22
- Assignees: Pusan National University Industry-University Cooperation Foundation
- Applicants: Pusan National University Industry-University Cooperation Foundation
- Inventors: Jin Kyu GAHM; Il Hae YU; Won June CHOI
- Web page: https://patentgrep.com/patent/US20250209595A1

## CPC

- G06T 7/0004: {Industrial image inspection}
- G06T 2207/10004: Still image; Photographic image
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T 2207/30136: Metal
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Provided is a method of detecting a surface defect. The method includes acquiring a target image, detecting at least one defect area from the target image, generating a first defect matrix having a size corresponding to the target image and an element that is a first defect score calculated based on the number of defect areas, calculating a plurality of second defect scores by summing first defect scores in a range corresponding to a predetermined reference window in the first defect matrix, and extracting an image corresponding to the reference window from the target image based on the second defect score and generating a defect image.

## Claims

### Claim 1

A method of detecting a surface defect, comprising:
acquiring a target image;
detecting at least one defect area from the target image;
generating a first defect matrix having a size corresponding to the target image and an element that is a first defect score calculated based on a number of the at least one defect areas;
calculating a plurality of second defect scores by summing first defect scores in a range corresponding to a predetermined reference window in the first defect matrix; and
generating a defect image by extracting an image corresponding to the predetermined reference window from the target image based on the plurality of second defect scores.

### Claim 2 (depends on 1)

The method of claim 1, further comprising inputting the defect image as input data into a network function and generating surface defect information,
wherein the network function is trained to output the surface defect information using an image with a size corresponding to the predetermined reference window as input data.

### Claim 3 (depends on 1)

The method of claim 1, wherein the element of the first defect matrix is determined according to the number of the at least one defect areas detected from the target image at a position corresponding to the element.

### Claim 4 (depends on 1)

The method of claim 1, wherein the calculating of the plurality of second defect score is performed by calculating the second defect score, which is the sum of the first defect scores of the first defect matrix corresponding to the predetermined reference window, while moving the predetermined reference window with respect to the first defect matrix, and
wherein the generating of the defect image is performed by extracting the image corresponding to a position of the predetermined reference window with a largest second defect score from the target image.

### Claim 5 (depends on 1)

The method of claim 1, further comprising generating a second defect matrix by applying a standard deviation for each local area of the target image to the first defect matrix,
wherein the calculating of the plurality of second defect score is performed on the second defect matrix with which the first defect matrix is replaced.

### Claim 6 (depends on 5)

The method of claim 5, wherein the generating of the second defect matrix includes generating a standard deviation matrix by calculating the standard deviation for each the local area from the target image and summing weights of the first defect matrix and the standard deviation matrix.

### Claim 7 (depends on 5)

The method of claim 5, further comprising generating a third defect matrix by removing an element corresponding to a non-defect area from the second defect matrix,
wherein the calculating of the plurality of second defect score is performed on the third defect matrix with which the second defect matrix is replaced.

### Claim 8 (depends on 7)

The method of claim 7, wherein the generating of the third defect matrix includes generating the non-defect area having the size corresponding to the target image and representing at least one of background and padding from the target image, and performing an AND operation on the non-defect matrix and the first defect matrix.

### Claim 9 (depends on 5)

The method of claim 5, wherein the detecting of the defect area includes generating boundary value information from the target image, generating boundary direction information from the target image, selecting on a boundary value information which is greater than or equal to a predetermined critical value based on the boundary value information and the boundary direction information, and detecting the defect area based on the selected boundary value information and corresponding boundary direction information.

### Claim 10 (depends on 1)

The method of claim 1, wherein the detecting of the at least one defect area, the generating of the first defect matrix, the calculating of the plurality of second defect scores, and the generating of the defect image are performed when at least one of a horizontal size and a vertical sizes of the target image is larger than that of the predetermined reference window.

### Claim 11 (depends on 1)

The method of claim 1, further comprising adding padding to a periphery of the target image so that the target image corresponds to the predetermined reference window when at least one of a horizontal size and a vertical sizes of the target image is smaller than that of the predetermined reference window.

### Claim 12 (depends on 1)

A computer program stored in a non-transitory recording medium to execute the method of claim 1.

### Claim 13

An apparatus for detecting a surface defect, comprising:
a memory in which a program for detecting a surface defect is stored; and
a processor configured to acquire a target image, detect at least one defect area from the target image, generate a first defect matrix having a size corresponding to the target image and an element that is a first defect score calculated based on a number of at least one defect areas, calculate a plurality of second defect scores by summing first defect scores in a range corresponding to a predetermined reference window in the first defect matrix, and extract an image corresponding to the predetermined reference window from the target image based on the plurality of second defect score to generate a defect image.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein the processor is further configured to generate a second defect matrix by applying a standard deviation for each local area of the target image to the first defect matrix, and
calculates the plurality of second defect scores using the second defect matrix with which the first defect matrix is replaced.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the processor is further configured to generate a third defect matrix by removing an element corresponding to a non-defect area from the second defect matrix, and
calculate the plurality of second defect scores using the third defect matrix with which the second defect matrix is replaced.
