CN108230538B - Paper money identification method, device, equipment and storage medium - Google Patents

Paper money identification method, device, equipment and storage medium Download PDF

Info

Publication number
CN108230538B
CN108230538B CN201711490302.1A CN201711490302A CN108230538B CN 108230538 B CN108230538 B CN 108230538B CN 201711490302 A CN201711490302 A CN 201711490302A CN 108230538 B CN108230538 B CN 108230538B
Authority
CN
China
Prior art keywords
preset
character
area
rectangular frame
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711490302.1A
Other languages
Chinese (zh)
Other versions
CN108230538A (en
Inventor
赵玉民
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Original Assignee
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd, Shenzhen Yihua Financial Intelligent Research Institute filed Critical Shenzhen Yihua Computer Co Ltd
Priority to CN201711490302.1A priority Critical patent/CN108230538B/en
Publication of CN108230538A publication Critical patent/CN108230538A/en
Application granted granted Critical
Publication of CN108230538B publication Critical patent/CN108230538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Inspection Of Paper Currency And Valuable Securities (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a paper currency identification method, a device, equipment and a storage medium. The banknote authentication method includes: acquiring a binary image of the paper money to be authenticated; determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as an area to be detected through a preset matching mode; the preset character template is obtained according to a binary image of a preset character area in the standard paper money; according to the preset character template, matching of a single preset character in the area to be detected is carried out, and the position distribution of at least two preset characters in the area to be detected is determined; and when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money. The accuracy rate of identifying whether the paper money is spliced paper money is improved.

Description

Paper money identification method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to an image processing technology, in particular to a method, a device, equipment and a storage medium for identifying paper money.
Background
The paper money may be broken in the circulation process, and the paper money may be spliced intentionally by people.
In the prior art, the banknote is authenticated by determining the position distribution of preset characters in the banknote to be authenticated one by one after selecting a plurality of preset characters for authenticating the banknote.
However, the step of determining the position distribution of the preset characters in the paper money to be authenticated one by one is complicated. And the position distribution of the preset characters in the paper money to be authenticated is determined one by one, so that the relative position precision between the preset characters is reduced, the adaptability to noise is weak, and the accuracy of whether the paper money to be authenticated is spliced is influenced.
Disclosure of Invention
The embodiment of the invention provides a paper currency identification method, a device, equipment and a storage medium, which are used for improving the accuracy of identifying whether paper currency is spliced paper currency.
In a first aspect, an embodiment of the present invention provides a banknote authentication method, including:
acquiring a binary image of the paper money to be authenticated;
determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as an area to be detected through a preset matching mode; the preset character template is obtained according to a binary image of a preset character area in the standard paper money;
according to the preset character template, matching of a single preset character in the area to be detected is carried out, and the position distribution of at least two preset characters in the area to be detected is determined;
and when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money.
Optionally, before determining, in the binary image, an area with the highest matching degree with the preset character template as an area to be checked in a preset matching manner, the method further includes:
acquiring a binary image of the preset character area in the standard paper money as the preset character template; the preset character area comprises at least two preset characters;
acquiring size information of a circumscribed rectangular frame of each preset character and position distribution information of the circumscribed rectangular frame in the preset character area, and adding the size information and the position distribution information to template information;
determining a position rectangular frame of the preset character according to the circumscribed rectangular frame and a preset selection mode, wherein the position rectangular frame includes the corresponding circumscribed rectangular frame, and the area of the position rectangular frame is larger than that of the corresponding circumscribed rectangular frame;
and acquiring the size information of the position rectangular frame of each preset character and the position distribution information of the position rectangular frame in the preset character area, and adding the size information and the position distribution information to template information.
Optionally, the determining, in the binary image of the banknote to be authenticated, an area with the highest matching degree with the preset character template as an area to be inspected by a preset matching mode includes:
moving the preset character template in the binary image of the paper money to be authenticated according to a preset step length and a movement track;
determining the matching degree of the preset character template at each position in the binary image of the paper money to be authenticated; calculating the difference value between the number of character pixels in the external rectangular frame of each preset character and the number of character pixels between the external rectangular frame and the position rectangular frame of each preset character, and summing the difference values corresponding to all the preset characters to obtain the matching degree; or acquiring the number of points of character pixels in the external rectangular frame of each preset character, and summing the number of points of character pixels in the external rectangular frame of all the preset characters to serve as the matching degree;
and determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected.
Optionally, according to the preset character template, the matching of a single preset character is performed in the region to be checked, and at least two position distributions of the preset character in the region to be checked are determined, including:
traversing and matching or snapshot matching pixels in the circumscribed rectangular frames of at least two preset characters in the preset character template with the region to be detected;
and taking the area with the highest matching degree in the area to be detected as the position distribution of at least two preset characters in the area to be detected.
Optionally, the difference between the position distribution of the at least two preset characters in the to-be-detected region and the position distribution of the at least two preset characters in the preset character template includes:
the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the column direction; and/or
The position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the row direction;
the preset allowable range is based on the adjacency relation of at least two preset characters.
Optionally, the matching of a single preset character is performed in the region to be checked according to the preset character template, and after determining the position distribution of at least two preset characters in the region to be checked, the method further includes:
if the preset character is penetrated by a safety line, acquiring the number of points of character pixels between a circumscribed rectangular frame and a position rectangular frame of the preset character penetrated by the safety line in the area to be detected;
and when the number of points of character pixels between the external rectangular frame and the position rectangular frame of the preset character, which are penetrated by the safety line, is larger than a preset threshold value, the preset character is removed and is not used as an identification basis.
In a second aspect, an embodiment of the present invention further provides a banknote evaluation apparatus, including:
the paper money image acquisition module is used for acquiring a binary image of the paper money to be identified;
the to-be-detected region determining module is used for determining a region with the highest matching degree with the preset character template in the binary image of the paper money to be identified as a to-be-detected region in a preset matching mode; the preset character template is obtained according to a binary image of a preset character area in the standard paper money;
the character distribution determining module is used for matching a single preset character in the area to be detected according to the preset character template and determining the position distribution of at least two preset characters in the area to be detected;
and the identification result determining module is used for determining the paper currency to be identified as normal paper currency when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range.
Optionally, the banknote validator further comprises:
a preset character template obtaining module, configured to obtain a binary image of the preset character region in the standard banknote as the preset character template before determining, in the binary image, a region with a highest matching degree with the preset character template as a region to be detected through a preset matching manner; the preset character area comprises at least two preset characters;
the first template information adding module is used for acquiring the size information of the circumscribed rectangular frame of each preset character and the position distribution information of the circumscribed rectangular frame in the preset character area, and adding the size information and the position distribution information to the template information;
the character rectangular frame selecting module is used for determining a position rectangular frame of the preset character according to the circumscribed rectangular frame and a preset selecting mode, wherein the position rectangular frame includes the corresponding circumscribed rectangular frame, and the area of the position rectangular frame is larger than that of the corresponding circumscribed rectangular frame;
and the second template information adding module is used for acquiring the size information of the position rectangular frame of each preset character and the position distribution information of the position rectangular frame in the preset character area, and adding the size information and the position distribution information to the template information.
Optionally, the banknote validator further comprises:
the character pixel point number obtaining module is used for matching a single preset character in the area to be detected according to the preset character template, determining the position distribution of at least two preset characters in the area to be detected, and obtaining the point number of the character pixel between the external rectangular frame and the position rectangular frame of the preset character which is penetrated by the safety line in the area to be detected if the preset character is penetrated by the safety line;
and the character removing module is used for removing the preset character when the number of points of character pixels between the external rectangular frame and the position rectangular frame of the preset character, which are penetrated by the safety line, is larger than a preset threshold value, and the preset character is not used as an identification basis.
Optionally, the module for determining the region to be detected includes:
the template moving unit is used for moving the preset character template in the binary image of the paper money to be authenticated according to a preset step length and a moving track;
the template matching degree determining unit is used for determining the matching degree of the preset character template at each position in the binary image of the paper money to be authenticated; calculating the difference value between the number of character pixels in the external rectangular frame of each preset character and the number of character pixels between the external rectangular frame and the position rectangular frame of each preset character, and summing the difference values corresponding to all the preset characters to obtain the matching degree; or acquiring the number of points of character pixels in the external rectangular frame of each preset character, and summing the number of points of character pixels in the external rectangular frame of all the preset characters to serve as the matching degree;
the to-be-detected region determining unit is used for determining a region with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the to-be-detected region;
optionally, the character distribution determining module includes:
the character matching unit is used for performing traversal matching or snapshot matching on pixels in circumscribed rectangular frames of at least two preset characters in the preset character template and the area to be detected;
the character distribution determining unit is used for taking the area with the highest matching degree in the area to be checked as the position distribution of at least two preset characters in the area to be checked;
optionally, the difference between the position distribution of the at least two preset characters in the to-be-detected region and the position distribution of the at least two preset characters in the preset character template includes:
the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the column direction; and/or
The position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the row direction;
optionally, the preset allowable range is based on an adjacent relation between at least two preset characters.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
the image sensor is used for acquiring an image of the paper money;
when executed by the one or more processors, cause the one or more processors to implement a banknote validation method as provided in the first aspect.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions for performing the banknote validation method as provided in the first aspect when executed by a computer processor.
The embodiment of the invention integrally positions the distribution of the characters by determining the positioning of the preset character template in the paper money to be authenticated, solves the problems that the position distribution of the preset characters in the paper money to be authenticated is determined one by one, the relative position precision between the characters is low, and the adaptability to noise is weak, and realizes the effect of improving the accuracy of authenticating whether the paper money is spliced paper money.
Drawings
FIG. 1a is a flow chart of a method of banknote authentication in accordance with a first embodiment of the present invention;
FIG. 1b is a schematic diagram of a RMB default character template according to a first embodiment of the present invention;
FIG. 1c is a schematic diagram of a RMB default character template according to a first embodiment of the present invention;
FIG. 1d is a schematic diagram of another RMB default character template in the first embodiment of the present invention;
FIG. 2 is a flow chart of a banknote validation method according to a second embodiment of the present invention;
FIG. 3 is a flow chart of a banknote evaluation method according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a banknote authentication method according to a fourth embodiment of the present invention;
FIG. 5 is a schematic structural view of a banknote evaluation apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus in the sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1a is a flowchart of a banknote authentication method according to an embodiment of the present invention, where the present embodiment is applicable to a case where banknotes are spliced and authenticated, for example, a depositing and dispensing machine performs an abnormal authentication on deposited banknotes, and the method may be executed by a banknote authentication apparatus, where the apparatus may be implemented by software and/or hardware, and specifically includes the following steps:
and step 110, acquiring a binary image of the paper money to be authenticated.
The method comprises the steps of obtaining gray level images of two sides of paper money to be identified through an image sensor, selecting the gray level images of a preset side, and converting the gray level images into binary images. The preset face is a face including preset characters for authenticating a bill.
And step 120, determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected through a preset matching mode.
The preset character template is obtained according to the binary image of the preset character area in the standard paper currency. The preset character template comprises at least two preset characters. The position of the at least two preset characters as a whole in the banknote to be authenticated is determined. Optionally, before determining, in a preset matching manner, a region with the highest matching degree with a preset character template in the binary image as a region to be checked, the method further includes: acquiring a binary image of the preset character area in the standard paper money as the preset character template; the preset character area comprises at least two preset characters; acquiring size information of a circumscribed rectangular frame of each preset character and position distribution information of the circumscribed rectangular frame in the preset character area, and adding the size information and the position distribution information to template information; determining a position rectangular frame of the preset character according to the circumscribed rectangular frame and a preset selection mode, wherein the position rectangular frame includes the corresponding circumscribed rectangular frame, and the area of the position rectangular frame is larger than that of the corresponding circumscribed rectangular frame; and acquiring the size information of the position rectangular frame of each preset character and the position distribution information of the position rectangular frame in the preset character area, and adding the size information and the position distribution information to template information. Taking the fifth set of rmb as an example, the binary image of the side of the standard banknote printed with the "chinese renb" character is obtained, and as shown in fig. 1b, the region of the "chinese renb" character is selected as the preset character template. As shown in fig. 1c, the circumscribed rectangle frame of each character of "chinese people bank" may be selected in advance, and fig. 1c shows the position rectangle frame of the "middle" character, wherein it can be seen that the circumscribed rectangle frame of the "middle" character is located inside the position rectangle frame, and the coverage area of the circumscribed rectangle frame is smaller than that of the position rectangle frame. The circumscribed rectangle may be slightly larger than the actual width and height of the preset character, for example, the circumscribed rectangle may have a width and height both larger than the actual width and height of the preset character by two pixels. The vertex of the upper left corner of the circumscribed character frame of the Chinese character can be selected as the origin to establish a coordinate system, so that the relative position of the circumscribed rectangle frame of each preset character in the preset character template can be determined, and the relative position of the preset character in the preset character template can also be determined. The template information contains a range in which the character can be moved up, down, left, and right, for example, plus or minus 2 pixels, in addition to the vertex at the upper left corner of each character. Especially for the pre-set characters that are greatly affected by the background, for example, the character "man" that the security thread crosses in fig. 1 d.
And step 130, according to a preset character template, matching a single preset character in the region to be detected, and determining the position distribution of at least two preset characters in the region to be detected.
Wherein after determining the position of the at least two preset characters as a whole in the banknote to be authenticated, the position distribution of the individual preset characters needs to be determined accurately. Therefore, according to the two-dimensional matrix of the character pixels and the non-character pixels of a single preset character in the preset character template, taking fig. 1d as an example, the white pixels are character pixels and correspond to pixels below the gray level boundary value in the gray level image; the black pixels are non-character pixels and correspond to pixels which are larger than the gray boundary value in the gray image; and matching in the region to be detected, and determining the position distribution of at least two preset characters in the region to be detected.
And 140, when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money.
The position distribution of at least two preset characters in the region to be detected can be based on one preset character, and the relative positions of other preset characters and the reference preset character; the position distribution of the at least two preset characters in the preset character template may be relative positions between one preset character as a reference and other preset characters and the reference preset character. When the difference between the relative positions of the preset characters in the to-be-detected area and the preset character template is smaller than or equal to a preset allowable range, determining that the paper money to be identified is normal paper money, and understanding that the paper money to be identified is non-spliced paper money. In one embodiment of the present invention, further comprising: and when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template is out of a preset allowable range, determining the paper money to be identified as abnormal paper money. That is, the difference between the relative positions of the preset characters is larger than the preset allowable range, the paper money to be authenticated is determined to be spliced paper money, and accordingly, an abnormal paper money warning can be sent to the user, and the abnormal paper money can be separated.
According to the technical scheme, the positioning of the preset character template in the paper money to be authenticated is determined, the distribution of the characters is integrally positioned, the problem that the position distribution of the preset characters in the paper money to be authenticated is determined one by one, the relative position precision between the characters is low, the adaptability to noise is weak is solved, and the effect of improving the accuracy of whether the paper money to be authenticated is spliced is achieved.
Example two
Fig. 2 is a flowchart of a banknote authentication method according to a second embodiment of the present invention, and the technical solution of the second embodiment is further detailed on the basis of the above technical solution, and the method includes:
and step 210, acquiring a binary image of the paper money to be authenticated.
And step 220, moving a preset character template in the binary image of the paper money to be identified according to a preset step length and a movement track.
The preset character template can move pixel by pixel according to a moving track from left to right and from top to bottom. The preset step length can be adjusted, for example, 2 pixels can also be used as the preset step length, and the preset character template is moved in the binary image of the paper money to be authenticated.
And step 230, determining the matching degree of the preset character template at each position in the binary image of the paper money to be authenticated.
Calculating the difference value between the number of character pixels in the external rectangular frame of each preset character and the number of character pixels between the external rectangular frame and the position rectangular frame of each preset character, and summing the difference values corresponding to all the preset characters to obtain the matching degree; or acquiring the number of points of the character pixels in the external rectangular frame of each preset character, and summing the number of points of the character pixels in the external rectangular frame of all the preset characters to serve as the matching degree. Optionally, in order to improve efficiency, the process of motion matching may pre-calculate an integral image of the whole binary image to speed up the calculation process.
And 240, determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected.
And 250, matching single preset characters in the region to be detected according to a preset character template, and determining the position distribution of at least two preset characters in the region to be detected.
And 260, when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money.
According to the technical scheme, the matching degree of the whole preset character is determined according to the matching condition of the single preset character, and the matching efficiency of the preset character template is improved.
EXAMPLE III
Fig. 3 is a flowchart of a banknote identifying method according to a third embodiment of the present invention, and the technical solution of the third embodiment is further detailed on the basis of the above technical solution, and the method includes:
and step 310, acquiring a binary image of the paper money to be authenticated.
And 320, determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected through a preset matching mode.
And 330, performing traversal matching or snapshot matching on pixels in the circumscribed rectangular frames of at least two preset characters in the preset character template and the to-be-detected region.
The method comprises the steps of forming a two-dimensional matrix by pixels in an external rectangular frame of a preset character, and comparing the similarity of the two-dimensional matrix and pixels of an area to be detected, namely matching the two-dimensional matrix with the area to be detected. Optionally, the two-dimensional matrix of all the same types that the region to be inspected includes can be matched, the pixel in the external rectangular frame of the preset character can also be extracted to form the two-dimensional matrix, the pixel point is extracted from the region to be inspected in the same pixel point extraction mode, the two-dimensional matrix of a plurality of the same types is formed, and then the matching is carried out.
And 340, taking the area with the highest matching degree in the to-be-detected area as the position distribution of at least two preset characters in the to-be-detected area.
The position distribution of a single preset character in the area to be detected is determined through the matching of at least two preset characters in the area to be detected.
And 350, when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money.
The position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the column direction; and/or the position difference between the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template in the row direction; the preset allowable range is based on the adjacency relation of at least two preset characters. For example, if two preset characters are adjacent characters, the preset allowable range is relatively small; if two preset characters are not adjacent characters, with other preset characters in between, the preset allowable range is relatively large, and the larger the number of preset characters in between, the larger the preset allowable range is relatively.
According to the technical scheme of the embodiment, the single preset character is subjected to snapshot matching, so that the technical speed can be increased, the time consumption is reduced, and the real-time identification requirement is met.
Example four
Fig. 4 is a flowchart of a banknote identifying method according to a fourth embodiment of the present invention, where the technical solution of the present embodiment is further detailed on the basis of the above technical solution, and the method includes:
and step 410, acquiring a binary image of the paper money to be authenticated.
And step 420, determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected through a preset matching mode.
And 430, matching single preset characters in the region to be checked according to a preset character template, and determining the position distribution of at least two preset characters in the region to be checked.
And step 440, if the preset character is penetrated by the safety line, acquiring the number of points of character pixels between the external rectangular frame and the position rectangular frame of the preset character penetrated by the safety line in the region to be detected.
If the security thread in the banknote passes through the preset character, in the binary image, the pixel corresponding to the security thread may be the same as the pixel of the preset character, as shown in fig. 1d, the character "man" that the security thread passes through, and the white pixel corresponding to the security thread, and the white pixel corresponding to the "man" are also the same. Thus, the security thread interferes with the predetermined characters it passes through.
And 450, when the number of points of the character pixels between the external rectangular frame and the position rectangular frame of the preset character which is penetrated by the safety line is larger than a preset threshold value, eliminating the preset character without being used as an identification basis.
If the number of points of the character pixels (white pixels in fig. 1 d) between the circumscribed rectangular frame and the position rectangular frame of the preset character is greater than the preset threshold, it indicates that the influence of the security line on the preset character is large, and in the subsequent steps, the preset character is not used as the basis for authentication. On the contrary, if the number of points of the character pixels between the external rectangular frame and the position rectangular frame of the preset character is less than or equal to the preset threshold, it indicates that the influence of the security line on the preset character is small, and the preset character can be reserved as an authentication basis. In the fifth set of rmb, the security thread generally passes through "people" or "people", so that both characters of "people" and "people" are judged, and according to the relationship between the number of character pixels between the external rectangular frame and the position rectangular frame and the preset threshold value, the characters are selected to be reserved, and if the characters do not meet the conditions, the characters are all removed. Optionally, if the to-be-inspected area on the paper money to be authenticated is contaminated, the paper money authentication is also affected, and whether the contaminated preset characters can be used as the authentication basis or not needs to be judged.
And 460, when the difference between the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money.
According to the technical scheme, whether the preset characters are suitable to be used as the basis for identifying the paper money is judged, and the influence of pollution on the safety line or the paper money on paper money identification is reduced.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a banknote validation apparatus according to a fifth embodiment of the present invention, which is capable of executing a method according to any method embodiment of the present invention, and has corresponding functional modules and beneficial effects of the executing method. The banknote authentication device includes:
a banknote image obtaining module 510, configured to obtain a binary image of a banknote to be authenticated;
the to-be-detected region determining module 520 is configured to determine, in a preset matching manner, a region with the highest matching degree with the preset character template in the binary image of the banknote to be authenticated as a to-be-detected region; the preset character template is obtained according to a binary image of a preset character area in the standard paper money;
a character distribution determining module 530, configured to perform matching of a single preset character in the region to be checked according to the preset character template, and determine position distribution of at least two preset characters in the region to be checked;
and the identification result determining module 540 is used for determining the paper currency to be identified as normal paper currency when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range.
According to the technical scheme, the positioning of the preset character template in the paper money to be authenticated is determined, the distribution of the characters is integrally positioned, the problem that the position distribution of the preset characters in the paper money to be authenticated is determined one by one, the relative position precision between the characters is low, the adaptability to noise is weak is solved, and the effect of improving the accuracy of whether the paper money to be authenticated is spliced is achieved.
Optionally, the banknote validator further comprises:
a preset character template obtaining module, configured to obtain a binary image of the preset character region in the standard banknote as the preset character template before determining, in the binary image, a region with a highest matching degree with the preset character template as a region to be detected through a preset matching manner; the preset character area comprises at least two preset characters;
the first template information adding module is used for acquiring the size information of the circumscribed rectangular frame of each preset character and the position distribution information of the circumscribed rectangular frame in the preset character area, and adding the size information and the position distribution information to the template information;
the character rectangular frame selecting module is used for determining a position rectangular frame of the preset character according to the circumscribed rectangular frame and a preset selecting mode, wherein the position rectangular frame includes the corresponding circumscribed rectangular frame, and the area of the position rectangular frame is larger than that of the corresponding circumscribed rectangular frame;
and the second template information adding module is used for acquiring the size information of the position rectangular frame of each preset character and the position distribution information of the position rectangular frame in the preset character area, and adding the size information and the position distribution information to the template information.
Optionally, the banknote validator further comprises:
the character pixel point number obtaining module is used for matching a single preset character in the area to be detected according to the preset character template, determining the position distribution of at least two preset characters in the area to be detected, and obtaining the point number of the character pixel between the external rectangular frame and the position rectangular frame of the preset character which is penetrated by the safety line in the area to be detected if the preset character is penetrated by the safety line;
and the character removing module is used for removing the preset character when the number of points of character pixels between the external rectangular frame and the position rectangular frame of the preset character, which are penetrated by the safety line, is larger than a preset threshold value, and the preset character is not used as an identification basis.
Optionally, the module for determining the region to be detected includes:
the template moving unit is used for moving the preset character template in the binary image of the paper money to be authenticated according to a preset step length and a moving track;
the template matching degree determining unit is used for determining the matching degree of the preset character template at each position in the binary image of the paper money to be authenticated; calculating the difference value between the number of character pixels in the external rectangular frame of each preset character and the number of character pixels between the external rectangular frame and the position rectangular frame of each preset character, and summing the difference values corresponding to all the preset characters to obtain the matching degree; or acquiring the number of points of character pixels in the external rectangular frame of each preset character, and summing the number of points of character pixels in the external rectangular frame of all the preset characters to serve as the matching degree;
the to-be-detected region determining unit is used for determining a region with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the to-be-detected region;
optionally, the character distribution determining module includes:
the character matching unit is used for performing traversal matching or snapshot matching on pixels in circumscribed rectangular frames of at least two preset characters in the preset character template and the area to be detected;
the character distribution determining unit is used for taking the area with the highest matching degree in the area to be checked as the position distribution of at least two preset characters in the area to be checked;
optionally, the difference between the position distribution of the at least two preset characters in the to-be-detected region and the position distribution of the at least two preset characters in the preset character template includes:
the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the column direction; and/or
The position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the row direction;
optionally, the preset allowable range is based on an adjacent relation between at least two preset characters.
EXAMPLE six
Fig. 6 is a schematic structural diagram of an apparatus according to a sixth embodiment of the present invention, as shown in fig. 6, the apparatus includes a processor 60, a memory 61, an input device 62, an output device 63, and an image sensor 64; the number of processors 60 in the device may be one or more, and one processor 60 is taken as an example in fig. 6; the processor 60, the memory 61, the input device 62, the output device 63 and the image sensor 64 in the apparatus may be connected by a bus or other means, which is exemplified in fig. 6.
The memory 61 is a computer-readable storage medium that can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the banknote authentication method in the embodiment of the present invention (for example, the banknote image acquisition module 510, the suspect region determination module 520, the character distribution determination module 530, and the authentication result determination module 540 in the banknote authentication apparatus). The processor 60 implements the above-described banknote validation method by executing software programs, instructions, and modules stored in the memory 61 to thereby execute various functional applications of the apparatus and data processing.
The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 61 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 61 may further include memory located remotely from the processor 60, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 62 may be used to receive entered numeric or character information and to generate key signal inputs relating to user settings and function controls of the apparatus. The output device 63 may include a display device such as a display screen. The image sensor 64 is used to acquire images of the banknote.
EXAMPLE seven
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method of banknote authentication, the method comprising:
acquiring a binary image of the paper money to be authenticated;
determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as an area to be detected through a preset matching mode; the preset character template is obtained according to a binary image of a preset character area in the standard paper money;
according to the preset character template, matching of a single preset character in the area to be detected is carried out, and the position distribution of at least two preset characters in the area to be detected is determined;
and when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money. Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and can also execute the relevant operations in the banknote authentication method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method of authenticating a banknote, comprising:
acquiring a binary image of the paper money to be authenticated;
determining a region with the highest matching degree with a preset character template in the binary image of the paper money to be identified as a region to be detected in a preset matching mode; the preset character template is obtained according to a binary image of a preset character area in the standard paper money;
according to the preset character template, matching of a single preset character in the area to be detected is carried out, and the position distribution of at least two preset characters in the area to be detected is determined;
when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range, determining the paper money to be authenticated as normal paper money;
wherein, according to preset character template carry out the matching of single preset character in waiting to examine the region, confirm at least two preset character is in wait to examine the position distribution in the region, include:
traversing and matching or snapshot matching pixels in the circumscribed rectangular frames of at least two preset characters in the preset character template with the region to be detected;
and taking the area with the highest matching degree in the area to be detected as the position distribution of at least two preset characters in the area to be detected.
2. The method according to claim 1, characterized in that before determining the region with the highest matching degree with the preset character template in the binary image of the paper money to be authenticated as the region to be inspected through a preset matching mode, the method further comprises the following steps:
acquiring a binary image of the preset character area in the standard paper money as the preset character template; the preset character area comprises at least two preset characters;
acquiring size information of a circumscribed rectangular frame of each preset character and position distribution information of the circumscribed rectangular frame in the preset character area, and adding the size information and the position distribution information to template information;
determining a position rectangular frame of the preset character according to the circumscribed rectangular frame and a preset selection mode, wherein the position rectangular frame includes the corresponding circumscribed rectangular frame, and the area of the position rectangular frame is larger than that of the corresponding circumscribed rectangular frame;
and acquiring the size information of the position rectangular frame of each preset character and the position distribution information of the position rectangular frame in the preset character area, and adding the size information and the position distribution information to template information.
3. The method as claimed in claim 2, wherein the step of determining the region with the highest matching degree with the preset character template in the binary image of the paper money to be authenticated as the region to be inspected through a preset matching mode comprises the following steps:
moving the preset character template in the binary image of the paper money to be authenticated according to a preset step length and a movement track;
determining the matching degree of the preset character template at each position in the binary image of the paper money to be authenticated; calculating the difference value between the number of character pixels in the external rectangular frame of each preset character and the number of character pixels between the external rectangular frame and the position rectangular frame of each preset character, and summing the difference values corresponding to all the preset characters to obtain the matching degree; or acquiring the number of points of character pixels in the external rectangular frame of each preset character, and summing the number of points of character pixels in the external rectangular frame of all the preset characters to serve as the matching degree;
and determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected.
4. The method according to claim 1, wherein the difference between the position distribution of the at least two preset characters in the suspected area and the position distribution of the at least two preset characters in the preset character template comprises:
the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the column direction; and/or
The position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the row direction;
the preset allowable range is based on the adjacency relation of at least two preset characters.
5. The method as claimed in claim 1, wherein after said matching of a single preset character in said suspected region according to said preset character template and determining the position distribution of at least two of said preset characters in said suspected region, further comprising:
if the preset character is penetrated by a safety line, acquiring the number of points of character pixels between a circumscribed rectangular frame and a position rectangular frame of the preset character penetrated by the safety line in the area to be detected;
and when the number of points of character pixels between the external rectangular frame and the position rectangular frame of the preset character, which are penetrated by the safety line, is larger than a preset threshold value, the preset character is removed and is not used as an identification basis.
6. A banknote validator comprising:
the paper money image acquisition module is used for acquiring a binary image of the paper money to be identified;
the to-be-detected region determining module is used for determining a region with the highest matching degree with a preset character template in the binary image of the paper money to be identified as a to-be-detected region in a preset matching mode; the preset character template is obtained according to a binary image of a preset character area in the standard paper money;
the character distribution determining module is used for matching a single preset character in the area to be detected according to the preset character template and determining the position distribution of at least two preset characters in the area to be detected;
the identification result determining module is used for determining the paper money to be identified as normal paper money when the difference between the position distribution of at least two preset characters in the to-be-detected area and the position distribution of the preset characters in the preset character template is within a preset allowable range;
wherein the character distribution determining module includes:
the character matching unit is used for performing traversal matching or snapshot matching on pixels in circumscribed rectangular frames of at least two preset characters in the preset character template and the area to be detected;
and the character distribution determining unit is used for taking the area with the highest matching degree in the area to be checked as the position distribution of at least two preset characters in the area to be checked.
7. The apparatus of claim 6, further comprising:
the preset character template acquisition module is used for acquiring the binary image of the preset character area in the standard paper money as the preset character template before determining the area with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the area to be detected through a preset matching mode; the preset character area comprises at least two preset characters;
the first template information adding module is used for acquiring the size information of the circumscribed rectangular frame of each preset character and the position distribution information of the circumscribed rectangular frame in the preset character area, and adding the size information and the position distribution information to the template information;
the character rectangular frame selecting module is used for determining a position rectangular frame of the preset character according to the circumscribed rectangular frame and a preset selecting mode, wherein the position rectangular frame includes the corresponding circumscribed rectangular frame, and the area of the position rectangular frame is larger than that of the corresponding circumscribed rectangular frame;
the second template information adding module is used for acquiring the size information of the position rectangular frame of each preset character and the position distribution information of the position rectangular frame in the preset character area, and adding the size information and the position distribution information to the template information;
the character pixel point number obtaining module is used for matching a single preset character in the area to be detected according to the preset character template, determining the position distribution of at least two preset characters in the area to be detected, and obtaining the point number of the character pixel between the external rectangular frame and the position rectangular frame of the preset character which is penetrated by the safety line in the area to be detected if the preset character is penetrated by the safety line;
the character removing module is used for removing the preset character when the number of points of character pixels between an external rectangular frame and a position rectangular frame of the preset character, which is penetrated by the safety line, is larger than a preset threshold value and is not used as an identification basis;
the module for determining the region to be detected comprises:
the template moving unit is used for moving the preset character template in the binary image of the paper money to be authenticated according to a preset step length and a moving track;
the template matching degree determining unit is used for determining the matching degree of the preset character template at each position in the binary image of the paper money to be authenticated; calculating the difference value between the number of character pixels in the external rectangular frame of each preset character and the number of character pixels between the external rectangular frame and the position rectangular frame of each preset character, and summing the difference values corresponding to all the preset characters to obtain the matching degree; or acquiring the number of points of character pixels in the external rectangular frame of each preset character, and summing the number of points of character pixels in the external rectangular frame of all the preset characters to serve as the matching degree;
the to-be-detected region determining unit is used for determining a region with the highest matching degree with the preset character template in the binary image of the paper money to be identified as the to-be-detected region;
the difference between the position distribution of the at least two preset characters in the to-be-detected region and the position distribution of the at least two preset characters in the preset character template comprises the following steps:
the position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the column direction; and/or
The position distribution of the at least two preset characters in the to-be-detected area and the position distribution of the at least two preset characters in the preset character template are different in the row direction;
the preset allowable range is based on the adjacency relation of at least two preset characters.
8. An apparatus for banknote authentication, characterized in that it comprises:
one or more processors;
storage means for storing one or more programs;
the image sensor is used for acquiring an image of the paper money;
when executed by the one or more processors, cause the one or more processors to implement a banknote validation method as claimed in any one of claims 1 to 5.
9. A storage medium containing computer executable instructions which when executed by a computer processor are for performing a banknote authentication method as claimed in any one of claims 1 to 5.
CN201711490302.1A 2017-12-30 2017-12-30 Paper money identification method, device, equipment and storage medium Active CN108230538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711490302.1A CN108230538B (en) 2017-12-30 2017-12-30 Paper money identification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711490302.1A CN108230538B (en) 2017-12-30 2017-12-30 Paper money identification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108230538A CN108230538A (en) 2018-06-29
CN108230538B true CN108230538B (en) 2020-05-15

Family

ID=62642101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711490302.1A Active CN108230538B (en) 2017-12-30 2017-12-30 Paper money identification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108230538B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111599080B (en) * 2019-02-20 2022-04-12 深圳怡化电脑股份有限公司 Spliced paper money detection method and device, financial machine tool equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000322578A (en) * 1999-05-12 2000-11-24 Sankyo Seiki Mfg Co Ltd Method for preparing template
CN103617673A (en) * 2013-12-10 2014-03-05 江苏国光信息产业股份有限公司 Ultraviolet image characteristic-based check true and false identification system and method
CN105913093A (en) * 2016-05-03 2016-08-31 电子科技大学 Template matching method for character recognizing and processing
CN106469483A (en) * 2016-09-08 2017-03-01 深圳怡化电脑股份有限公司 A kind of method and device of paper money recognition
EP3246722B1 (en) * 2016-05-20 2019-01-09 Fundación IMDEA Nanociencia Systems and methods for obtaining unique identifiers and measuring displacements by sensing and analizing spatial magnetic field variations

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000322578A (en) * 1999-05-12 2000-11-24 Sankyo Seiki Mfg Co Ltd Method for preparing template
CN103617673A (en) * 2013-12-10 2014-03-05 江苏国光信息产业股份有限公司 Ultraviolet image characteristic-based check true and false identification system and method
CN105913093A (en) * 2016-05-03 2016-08-31 电子科技大学 Template matching method for character recognizing and processing
EP3246722B1 (en) * 2016-05-20 2019-01-09 Fundación IMDEA Nanociencia Systems and methods for obtaining unique identifiers and measuring displacements by sensing and analizing spatial magnetic field variations
CN106469483A (en) * 2016-09-08 2017-03-01 深圳怡化电脑股份有限公司 A kind of method and device of paper money recognition

Also Published As

Publication number Publication date
CN108230538A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
CN111382704B (en) Vehicle line pressing violation judging method and device based on deep learning and storage medium
CN107437294B (en) Character segmentation method, device, equipment and storage medium
CN107103683B (en) Paper money identification method and device, electronic equipment and storage medium
CN106952393B (en) Paper money identification method and device, electronic equipment and storage medium
CN107610322B (en) Banknote version identification method and device, electronic equipment and storage medium
CN107180479B (en) Bill identification method, device, equipment and storage medium
CN110378351B (en) Seal identification method and device
US8385612B2 (en) Fingerprint image background detection apparatus and detection method
CN107038794B (en) Method, device and equipment for identifying authenticity of paper money and storage medium
CN107610316B (en) Method and device for detecting defect of paper money and terminal equipment
CN106920318B (en) Method and device for identifying paper money
CN108510639B (en) Paper money counterfeit discriminating method and device, currency detector and storage medium
CN107240185A (en) A kind of crown word number identification method, device, equipment and storage medium
CN110119742A (en) A kind of recognition methods of container number, device and mobile terminal
CN107742357A (en) A kind of recognition methods of paper money number and device
CN107680246B (en) Method and equipment for positioning curve boundary in paper money pattern
CN108230538B (en) Paper money identification method, device, equipment and storage medium
CN106447904B (en) Method and device for identifying paper money
CN110598575A (en) Table layout analysis and extraction method and related device
CN116091503A (en) Method, device, equipment and medium for discriminating panel foreign matter defects
CN108831004B (en) Method and device for determining paper currency crown word number area and automatic deposit and withdrawal equipment
CN108960222B (en) Image binarization method, device, equipment and storage medium
CN112766272A (en) Target detection method, device and electronic system
KR101379782B1 (en) Method and Apparatus for Identifying Money
CN106652168B (en) Method and device for identifying currency value of paper money

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant