CN113269921A - Medium identification method and device, electronic equipment and storage medium - Google Patents

Medium identification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113269921A
CN113269921A CN202110130847.1A CN202110130847A CN113269921A CN 113269921 A CN113269921 A CN 113269921A CN 202110130847 A CN202110130847 A CN 202110130847A CN 113269921 A CN113269921 A CN 113269921A
Authority
CN
China
Prior art keywords
medium
detected
contour feature
pattern
determining
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.)
Granted
Application number
CN202110130847.1A
Other languages
Chinese (zh)
Other versions
CN113269921B (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.)
Nanjing Yihua Information Technology Co ltd
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Original Assignee
Nanjing Yihua Information Technology Co ltd
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
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 Nanjing Yihua Information Technology Co ltd, Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd filed Critical Nanjing Yihua Information Technology Co ltd
Priority to CN202110130847.1A priority Critical patent/CN113269921B/en
Publication of CN113269921A publication Critical patent/CN113269921A/en
Application granted granted Critical
Publication of CN113269921B publication Critical patent/CN113269921B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07DHANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
    • G07D7/00Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency
    • G07D7/20Testing patterns thereon
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07DHANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
    • G07D7/00Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency
    • G07D7/20Testing patterns thereon
    • G07D7/2016Testing patterns thereon using feature extraction, e.g. segmentation, edge detection or Hough-transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Inspection Of Paper Currency And Valuable Securities (AREA)

Abstract

The embodiment of the invention provides a medium identification method, a medium identification device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a target area containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein; acquiring a first contour characteristic point corresponding to a first object by adopting a target area; acquiring a second contour characteristic point corresponding to the first pattern by adopting the target area; adopting the first contour characteristic points to perform sliding matching in the medium to be detected, and judging whether a second object of the medium to be detected is complete; adopting the second contour characteristic points to perform sliding matching in the medium to be detected, and judging whether the number of second patterns of the medium to be detected exceeds a preset threshold value or not; and if the second object is complete and the number of the second patterns exceeds a preset threshold value, determining the second object of the medium to be detected as a normal object. Therefore, the statistical result of a large amount of normal paper money data is not required to be relied on, and the identification effect of the hollowed-out safety line is improved.

Description

Medium identification method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image detection, and in particular, to a medium identification method, apparatus, electronic device, and storage medium.
Background
At present, when anti-counterfeiting inspection is carried out on bank notes, integrity detection and hollowed image-text detection are generally carried out on hollowed safety lines of the bank notes, the integrity detection mode is that a certain continuous blackest window line is sampled and searched in a safety line area, the maximum gray value in the blackest window line is obtained, the mean value of the maximum values of a plurality of sampling lines is obtained, the number of black points smaller than the mean value is counted in the safety line area, and if the requirement of the black point number threshold value is met, the safety line is judged to be a complete safety line. The hollow image-text detection mode is that each row in the safety line is traversed, the jumping points meeting set conditions are marked, the proportion of the jumping points in the total rows is calculated, a large number of normal paper money is used for counting the fluctuation range of the proportion, and if the safety line is detected to be in the normal paper money fluctuation range, the hollow image-text is judged to exist.
However, whether integrity detection or hollowed-out image-text detection is performed, the detection is performed in a threshold value counting mode, the statistical result of a large amount of normal paper money data is needed, the safety line integrity detection is insufficient in response to the situation that some false safety lines with bright and dark segments but not very obvious are detected, the image quality requirement is high by the method for detecting the hollowed-out image-text, the safety line jumping point detection is unstable, and the recognition degree of the hollowed-out image-text is low.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a medium authentication method and a corresponding medium authentication apparatus that overcome or at least partially solve the above problems.
In order to solve the above problems, an embodiment of the present invention discloses a medium identification method, where the medium includes a normal medium and a medium to be detected, and the method includes:
determining a target region containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein;
acquiring a first contour characteristic point corresponding to the first object by adopting the target area;
acquiring a second contour characteristic point corresponding to the first pattern by adopting the target area;
adopting the first contour feature points to perform sliding matching in the medium to be detected, and judging whether a second object of the medium to be detected is complete;
adopting the second contour characteristic points to perform sliding matching in the medium to be detected, and judging whether the number of second patterns of the medium to be detected exceeds a preset threshold value;
and if the second object is complete and the number of the second patterns exceeds a preset threshold value, determining the second object of the medium to be detected as a normal object.
Optionally, the step of acquiring, by using the target region, a first contour feature point corresponding to the first object includes:
carrying out binarization on the target area to obtain a target area binary image;
and acquiring a first contour feature point corresponding to the first object based on the target area binary image.
Optionally, the target region further includes a first background region other than the first object, the first contour feature point includes an object contour feature point and a first background feature point, the object contour feature point is located within the first object, the first background feature point is located within the first background region, and the step of obtaining the first contour feature point corresponding to the first object based on the target region binary map includes:
determining a first number of the object contour feature points and a second number of the first background feature points based on a first preset weight;
and acquiring the object contour characteristic points and the first background characteristic points in the target area binary image by adopting the first quantity and the second quantity.
Optionally, the step of performing sliding matching in the medium to be detected by using the first contour feature point and determining whether the second object of the medium to be detected is complete includes:
adopting the first contour feature points to perform sliding matching in the medium to be detected, and determining a first matching degree between the first contour feature points and the medium to be detected;
determining a first highest matching degree from the first matching degrees;
judging whether the first highest matching degree exceeds a preset first matching degree threshold value or not;
and if the first highest matching degree exceeds a preset first matching degree threshold value, determining that the second object of the medium to be detected is complete.
Optionally, the step of acquiring, by using the target area, a second contour feature point corresponding to the first pattern includes:
determining an object area where a first object is located from the target area;
carrying out partition binarization on the object area according to the preset partition quantity to obtain an object area partition binary image;
and acquiring a second contour feature point corresponding to the first pattern based on the object region partition binary image.
Optionally, the step of determining an object region in which the first object is located from the target region includes:
calculating the sum of the column projection pixels of the target area based on the preset width of the target object, and acquiring the coordinates of a starting area and an ending area corresponding to the minimum column projection pixel;
determining an object area where the first object is located based on the starting area coordinates and the ending area coordinates;
dividing the object region into a plurality of object sub-regions based on the target object width and the pixel height of the first pattern;
and carrying out logarithmic transformation processing on the plurality of object sub-regions to obtain a target object region.
Optionally, the performing a logarithmic transformation on the plurality of object sub-regions to obtain the target object region includes:
respectively carrying out logarithmic transformation on the corresponding object sub-regions by adopting the original gray value, the minimum gray value, the maximum gray value and a preset transformation ratio of each object sub-region to obtain a plurality of target object sub-regions;
and obtaining a target object area by adopting the plurality of target object sub-areas.
Optionally, the second contour feature points include pattern contour feature points and second background feature points, the object region binary map includes a first pattern and a second background region other than the first pattern, the pattern contour feature points are located in the first pattern, the second background feature points are located in the second background region, and the step of obtaining the second contour feature points corresponding to the first pattern based on the object region binary map includes:
determining a third number of the pattern contour feature points and a fourth number of the second background feature points based on a second preset weight;
and acquiring the pattern contour characteristic points and the second background characteristic points in the object region partition binary image by adopting the third quantity and the fourth quantity.
Optionally, the step of determining whether the number of the second patterns of the medium to be detected exceeds a preset threshold includes:
adopting the second contour feature points to perform sliding matching in the plurality of patterns to be detected, and determining a second matching degree between the second contour feature points and the patterns to be detected;
judging whether the second matching degree exceeds a preset second matching degree threshold value or not;
if the second matching degree exceeds a preset second matching degree threshold value, determining the pattern to be detected as a second pattern;
judging whether the number of the second patterns exceeds a preset number threshold value or not;
and if the number of the second patterns exceeds a preset number threshold, determining that the number of the second patterns of the medium to be detected exceeds a preset threshold.
The embodiment of the invention also discloses a medium identification device, wherein the medium comprises a normal medium and a medium to be detected, and the device comprises:
the target area determining module is used for determining a target area containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein;
a first contour feature point acquisition module, configured to acquire, by using the target region, a first contour feature point corresponding to the first object;
a second contour feature point acquisition module, configured to acquire, by using the target region, a second contour feature point corresponding to the first pattern;
the first judging module is used for adopting the first contour characteristic points to perform sliding matching in the medium to be detected and judging whether a second object of the medium to be detected is complete;
the second judging module is used for adopting the second contour characteristic points to perform sliding matching in the medium to be detected and judging whether the number of second patterns of the medium to be detected exceeds a preset threshold value or not;
and the normal object determining module is used for determining the second object of the medium to be detected as the normal object if the second object is complete and the number of the second patterns exceeds a preset threshold value.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the computer program realizes the steps of the medium identification method when being executed by the processor.
Embodiments of the invention also disclose one or more machine-readable storage media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the steps of one or more medium authentication methods as described above.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, a target area containing a first object is determined from an acquired image of a normal medium, so that the area where the first object is located is determined in the acquired image, and the workload of subsequent image processing is reduced, wherein the first object contains a first pattern, a first contour characteristic point corresponding to the first object is acquired by adopting the target area, so that the characteristic of the first object in the normal medium is determined, a second contour characteristic point corresponding to the first pattern is acquired by adopting the target area, so that the characteristic of the first pattern in the normal medium is determined, the first contour characteristic point is adopted to perform sliding matching in the medium to be detected, whether the second object in the medium to be detected is complete is judged, so that whether the second object in the medium to be detected is the same as the first object in the normal medium is judged, the second contour characteristic point is adopted to perform sliding matching in the medium to be detected, and judging whether the number of the second patterns of the medium to be detected exceeds a preset threshold value or not, so as to judge whether the number of the second patterns in the medium to be detected, which is the same as the number of the first patterns in the normal medium, accords with the number of the first patterns in the normal medium or not, and if the second object is complete and the number of the second patterns exceeds the preset threshold value, determining the second object of the medium to be detected as the normal object. Therefore, a large number of statistical results of normal paper money data are not needed, false safety lines with bright and dark sections but not obvious can be effectively identified, the image quality requirement when the hollow-out image-texts are detected is lowered, the identification degree of the hollow-out image-texts is improved, and the identification effect of the hollow-out safety lines is improved.
Drawings
FIG. 1 is a flow chart of the steps of one embodiment of a method of media authentication of the present invention;
FIG. 2 is a schematic illustration of a target area of the present invention;
FIG. 3 is a flow chart of steps in another medium identification method embodiment of the present invention;
FIG. 4 is a schematic illustration of a target object region of the present invention;
fig. 5 is a block diagram showing the structure of an embodiment of a medium authentication apparatus according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flow chart of steps of an embodiment of a medium identification method of the present invention is shown, where the medium includes a normal medium and a medium to be detected, and specifically, the method may include the following steps:
step 101, determining a target area containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein.
Specifically, the medium comprises a normal medium which is confirmed to be normal and a medium to be detected which needs to be authenticated, an image recognition acquisition device is adopted, such as an image sensor, to acquire an image of the normal medium, a target area containing a first object is determined from the acquired image, the first object comprises a specific first pattern, for example, when the medium is a paper currency, the normal medium refers to the paper currency which is authenticated and is determined to be a real paper currency, and the medium to be detected refers to the paper currency which is not authenticated and cannot be determined to be the real paper currency, the first object can be a hollowed safety line on the paper currency, the first pattern can be a hollowed image and text in the hollowed safety line, and the target area can be an area containing the hollowed safety line in the paper currency. As shown in FIG. 2, the cut 2015 edition RMB 100 yuan of hollowed-out safety line is located in the target area.
And step 102, acquiring a first contour feature point corresponding to the first object by using the target area.
After the target area is obtained, a first contour feature point corresponding to the first object may be obtained, where the first contour feature point is a feature point used for representing a shape of the first object, for example, when the first object is a hollowed-out security thread of a banknote, an area formed by the hollowed-out security thread is generally rectangular, four sides of the rectangle are edges of the hollowed-out security thread, and the area where the hollowed-out security thread is located is distinguished from other areas in the target area by the four sides, so that in order to determine the area where the hollowed-out security thread is located from the target area, the first contour feature point is a plurality of feature points capable of representing an edge contour of the hollowed-out security thread, and specifically, a point close to the edge of the hollowed-out security thread may be selected as the first contour feature point in the target area.
And 103, acquiring a second contour feature point corresponding to the first pattern by using the target area.
After the target area is obtained, a second contour feature point corresponding to a first pattern contained in the first object can be obtained, the second contour feature point is a feature point used for representing the shape of the first pattern, for example, the first pattern is a hollowed-out image and text in a hollowed-out safety line of a paper currency, the hollowed-out image and text is a pattern and/or a character located inside the area where the hollowed-out safety line is located, the hollowed-out image and text is distinguished from other areas located inside the hollowed-out safety line by the edge of the hollowed-out image and text, in order to determine the area where the hollowed-out image and text is located, the second contour feature point is a plurality of feature points capable of representing the edge contour of the hollowed-out image and text, and specifically, a point close to the edge of the hollowed-out safety line can be taken as the second contour feature point.
And 104, adopting the first contour feature points to perform sliding matching in the medium to be detected, and judging whether a second object of the medium to be detected is complete.
After the first contour feature point of the normal medium is obtained, the first contour feature point is adopted to perform sliding matching in the medium to be detected, specifically, after the image of the medium to be detected is obtained, the first contour feature point is adopted to continuously slide in the image of the medium to be detected, when the first contour feature point slides, each area of the image of the medium to be detected is matched by the first contour feature point, if the first contour feature point is successfully matched with the area in the image of the medium to be detected, the second object of the medium to be detected can be considered to be the same as the first object in the normal medium, and therefore the second object can be judged to be complete. For example, when the medium to be detected is paper money, the contour feature points of the obtained hollowed-out safety lines of the normal paper money are adopted to perform sliding detection on the image of the paper money to be detected, the first contour feature points are matched with each region on the image of the paper money to be detected, so that whether the hollowed-out safety lines of the paper money to be detected are matched with the first contour feature points of the hollowed-out safety lines of the normal paper money or not is judged, if the first contour feature points and the second contour feature points are matched, the hollowed-out safety lines of the paper money to be detected can be judged to be the same as the hollowed-out safety lines of the normal paper money, and the hollowed-out safety lines of the paper money to be detected are complete hollowed-out safety lines.
And 105, performing sliding matching in the medium to be detected by adopting the second contour feature points, and judging whether the number of the second patterns of the medium to be detected exceeds a preset threshold value.
After the second contour feature points of the normal medium are obtained, the second contour feature points are adopted for sliding matching in the medium to be detected, specifically, for the normal medium, the first object of the normal medium comprises a plurality of first patterns, therefore, the number of the first patterns is an index for judging whether the medium is the normal medium, in order to identify whether the pattern to be detected in the medium to be detected is normal, after the image of the medium to be detected is obtained, the second contour feature points are adopted for continuously sliding in the image of the medium to be detected, each area in the image of the medium to be detected is matched by the second contour feature points, and as the second object of the medium to be detected comprises a plurality of patterns to be detected, each matching is successful, one pattern which is the same as the first pattern of the normal medium, namely, in the medium to be detected can be determined, and recording the number of the determined second patterns, and when the number of the second patterns of the medium to be detected exceeds a preset threshold value, determining that the number of the second patterns of the medium to be detected meets the number requirement of the first patterns in the normal medium. For example, when the medium to be detected is paper money, contour feature points of the hollow images and texts in the hollow safety line of normal paper money are obtained, the contour feature points slide on the image of the paper money to be detected, each region in the image is subjected to matching detection by adopting the contour feature points of the hollow images and texts, if the matching degree of the region in the paper money to be detected and the contour feature points of the hollow images and texts exceeds a preset threshold value, the region of the paper money to be detected can be determined to have the same hollow images and texts as the normal paper money, the number of the hollow images and texts as the same as the normal paper money can be counted, when the number exceeds the preset threshold value, the hollow images and texts of the paper money to be detected can be judged to meet the requirement of the hollow images and texts of the normal paper money, for example, the number of the hollow images and texts of the normal paper money should exceed 20, the threshold value of the number can be set as 20, and the number determined in the paper money to be detected can be counted, and the quantity of the second pictures and texts is the same as the quantity of the hollow pictures and texts of the normal paper money, and when the quantity exceeds 20, the hollow pictures and texts of the paper money to be detected are confirmed to meet the requirements of the hollow pictures and texts of the normal paper money, and the hollow pictures and texts of the paper money to be detected are normal.
And 106, if the second object is complete and the number of the second patterns exceeds a preset threshold value, determining the second object of the medium to be detected as a normal object.
After the second object is determined to be complete and the number of the second patterns exceeds the preset threshold, the second object of the medium to be detected can be determined to be the same as the first object of the normal medium, and therefore the second object can be determined to be the normal object. For example, for paper money, a common method for judging the authenticity of the paper money is to determine whether a hollowed-out security thread of the paper money is normal or not, and whether the hollowed-out security thread is normal or not mainly depends on two aspects, namely whether the hollowed-out security thread is complete or not, that is, the problems of breakage or bending and the like do not exist, and whether hollowed-out graphics and texts located in the hollowed-out security thread are normal or not, that is, whether the pattern and the number of the hollowed-out graphics and texts meet a preset standard or not, so as to judge whether the paper money is a genuine money or not. Therefore, after the fact that the hollowed-out safety line of the paper money to be detected is complete and has no abnormity and the hollowed-out pictures and texts in the hollowed-out safety line meet the standard is determined, the fact that the hollowed-out safety line of the paper money to be detected is normal can be determined.
In the embodiment of the invention, a target area containing a first object is determined from an acquired image of a normal medium, so that the area where the first object is located is determined in the acquired image, the workload of subsequent image processing is reduced, the first object contains a first pattern, a first contour feature point corresponding to the first object is acquired by adopting the target area, so that the feature of the first object in the normal medium is determined, a second contour feature point corresponding to the first pattern is acquired by adopting the target area, so that the feature of the first pattern in the normal medium is determined, the first contour feature point is adopted to perform sliding matching in the medium to be detected, whether the second object in the medium to be detected is complete is judged, so that whether the second object in the medium to be detected is the same as the first object in the normal medium is judged, the second contour feature point is adopted to perform sliding matching in the medium to be detected, and judging whether the number of the second patterns of the medium to be detected exceeds a preset threshold value or not, so as to judge whether the number of the second patterns in the medium to be detected, which is the same as the number of the first patterns in the normal medium, accords with the number of the first patterns in the normal medium or not, and if the second object is complete and the number of the second patterns exceeds the preset threshold value, determining the second object of the medium to be detected as the normal object. Therefore, the statistical result of a large amount of normal paper money data is not needed, false safety lines with bright and dark sections but not obvious can be effectively identified, the image quality requirement when the hollow-out image-texts are detected is lowered, the recognition degree of the hollow-out image-texts is improved, and the overall identification effect of the paper money hollow-out safety lines is improved.
Referring to fig. 3, a flowchart of steps of another embodiment of the medium authentication method of the present invention is shown, and for convenience of description, the present embodiment uses paper money as a medium, which is exemplified, where the medium includes a normal medium and a medium to be detected, that is, includes a normal paper money and a paper money to be detected, the normal paper money is a paper money that has been detected and determined to be genuine, and the paper money to be detected is a paper money that has not been detected and cannot be determined to be genuine, and specifically, the method includes the following steps:
step 201, determining a target area containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein.
The method comprises the steps of determining an area containing a hollowed-out safety line, namely a target area of a first object, from an acquired image of normal paper money, wherein the hollowed-out safety line contains a plurality of hollowed-out pictures and texts, namely a first pattern, for example, for the paper money with the denomination of 100 yuan, the hollowed-out safety line contains a plurality of '100' type hollowed-out pictures and texts.
Step 202, acquiring a first contour feature point corresponding to the first object by using the target area.
In an alternative embodiment of the present invention, the step 202 further includes the following sub-steps:
carrying out binarization on the target area to obtain a target area binary image;
and acquiring a first contour feature point corresponding to the first object based on the target area binary image.
Specifically, the binarization processing may be performed on the target area first, the gray level average value of the target area image is calculated first, then the binarization threshold value required for the binarization processing may be calculated by using the gray level average value and the preset binarization offset value, and finally the binarization threshold value is used to perform binarization on the target area, so as to obtain the target area binary image. For paper money, after binarization is performed on an image containing the hollowed-out safety line, the hollowed-out safety line is compared with regions except the hollowed-out safety line more obviously, the region where the hollowed-out safety line is located is composed of continuous black pixel points, the regions except the hollowed-out safety line are composed of continuous white pixel points, and the contour feature points of the hollowed-out safety line can be traced on the binary image of the image containing the hollowed-out safety line, so that the contour feature points of the hollowed-out safety line can be obtained.
In an optional embodiment of the present invention, the target region further includes a first background region other than the first object, the first contour feature point includes an object contour feature point and a first background feature point, the object contour feature point is located in the first object, the first background feature point is located in the first background region, and the step of obtaining, based on the target region binary image, the first contour feature point corresponding to the first object includes:
determining a first number of the object contour feature points and a second number of the first background feature points based on a first preset weight;
and acquiring the object contour characteristic points and the first background characteristic points in the target area binary image by adopting the first quantity and the second quantity.
In the target area, besides the hollowed-out safety line, the target area further comprises a background area, and when contour feature points of the hollowed-out safety line are obtained, in order to better represent the features of the hollowed-out safety line, a certain number of feature points can be selected from the area where the hollowed-out safety line is located and the background area to jointly form the contour feature points of the hollowed-out safety line. Specifically, for the feature points in the hollow-out safety line region, points which are located in the hollow-out safety line and close to the edge contour of the hollow-out safety line and points which are located inside the hollow-out safety line and not close to the edge contour of the hollow-out safety line can be selected to form object contour feature points. And for the background area except the hollow-out safety line, selecting the characteristic points which are positioned in the background area and are close to the edge contour of the hollow-out safety line as background characteristic points, and then adopting the object contour characteristic points and the background characteristic points as the contour characteristic points of the hollow-out safety line together. In order to increase the discrimination between the complete safety line and the incomplete safety line, the number of the object contour feature points is weighted more heavily than the number of the background feature points, for example, when the total number of the acquired first contour feature points is 192, 128 object contour feature points and 64 background feature points can be acquired. Therefore, the number of the object contour feature points and the number of the background feature points to be acquired can be determined according to the predetermined number weight, and then the corresponding number of the object contour feature points and the corresponding number of the background feature points are acquired in the target area binary image containing the hollowed-out safety line. It should be noted that the number and the weight of the number of the first contour feature points may be set according to the requirement of the user, which is not limited in the embodiment of the present invention.
Step 203, determining an object area where the first object is located from the target area.
Specifically, an object region of the hollowed-out safety line is determined from the target region, that is, a specific start coordinate and an end coordinate of the hollowed-out safety line are determined. For the hollowed-out security thread, the hollowed-out security thread is generally a rectangular area, and the rectangular area consists of the length and the width of a rectangle, compared with the background area without the hollowed-out safety line, the area with the hollowed-out safety line has darker color and smaller pixel value on the image, therefore, the minimum column projection pixel sum can be determined by comparing the sum of the pixel points of each column in the target area containing the hollowed-out safety line, namely the positions of two long edges of a rectangular area where the hollowed-out safety line is positioned, and then coordinates of a plurality of pixel points forming the long edges are obtained, for example, the left side is taken as the starting side of the hollowed-out safety line, and the coordinates of the plurality of pixel points on the long edge of the left side form the initial coordinates of the hollowed-out safety line together, and the coordinates of the plurality of pixel points on the long edge of the right side form the ending coordinates of the hollowed-out safety line together.
In an alternative embodiment of the present invention, the step 203 comprises the following sub-steps:
calculating the sum of the column projection pixels of the target area based on the preset width of the target object, and acquiring the coordinates of a starting area and an ending area corresponding to the minimum column projection pixel;
determining an object area where the first object is located based on the starting area coordinates and the ending area coordinates;
dividing the object area into a plurality of object sub-areas based on the width of the target object and the pixel height of the hollow pattern;
and carrying out logarithmic transformation processing on the plurality of object sub-regions to obtain a target object region.
For the hollowed-out security thread, the width thereof, i.e. the width of the rectangular region, is generally a fixed value, and therefore, based on the width, the column projection pixel sum having the column traversal width as the hollowed-out security thread width may be calculated, specifically, the width of the hollowed-out security thread may be used as the width of the column projection pixel sum, each column projection pixel sum having the hollowed-out security thread width as the width is calculated, the column projection pixel sum refers to the sum of the gray values of the pixels in the same column, the smallest column projection pixel sum is selected from the calculated column projection pixel sums of the plurality of column projection pixel sums having the target object width as the width, the position of the column projection pixel sum corresponding to the region is the object position of the target object, for example, if the width of the security thread is 20 pixels, the width of the column projection pixel sum may be 20 pixels, and the column projection pixel sum having the column projection pixel sum and the width is calculated from the left side of the target region, calculating the column projection pixel sums of 0-19 columns from the 0 th column pixel point, then calculating the column projection pixel sums of 1-20 columns, and so on until all columns in the target area are calculated, wherein the magnetic stripe or the safety line has the deepest color in the target area, namely the column projection pixel sum value where the hollowed-out safety line is located is the minimum, so that the minimum column projection pixel sum is determined from all the column projection pixel sums, and the position of the column projection pixel sum is the position of the hollowed-out safety line. In the hollowed-out safety line, a plurality of hollowed-out images and texts exist in a mode of being sequentially arranged one by one, and the width of the hollowed-out images and texts is the same as that of the hollowed-out safety line, so that the height of a pixel of a single hollowed-out image and text can be used as a length, the width of the hollowed-out safety line is used as a width, the hollowed-out safety line is divided into a plurality of regions, namely object sub-regions, each object sub-region comprises one hollowed-out image and the original gray value, the minimum gray value, the maximum gray value and the preset transformation ratio of each object sub-region are adopted to respectively carry out logarithmic transformation on the plurality of object sub-regions to obtain a processed enhanced hollowed-out safety line image, and as shown in fig. 4, in order to achieve the schematic diagram of the enhanced hollowed-out safety line, the hollowed-out images and texts containing a plurality of 100 characters in the hollowed-out safety line can be seen in the diagram.
In an optional embodiment of the present invention, the performing a logarithmic transformation on the plurality of object sub-regions to obtain the target object region includes:
respectively carrying out logarithmic transformation on the corresponding object sub-regions by adopting the original gray value, the minimum gray value, the maximum gray value and a preset transformation ratio of each object sub-region to obtain a plurality of target object sub-regions;
and obtaining a target object area by adopting the plurality of target object sub-areas.
Specifically, the original gray value, the minimum gray value, the maximum gray value, and the preset transformation ratio of each object sub-region may be adopted to perform logarithmic transformation on the corresponding object sub-regions, so as to obtain a plurality of logarithmically transformed object sub-regions, for example, the sum of the original gray value and a preset value of the object sub-regions is set as a, the sum of the minimum gray value and a preset value of the object sub-regions is set as B, the sum of the maximum gray value and a preset value of the object sub-regions is set as C, the product between the logarithm of a and the preset transformation ratio is subtracted by the product between the logarithm of B and the preset transformation ratio to obtain D, the product between the logarithm of C and the preset transformation ratio is subtracted by the product between the logarithm of B and the preset transformation ratio to obtain E, and finally the product between D and E is multiplied by a preset value to obtain the gray value of the processed object sub-region, and processing each object subregion, and then combining the multiple object subregions into a target object region, wherein the target object region is the processed hollow safety line.
And 204, carrying out partition binarization on the object area according to the preset partition quantity to obtain a partition binary image of the object area.
Because the enhanced hollowed-out safety line comprises a plurality of hollowed-out images and texts, the enhanced hollowed-out safety line can be divided into 8 or 16 regions according to the number of preset regions, binarization is performed after the enhanced hollowed-out safety line is divided into the regions, and the binarization mode refers to the binarization process of the target region in the step 202, which is not described herein any more, so that a region binary image of the enhanced hollowed-out safety line is obtained.
Step 205, obtaining a second contour feature point corresponding to the first pattern based on the object region partition binary image.
Specifically, after the partition binary image with the hollowed-out safety line is obtained, the outline feature points corresponding to the hollowed-out image-text are obtained from the partition binary image.
In an optional embodiment of the present invention, the second contour feature points include pattern contour feature points and second background feature points, the object region binary map includes a first pattern and a second background region other than the first pattern, the pattern contour feature points are located in the first pattern, the second background feature points are located in the second background region, and the step 205 further includes the following sub-steps:
determining a third number of the pattern contour feature points and a fourth number of the second background feature points based on a second preset weight;
and acquiring the pattern contour characteristic points and the second background characteristic points in the object region partition binary image by adopting the third quantity and the fourth quantity.
In the partition binary image for enhancing the hollowed-out safety line, besides the hollowed-out image-text, the partition binary image also comprises a background area, namely a second background area, in the hollowed-out safety line except the hollowed-out image-text. When the outline feature points of the hollow image-text are obtained, in order to better represent the features of the hollow image-text, the feature points which are located in the hollow image-text and close to the outline of the edge of the hollow image-text and the feature points inside the hollow image-text can be obtained and jointly used as the pattern outline feature points, then the second background feature points which are located in a second background area and close to the outline of the edge of the hollow image-text are obtained, and the pattern outline feature points and the second background feature points are jointly used as the outline feature points of the hollow image-text. For example, 64 pattern contour feature points, 64 second background feature points, and 128 second contour feature points may be obtained. Therefore, the number of pattern contour feature points and the number of background feature points to be acquired can be determined according to the predetermined second quantity weight, and then the corresponding number of pattern contour feature points and the second background feature points are acquired in the partitioned binary image. It should be noted that the number and the weight of the number of the second contour feature points may be set according to the requirement of the user, which is not limited in the embodiment of the present invention.
And step 206, performing sliding matching in the medium to be detected by using the first contour feature points, and judging whether a second object of the medium to be detected is complete.
In an optional embodiment of the present invention, the step 206 further includes the following sub-steps:
adopting the first contour feature points to perform sliding matching in the medium to be detected, and determining a first matching degree between the first contour feature points and the medium to be detected;
determining a first highest matching degree from the first matching degrees;
judging whether the first highest matching degree exceeds a preset first matching degree threshold value or not;
and if the first highest matching degree exceeds a preset first matching degree threshold value, determining that the second object of the medium to be detected is complete.
Specifically, the first contour feature points may be adopted to perform sliding matching in a binary image of the to-be-detected banknote including the to-be-detected hollowed-out security line, determine a matching degree of each region in the binary image, determine a matching degree between each region and the first contour feature points, determine a highest matching degree and judge whether the matching degree exceeds a preset matching degree threshold after all regions of the binary image are subjected to sliding matching, where the matching degree threshold may be a matching degree threshold set according to a detection error, and if the matching degree threshold is exceeded, determine that the integrity of the hollowed-out security line of the to-be-detected banknote is consistent with the integrity of the hollowed-out security line of the normal banknote, and the hollowed-out security line is a complete security line.
And step 207, adopting the second contour feature points to perform sliding matching in the medium to be detected, and judging whether the number of the second patterns of the medium to be detected exceeds a preset threshold value.
In an optional embodiment of the present invention, the medium to be detected includes a plurality of patterns to be detected, and the step 207 further includes the following sub-steps:
adopting the second contour feature points to perform sliding matching in the plurality of patterns to be detected, and determining a second matching degree between the second contour feature points and the patterns to be detected;
judging whether the second matching degree exceeds a preset second matching degree threshold value or not;
if the second matching degree exceeds a preset second matching degree threshold value, determining the pattern to be detected as a second pattern;
judging whether the number of the second patterns exceeds a preset number threshold value or not;
and if the number of the second patterns exceeds a preset number threshold, determining that the number of the second patterns of the medium to be detected exceeds a preset threshold.
Specifically, the second contour feature points can be adopted to perform sliding matching on a plurality of to-be-detected hollow-out images and texts in a binary image of the to-be-detected paper money, the matching degree of each region in the binary image is determined, the matching degree between each point in each region and the second contour feature points is determined, namely the second matching degree, whether the second matching degree exceeds a preset second matching degree threshold value or not is judged, the matching degree between the to-be-detected hollow-out images and texts and the second contour feature points exceeds the second matching degree threshold value, the to-be-detected hollow-out images and texts are proved to be normal hollow-out images and texts, namely the second patterns, the number of the normal hollow-out images and texts in the to-be-detected paper money is counted, and if the number of the normal hollow-out images and texts in the to-be-detected paper money exceeds a preset number threshold value, the hollow-out images and texts of the to-be-detected paper money can be considered to be normal.
And 208, if the second object is complete and the number of the second patterns exceeds a preset threshold value, determining the second object of the medium to be detected as a normal object.
After the hollowed-out safety line of the paper money to be detected is determined to be complete and the number of the hollowed-out pictures and texts exceeds the preset threshold value, the hollowed-out safety line of the paper money to be detected can be determined to be the same as the hollowed-out safety line of the normal paper money, namely the hollowed-out safety line of the paper money to be detected is the normal safety line.
In the embodiment of the invention, a target area containing a first object is determined from an acquired image of a normal medium, so that the area where the first object is located is confirmed in the acquired image, the workload of subsequent image processing is reduced, the first object contains a first pattern, a first contour feature point corresponding to the first object is acquired by adopting the target area, so that the feature of the first object in the normal medium is determined, an object area where the first object is located is determined from the target area, the object area is subjected to partition binarization according to a preset partition number, an object area partition binary image is acquired, so that the contour feature point of a hollow image is more conveniently extracted, a second contour feature point corresponding to the first pattern is acquired based on the object area partition binary image, so that the feature of the first pattern in the normal medium is determined, and the first contour feature point is adopted to perform sliding matching in a medium to be detected, judging whether a second object of the medium to be detected is complete or not, so as to judge whether the second object in the medium to be detected is the same as the first object in the normal medium or not, adopting a second contour characteristic point to perform sliding matching in the medium to be detected, judging whether the number of second patterns of the medium to be detected exceeds a preset threshold value or not, judging whether the number of the second patterns in the medium to be detected, which is the same as the number of the first patterns in the normal medium, is in accordance with the number of the first patterns in the normal medium or not, and determining the second object of the medium to be detected as the normal object if the second object is complete and the number of the second patterns exceeds the preset threshold value. Therefore, the discrimination of distinguishing the integrality and the non-integrality of the paper money hollowed-out safety line is improved, the matching effect of the outline characteristic points of the hollowed-out safety line is improved, the false safety line with bright and dark segments which are not very obvious can be effectively identified, the image quality requirement when the hollowed-out image-text is detected is lowered, and the integral identification effect of the paper money hollowed-out safety line is improved.
Referring to fig. 5, a block diagram of a medium authentication apparatus according to an embodiment of the present invention is shown, where the medium includes a normal medium and a medium to be detected, and specifically includes the following modules:
a target area determining module 301, configured to determine a target area containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein;
a first contour feature point obtaining module 302, configured to obtain, by using the target area, a first contour feature point corresponding to the first object;
a second contour feature point obtaining module 303, configured to obtain, by using the target area, a second contour feature point corresponding to the first pattern;
the first judging module 304 is configured to perform sliding matching in the medium to be detected by using the first contour feature point, and judge whether a second object of the medium to be detected is complete;
a second judging module 305, configured to perform sliding matching in the medium to be detected by using the second contour feature points, and judge whether the number of second patterns of the medium to be detected exceeds a preset threshold;
a normal object determining module 306, configured to determine the second object of the medium to be detected as a normal object if the second object is complete and the number of the second patterns exceeds a preset threshold.
In an embodiment of the present invention, the first contour feature point obtaining module 302 includes:
the target area binary image acquisition submodule is used for carrying out binarization on the target area to obtain a target area binary image;
and the first obtaining submodule is used for obtaining a first contour characteristic point corresponding to the first object based on the target area binary image.
In an embodiment of the present invention, the target region further includes a first background region except for the first object, the first contour feature point includes an object contour feature point and a first background feature point, the object contour feature point is located in the first object, the first background feature point is located in the first background region, and the obtaining sub-module further includes:
a first number determination unit, configured to determine a first number of the object contour feature points and a second number of the first background feature points based on a first preset weight;
and the object contour feature point and first background feature point unit is used for acquiring the object contour feature point and the first background feature point in the target area binary image by adopting the first quantity and the second quantity.
In an embodiment of the present invention, the first determining module 304 further includes:
the first matching degree determining submodule is used for performing sliding matching on the first contour characteristic points in the medium to be detected and determining a first matching degree between the first contour characteristic points and the medium to be detected;
a first highest matching degree determining submodule for determining a first highest matching degree from the first matching degrees;
the first matching degree threshold module is used for judging whether the first highest matching degree exceeds a preset first matching degree threshold;
and the first determining module is used for determining that the second object of the medium to be detected is complete if the first highest matching degree exceeds a preset first matching degree threshold value.
In an embodiment of the present invention, the second contour feature point obtaining module 303 includes:
the object area determining submodule is used for determining an object area where a first object is located from the target area;
the object region partition binary image acquisition sub-module is used for carrying out partition binarization on the object region according to the number of preset partitions to obtain an object region partition binary image;
and the second acquisition submodule is used for acquiring a second contour characteristic point corresponding to the first pattern based on the object region partition binary image.
In an embodiment of the present invention, the object region determining sub-module includes:
the calculation unit is used for calculating the sum of the column projection pixels of the target area based on the preset width of the target object and acquiring the coordinates of a starting area and an ending area corresponding to the minimum column projection pixel;
the first object determining unit is used for determining an object area where the first object is located based on the starting area coordinate and the ending area coordinate;
an object sub-region dividing unit configured to divide the object region into a plurality of object sub-regions based on the target object width and the pixel height of the first pattern;
and the target object region acquisition unit is used for carrying out logarithmic transformation processing on the plurality of object sub-regions to obtain a target object region.
In an embodiment of the present invention, the target object region acquiring unit further includes:
the target object sub-region acquisition subunit is used for respectively carrying out logarithmic transformation on the corresponding object sub-regions by adopting the original gray value, the minimum gray value, the maximum gray value and a preset transformation ratio of each object sub-region to obtain a plurality of target object sub-regions;
and the acquisition subunit is used for acquiring the target object region by adopting the target object sub-regions.
In an embodiment of the present invention, the second contour feature points include pattern contour feature points and second background feature points, the object region binary image includes a first pattern and a second background region excluding the first pattern, the pattern contour feature points are located in the first pattern, the second background feature points are located in the second background region, and the second obtaining sub-module further includes:
a second number determination unit configured to determine a third number of the pattern contour feature points and a fourth number of the second background feature points based on a second preset weight;
and the pattern contour feature point and second background feature point unit is used for acquiring the pattern contour feature point and the second background feature point in the object region partition binary image by adopting the third quantity and the fourth quantity.
In an embodiment of the present invention, the medium to be detected includes a plurality of patterns to be detected, and the second determining module 305 includes:
the second matching degree determining submodule is used for performing sliding matching on the second contour characteristic points in the plurality of patterns to be detected and determining second matching degrees between the second contour characteristic points and the patterns to be detected;
the second matching degree threshold judging submodule is used for judging whether the second matching degree exceeds a preset second matching degree threshold;
the second pattern determining submodule is used for determining the pattern to be detected as a second pattern if the second matching degree exceeds a preset second matching degree threshold;
a number threshold judgment submodule for judging whether the number of the second patterns exceeds a preset number threshold;
and the preset threshold value determining submodule is used for determining that the number of the second patterns of the medium to be detected exceeds a preset threshold value if the number of the second patterns exceeds a preset number threshold value.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the computer program realizes the steps of the medium identification method when being executed by the processor.
Embodiments of the invention also disclose one or more machine-readable storage media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the steps of one or more medium authentication methods as described above.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description of the medium identification method, apparatus, electronic device and storage medium provided by the present invention is provided, and the principle and implementation of the present invention are explained by applying specific examples, and the description of the above examples is only used to help understanding the method and core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A method for identifying a medium comprising a normal medium and a medium to be detected, the method comprising:
determining a target region containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein;
acquiring a first contour characteristic point corresponding to the first object by adopting the target area;
acquiring a second contour characteristic point corresponding to the first pattern by adopting the target area;
adopting the first contour feature points to perform sliding matching in the medium to be detected, and judging whether a second object of the medium to be detected is complete;
adopting the second contour characteristic points to perform sliding matching in the medium to be detected, and judging whether the number of second patterns of the medium to be detected exceeds a preset threshold value;
and if the second object is complete and the number of the second patterns exceeds a preset threshold value, determining the second object of the medium to be detected as a normal object.
2. The method of claim 1, wherein the step of acquiring a first contour feature point corresponding to the first object using the target region comprises:
carrying out binarization on the target area to obtain a target area binary image;
and acquiring a first contour feature point corresponding to the first object based on the target area binary image.
3. The method according to claim 2, wherein the target region further includes a first background region other than the first object, the first contour feature points include an object contour feature point and a first background feature point, the object contour feature point is located within the first object, the first background feature point is located within the first background region, and the step of obtaining the first contour feature point corresponding to the first object based on the target region binary map includes:
determining a first number of the object contour feature points and a second number of the first background feature points based on a first preset weight;
and acquiring the object contour characteristic points and the first background characteristic points in the target area binary image by adopting the first quantity and the second quantity.
4. The method according to any one of claims 1 to 3, wherein the step of determining whether the second object of the medium to be detected is complete by using the first contour feature points to perform sliding matching in the medium to be detected comprises:
adopting the first contour feature points to perform sliding matching in the medium to be detected, and determining a first matching degree between the first contour feature points and the medium to be detected;
determining a first highest matching degree from the first matching degrees;
judging whether the first highest matching degree exceeds a preset first matching degree threshold value or not;
and if the first highest matching degree exceeds a preset first matching degree threshold value, determining that the second object of the medium to be detected is complete.
5. The method of claim 1, wherein the step of acquiring, using the target area, second contour feature points corresponding to the first pattern comprises:
determining an object area where a first object is located from the target area;
carrying out partition binarization on the object area according to the preset partition quantity to obtain an object area partition binary image;
and acquiring a second contour feature point corresponding to the first pattern based on the object region partition binary image.
6. The method of claim 5, wherein the step of determining the object region in which the first object is located from the target region comprises:
calculating the sum of the column projection pixels of the target area based on the preset width of the target object, and acquiring the coordinates of a starting area and an ending area corresponding to the minimum column projection pixel;
determining an object area where the first object is located based on the starting area coordinates and the ending area coordinates;
dividing the object region into a plurality of object sub-regions based on the target object width and the pixel height of the first pattern;
and carrying out logarithmic transformation processing on the plurality of object sub-regions to obtain a target object region.
7. The method of claim 6, wherein the step of performing a logarithmic transformation on the plurality of sub-regions of the object to obtain the target object region comprises:
respectively carrying out logarithmic transformation on the corresponding object sub-regions by adopting the original gray value, the minimum gray value, the maximum gray value and a preset transformation ratio of each object sub-region to obtain a plurality of target object sub-regions;
and obtaining a target object area by adopting the plurality of target object sub-areas.
8. The method according to any one of claims 5 to 7, wherein the second contour feature points include pattern contour feature points and second background feature points, the object region binary map includes a first pattern and a second background region other than the first pattern, the pattern contour feature points are located within the first pattern, the second background feature points are located within the second background region, and the step of obtaining the second contour feature points corresponding to the first pattern based on the object region partition binary map includes:
determining a third number of the pattern contour feature points and a fourth number of the second background feature points based on a second preset weight;
and acquiring the pattern contour characteristic points and the second background characteristic points in the object region partition binary image by adopting the third quantity and the fourth quantity.
9. The method according to claim 8, wherein the medium to be detected includes a plurality of patterns to be detected, and the step of determining whether the number of the second patterns of the medium to be detected exceeds a preset threshold value by performing sliding matching in the medium to be detected using the second contour feature points includes:
adopting the second contour feature points to perform sliding matching in the plurality of patterns to be detected, and determining a second matching degree between the second contour feature points and the patterns to be detected;
judging whether the second matching degree exceeds a preset second matching degree threshold value or not;
if the second matching degree exceeds a preset second matching degree threshold value, determining the pattern to be detected as a second pattern;
judging whether the number of the second patterns exceeds a preset number threshold value or not;
and if the number of the second patterns exceeds a preset number threshold, determining that the number of the second patterns of the medium to be detected exceeds a preset threshold.
10. A medium authentication device, the medium including a normal medium and a medium to be detected, the device comprising:
the target area determining module is used for determining a target area containing a first object from the acquired image of the normal medium; the first object includes a first pattern therein;
a first contour feature point acquisition module, configured to acquire, by using the target region, a first contour feature point corresponding to the first object;
a second contour feature point acquisition module, configured to acquire, by using the target region, a second contour feature point corresponding to the first pattern;
the first judging module is used for adopting the first contour characteristic points to perform sliding matching in the medium to be detected and judging whether a second object of the medium to be detected is complete;
the second judging module is used for adopting the second contour characteristic points to perform sliding matching in the medium to be detected and judging whether the number of second patterns of the medium to be detected exceeds a preset threshold value or not;
and the normal object determining module is used for determining the second object of the medium to be detected as the normal object if the second object is complete and the number of the second patterns exceeds a preset threshold value.
11. An electronic device comprising a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the medium authentication method of any one of claims 1 to 9.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the medium authentication method according to any one of claims 1 to 9.
CN202110130847.1A 2021-01-29 2021-01-29 Medium identification method and device, electronic equipment and storage medium Active CN113269921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110130847.1A CN113269921B (en) 2021-01-29 2021-01-29 Medium identification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110130847.1A CN113269921B (en) 2021-01-29 2021-01-29 Medium identification method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113269921A true CN113269921A (en) 2021-08-17
CN113269921B CN113269921B (en) 2023-04-07

Family

ID=77228157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110130847.1A Active CN113269921B (en) 2021-01-29 2021-01-29 Medium identification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113269921B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005242755A (en) * 2004-02-27 2005-09-08 Oki Electric Ind Co Ltd Security thread recognition apparatus
CN106447910A (en) * 2016-09-08 2017-02-22 深圳怡化电脑股份有限公司 Paper money identifying method and apparatus
CN107274543A (en) * 2017-06-23 2017-10-20 深圳怡化电脑股份有限公司 A kind of recognition methods of bank note, device, terminal device and computer-readable storage medium
CN107369243A (en) * 2017-06-23 2017-11-21 深圳怡化电脑股份有限公司 A kind of recognition methods of bank note, device, terminal device and computer-readable storage medium
CN109300220A (en) * 2018-08-29 2019-02-01 广州广电运通金融电子股份有限公司 Paper false distinguishing method, apparatus, equipment and readable storage medium storing program for executing based on safety line
CN109767543A (en) * 2018-12-24 2019-05-17 广州广电运通金融电子股份有限公司 A kind of paper currency detecting method and system
CN111599080A (en) * 2019-02-20 2020-08-28 深圳怡化电脑股份有限公司 Spliced paper money detection method and device, financial machine tool equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005242755A (en) * 2004-02-27 2005-09-08 Oki Electric Ind Co Ltd Security thread recognition apparatus
CN106447910A (en) * 2016-09-08 2017-02-22 深圳怡化电脑股份有限公司 Paper money identifying method and apparatus
CN107274543A (en) * 2017-06-23 2017-10-20 深圳怡化电脑股份有限公司 A kind of recognition methods of bank note, device, terminal device and computer-readable storage medium
CN107369243A (en) * 2017-06-23 2017-11-21 深圳怡化电脑股份有限公司 A kind of recognition methods of bank note, device, terminal device and computer-readable storage medium
CN109300220A (en) * 2018-08-29 2019-02-01 广州广电运通金融电子股份有限公司 Paper false distinguishing method, apparatus, equipment and readable storage medium storing program for executing based on safety line
CN109767543A (en) * 2018-12-24 2019-05-17 广州广电运通金融电子股份有限公司 A kind of paper currency detecting method and system
CN111599080A (en) * 2019-02-20 2020-08-28 深圳怡化电脑股份有限公司 Spliced paper money detection method and device, financial machine tool equipment and storage medium

Also Published As

Publication number Publication date
CN113269921B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN109658584B (en) Bill information identification method and device
US8385612B2 (en) Fingerprint image background detection apparatus and detection method
CN110472479B (en) Finger vein identification method based on SURF feature point extraction and local LBP coding
CN107103683B (en) Paper money identification method and device, electronic equipment and storage medium
CN108510639B (en) Paper money counterfeit discriminating method and device, currency detector and storage medium
CN109389110B (en) Region determination method and device
CN107067533A (en) The method and device that a kind of bank note differentiates
CN108665603B (en) Method and device for identifying currency type of paper money and electronic equipment
CN106898078B (en) Port currency version identification method and device
CN106600812B (en) Paper money identification method and device
CN107680246B (en) Method and equipment for positioning curve boundary in paper money pattern
CN113205633A (en) Method and device for detecting red and blue fibers of bill, electronic equipment and storage medium
CN113435219B (en) Anti-counterfeiting detection method and device, electronic equipment and storage medium
CN108764225B (en) Method and device for identifying transversely spliced paper money and electronic equipment
CN106296975B (en) method and device for identifying face value of dollar paper money
CN113269921B (en) Medium identification method and device, electronic equipment and storage medium
CN106447904B (en) Method and device for identifying paper money
CN106447908B (en) Paper money counterfeit distinguishing method and device
CN112530079B (en) Method, device, terminal equipment and storage medium for detecting bill factors
CN109543554B (en) Bill detection method, device, terminal and computer readable storage medium
CN109300220B (en) Paper authentication method, device and equipment based on safety line and readable storage medium
CN111915792B (en) Method and device for identifying zebra crossing image-text
CN107170109B (en) Paper money watermark authenticity distinguishing method and device
CN108074321B (en) Image boundary extraction method and device for paper money
CN108230538B (en) Paper money identification method, device, equipment and storage medium

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