# US 10,319,172 B2 · Banknote crack detection method and apparatus

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

- Number: US 10,319,172 B2
- Document ID: US10319172B2
- Status: Granted
- Kind: B2
- Application number: 15/543,551
- Filed: 2015-07-13
- Published: 2018-01-25
- Granted: 2019-06-11
- Earliest claimed: 2015-01-26
- Assignees: GRG Banking Equipment Co., Ltd.
- Applicants: GRG Banking Equipment Co., Ltd.
- Inventors: Yuanchao Yu; Rongqiu Wang; Zhanfeng Huang
- Web page: https://patentgrep.com/patent/US10319172B2

## CPC

- G07D 11/237: for detecting transport malfunctions, e.g. jams or misfeeds
- G06T 7/00: Image analysis
- G06T 7/0002: {Inspection of images, e.g. flaw detection}
- G06T 7/0004: {Industrial image inspection}
- G06T 7/11: Region-based segmentation
- G06T 7/187: involving region growing; involving region merging; involving connected component labelling
- G07D 7/181: Testing mechanical properties or condition, e.g. wear or tear (G07D7/16 takes precedence)
- G07D 11/009: {Depositing devices}
- G07D: HANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

A banknote crack detection method and a banknote crack detection apparatus are provided. The banknote crack detection apparatus includes an image collection unit, configured to collect an optical transmission image of an inputted banknote, a pre-processing unit, configured to receive a banknote image signal collected by the image collection unit, and perform foreground region positioning and cutting on the banknote image signal; a crack detection unit, configured to detect whether a crack exists; and a determining unit, configured to determine whether the banknote is qualified according to a detection result of the crack detection unit; and a control unit, configured to control operation of each of the above units.

## Claims

### Claim 1

A banknote crack detection method, comprising:
inputting a to-be-detected banknote;
collecting an optical transmission image of the inputted banknote;
detecting a foreground region of the inputted banknote, cutting the foreground region, and placing the foreground region in a pixel coordinate system;
determining whether there is a crack at an edge of the foreground region;
when it is determined that there is a crack at an edge of the foreground region, accumulating a crack edge length CL and a crack depth CH;
determining whether the crack edge length CL is greater than a preset threshold and whether the crack depth CH is greater than the preset threshold,
determining that the inputted banknote has a crack and rejecting the inputted banknote in a case that the crack edge length CL is greater than the preset threshold or the crack depth CH is greater than the preset threshold; and receiving, the inputted banknote in a case that the crack edge length CL is not greater than the preset threshold and the crack depth CH is not greater than the preset threshold,
wherein determining whether there is a crack at an edge of the foreground region comprises:
a first step of performing an initialization setting to set a starting edge point of the crack as PS, an end edge point of the crack as PE, a crack width as Cw=0, the crack edge length as Cl=0, and the crack depth as Ch=0;
a second step of searching for a crack starting edge point and a crack end edge point in pixels in an edge of the foreground region, and updating PS=P(x01, y01), PE=P(x02, y01), CL=Cl+2 and CH=Ch+1 in a case that points P(x01, y01) and P(x02, y01) meet:
{
x
02
-
x
01
-
1
<=
2
GrayP
⁡
(
x
01
,
y
01
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
02
,
y
01
)
<
gth
⁢
⁢
max
GrayP
M
>
gth
⁢
⁢
min
,
wherein P(x01, y01) indicates a pixel point at a coordinate (x01, y01) of the banknote foreground region image, GrayP (x01, y01) indicates a gray value of the pixel point at the coordinate (x01, y01), x02−x01−1<=2 indicates that a width of a crack region on the foreground region image is no more than 2 pixels, gth max denotes a maximum gray value of an optical transmission image when there is no crack in medium, and is generally set to 200, gth min denotes a minimum gray value of a crack region in the optical transmission image, and is generally set to 250, and PM denotes a point between P(x01, y01) and P(x02, y01);
a third step of determining that
{
x
02
=
x
01
+
2
GrayP
⁡
(
x
01
-
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
02
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
,
when Cw=1, that is there is one pixel point between P(x01, y01) and P(x02, y01),
(1) updating, for the crack in the line, the starting point to PS=P(x01−1, y01+1), the end point to PE=P(x01+1, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=1, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(2) updating, for the crack in the line, the starting point to PS=P(x01+1, y01+1), the end point to PE=P(x02+1, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=1, in a case that
{
GrayP
⁡
(
x
02
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(3) updating, for the crack in the line, the starting point to PS=P(x01−1, y01+1), the end point to PE=P(x02, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=2, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
02
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
and
and
(4) updating, for the crack in the line, the starting point to PS=P(x01, y01+1), the end point to PE=P(x02+1, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=2, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
02
,
y
01
+
1
)
>
gth
⁢
⁢
min
;
a fourth step of determining that
{
x
02
=
x
01
+
3
GrayP
⁡
(
x
01
-
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
02
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
,
when Cw=2, that is there are two pixels between PS and PE,
(1) updating, for the crack in the line, the starting point to PS=P(x01−1, y01+1), the end point to PE=P(x011, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=1, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(2) updating, for the crack in the line, the starting point to PS=P(x01, y01+1), the end point to PE=P(x01+2, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=1, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
2
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(3) updating, for the crack in the line, the starting point to PS=P(x01+1, y01+1), the end point to PE=P(x01+3, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=1, in a case that
{
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
01
+
2
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
3
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(4) updating, for the crack in the line, the starting point to PS=P(x01+2, y01+1), the end point to PE=P(x02+1, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=1, in a case that
{
GrayP
⁡
(
x
01
+
2
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
02
,
y
01
+
1
)
>
gth
⁢
⁢
min
;
(5) updating, for the crack in the line, the starting point to PS=P(x01−1, y01+1), the end point to PE=P(x01+2, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=2, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
2
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(6) updating, for the crack in the line, the starting point to PS=P(x01, y01+1), the end point to PE=P(x01+3, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=2, in a case that
{
GrayP
⁡
(
x
01
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
2
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
3
,
y
01
+
1
)
<
gth
⁢
⁢
max
;
(7) updating, for the crack in the line, the starting point to PS=P(x01+1, y01+1), the end point to PE=P(x02+1, y01+1), the crack edge length to CL=Cl+2, the crack depth to CH=Ch+1, and the crack width to Cw=2, in a case that
{
GrayP
⁡
(
x
01
+
1
,
y
01
+
1
)
<
gth
⁢
⁢
max
GrayP
⁡
(
x
01
+
2
,
y
01
+
1
)
>
gth
⁢
⁢
min
GrayP
⁡
(
x
01
+
3
,
y
01
+
1
)
>
gth
⁢
⁢
min
;
and
determining that the crack does not extend to the line in other cases, and ending the crack detection; and
a fifth step of performing an iterative computation, repeatedly performing the third step in a case that Cw=1, and repeatedly performing the fourth step in a case that Cw=2 until a complete detection for a crack is finished.

### Claim 2 (depends on 1)

The banknote crack detection method according to claim 1, wherein the determining whether there is a crack at an edge of the foreground region comprises:
sequentially determining, for each of adjacent pixel segments of a step length at upper, lower, left and right edges, whether a gray level of each pixel in the pixel segment exceeds a preset gray level threshold, and whether pixel gray gradients at two end points of each of the pixel segments both exceed a preset gradient threshold; and
determining that there is a crack at the edges of the foreground region if the gray level of each pixel in each of the pixel segments exceeds the preset gray level threshold and the pixel gray gradients at two end points of each of the pixel segments both exceed the preset gradient threshold, otherwise, determining that there is no crack at the edges of the foreground region.
