CN111563845A - Bill surface scratch detection method, device, equipment and storage medium - Google Patents

Bill surface scratch detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN111563845A
CN111563845A CN201910080302.7A CN201910080302A CN111563845A CN 111563845 A CN111563845 A CN 111563845A CN 201910080302 A CN201910080302 A CN 201910080302A CN 111563845 A CN111563845 A CN 111563845A
Authority
CN
China
Prior art keywords
image
standard deviation
bill
matrix
transverse
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
CN201910080302.7A
Other languages
Chinese (zh)
Other versions
CN111563845B (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 CN201910080302.7A priority Critical patent/CN111563845B/en
Publication of CN111563845A publication Critical patent/CN111563845A/en
Application granted granted Critical
Publication of CN111563845B publication Critical patent/CN111563845B/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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • 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/181Testing mechanical properties or condition, e.g. wear or tear

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Inspection Of Paper Currency And Valuable Securities (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method, a device and equipment for detecting surface scratch of a bill and a storage medium. The method comprises the following steps: acquiring a gray level image of a bill to be detected, wherein the background texture of the bill to be detected is dense, and the gray level image comprises: an original gray scale image and/or a sharpened gray scale image; processing the gray image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the bill to be detected; and judging whether at least one smooth area with the size larger than a set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area. The method does not depend on color change to distinguish whether the surface of the bill is scratched or not, and is irrelevant to whether characters are stored in a scratching area or not, so that the identification capability of the financial equipment on paper money, deposit receipt, checks and the like is improved, and the workload of manual secondary check is reduced.

Description

Bill surface scratch detection method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a method, a device, equipment and a storage medium for detecting surface scratch of a bill.
Background
Whether the surface of a bill such as a deposit receipt, a check, paper money and the like is scratched or not is detected, and the scratch condition such as smearing, altering, pasting, scratching and the like is facilitated, so that whether the bill is damaged or altered or not is judged.
Generally, whether the scraping phenomenon exists or not can be determined by judging the color change of the area to be detected, for example, the color of the scraping area after scraping is changed from bright to dark or from dark to bright, and then whether the scraping phenomenon exists or not in the area to be detected can be determined by binarization image processing. In addition, the gray level histogram of the area to be detected can be counted, and whether the scraping phenomenon exists in the area to be detected is determined by judging whether the gray level histogram has obvious change.
However, the method of processing a binary image or counting a gray histogram has a great limitation to determine whether the scratch phenomenon exists in the region to be detected. If the colors of the areas to be detected are not greatly different after being coated, the areas to be detected cannot be detected by using a binarization image processing method. Moreover, there may be interference of handwritten characters and printed characters (character position, size, and color are not fixed) in the region to be detected, which may also cause failure of the methods of binarization image processing and gray histogram statistics.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for detecting the scratch of a bill surface, which are used for optimizing a method for detecting whether the bill surface is scratched or not in the prior art, improving the discrimination capability of financial equipment on paper money, deposit receipt, checks and the like and reducing manual secondary check.
In a first aspect, an embodiment of the present invention provides a method for detecting a scratch on a surface of a bill, including:
acquiring a gray image of a bill to be detected, wherein the background texture of the bill to be detected is dense, and the gray image comprises an original gray image and/or a sharpened gray image;
processing the gray image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the bill to be detected;
and judging whether at least one smooth area with the size larger than a set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
In a second aspect, an embodiment of the present invention further provides a device for detecting a scratch on a surface of a bill, including:
the system comprises a gray level image acquisition module, a background image acquisition module and a processing module, wherein the gray level image acquisition module is used for acquiring a gray level image of a bill to be detected, the background texture of the bill to be detected is dense, and the gray level image comprises an original gray level image and/or a sharpened gray level image;
the smooth area acquisition module is used for processing the gray level image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlight connected domain included in the processed image as a smooth area corresponding to the bill to be detected;
and the scraping judging module is used for judging whether at least one smooth area with the size larger than the set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the method for detecting a scratch on a surface of a ticket according to any embodiment of the present invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for detecting scratch on a surface of a ticket according to any embodiment of the present invention.
In the embodiment of the invention, the gray level image of the bill to be detected with dense background texture is processed by adopting the transverse sliding window and/or the longitudinal sliding window to obtain a processed image, at least one non-highlight connected domain is obtained in the processed image to be used as a smooth region corresponding to the bill to be detected, if at least one smooth region with the size larger than the set scraping size threshold exists, the scraping region in the bill to be detected can be confirmed, and the scraping region is at least one smooth region with the size larger than the set scraping size threshold. The bill surface scratch detection method provided by the embodiment of the invention is independent of color change to distinguish whether the scratch exists on the bill surface, and is independent of whether handwritten characters or printed characters exist in a scratch area, so that the identification capability of financial equipment on paper money, deposit receipt, checks and the like is improved, and the workload of manual secondary check is reduced.
Drawings
FIG. 1 is a flow chart of a method for detecting scratch on a surface of a bill according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for detecting scratch on a surface of a bill in a second embodiment of the present invention;
FIG. 3 is a flow chart of a method for detecting scratch on a surface of a bill in a third embodiment of the present invention;
FIG. 4 is a flow chart of a method for detecting scratch on a surface of a bill in a fourth embodiment of the present invention;
FIG. 5 is a flow chart of a method for detecting scratch on a surface of a bill in a fifth embodiment of the present invention;
FIG. 6 is a schematic view of an original gray scale representation of a bill to be inspected according to a fifth embodiment of the present invention;
FIG. 7 is a schematic diagram of a sharpened gray scale of a to-be-detected bill in the fifth embodiment of the invention;
FIG. 8 is a schematic diagram of a horizontal standard deviation difference image of a bill to be detected according to a fifth embodiment of the present invention;
FIG. 9 is a schematic diagram of a longitudinal standard deviation difference image of a bill to be detected according to a fifth embodiment of the present invention;
fig. 10 is a schematic diagram of a binarized transverse standard deviation difference image of a to-be-detected bill in the fifth embodiment of the present invention;
fig. 11 is a schematic diagram of a binarized longitudinal standard deviation difference image of a to-be-detected bill in the fifth embodiment of the present invention;
fig. 12 is a schematic diagram of an intersection image of the binarized transverse standard deviation difference image and the binarized longitudinal standard deviation difference image in the fifth embodiment of the present invention;
FIG. 13 is a schematic illustration of a note surface scratch area marking in a fifth embodiment of the invention;
fig. 14 is a schematic structural diagram of a bill surface scratch detection device in a sixth embodiment of the invention;
fig. 15 is a schematic structural diagram of a computer device in the seventh 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.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a method for detecting scratch on a surface of a bill according to an embodiment of the present invention, which is applicable to detecting whether there is a scratch on a surface of a bill (a banknote, a check, a deposit receipt, etc.), and the method can be implemented by a device for detecting scratch on a surface of a bill according to an embodiment of the present invention, which can be implemented in software and/or hardware, and can be generally integrated into a processor of a financial device (typically, a financial device includes various sorts of sorters, ATMs, etc.). As shown in fig. 1, the method of this embodiment specifically includes:
s110, obtaining a gray image of the bill to be detected, wherein the background texture of the bill to be detected is dense, and the gray image comprises an original gray image and/or a sharpened gray image.
The method for detecting the scratch on the surface of the bill is suitable for the condition that the surface of the bill has dense textures, namely the background textures of the bill to be detected are dense, such as paper money, checks, deposit slips and the like, the surfaces of the bills are not smooth, but have some dense textures, and particularly important anti-counterfeiting areas.
The method comprises the steps of firstly converting an original color image of a bill to be detected into an original gray image, and in order to improve the definition of texture in the original gray image, sharpening the original gray image to obtain a sharpened gray image. In the process of sharpening the original gray image, a specific implementation manner may be that the original gray image is gaussian filtered by using a sliding window of n × n (e.g., 3 × 3 or 5 × 5) to obtain a filtered image, then the filtered image is subtracted by using the original gray image to obtain a contrast image, and the sharpened gray image is obtained by superimposing the original gray image and the contrast image. Compared with the original gray-scale image, the background texture in the sharpened gray-scale image is clearer.
And S120, processing the gray image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlight connected domain included in the processed image as a smooth region corresponding to the bill to be detected.
The background texture of the bill surface can be changed by scraping, the background texture of the scraping area can disappear, the originally unsmooth area can become smooth due to scraping, and then the gray image can be processed, and the smooth area in the processed image can be obtained to serve as the scraping area to be determined.
The smooth area can be understood as an area with small image fluctuation, the fluctuation condition of a group of image data can be measured by using the standard deviation, the larger the standard deviation is, the larger the fluctuation is, and the smaller the standard deviation is, the smaller the fluctuation is. Specifically, the grayscale image may be processed by using a horizontal sliding window and/or a vertical sliding window to obtain a standard deviation grayscale image, and then the standard deviation grayscale image may be subjected to binarization processing.
The standard deviation of the smooth region is small, the gray value of pixel points in a region corresponding to the smooth region in the obtained standard deviation gray image is small, a binarization segmentation threshold value is selected to carry out binarization processing on the standard deviation gray image, the gray value of the pixel points with the small gray value is set to be 0, namely the pixel points are set to be non-highlight pixel points, and the connected region formed by the pixel points with the gray value of 0 is the non-highlight connected region, namely the region corresponding to the smooth region. And then, at least one non-highlighted connected domain included in the processed image is obtained as at least one smooth region corresponding to the bill to be detected, and the at least one smooth region is used as a to-be-determined scratching region.
S130, judging whether at least one smooth area with the size larger than the set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
Since the scraped area with too small surface size of the bill is not easy to be distinguished, and false or missed discrimination may occur, a scraped size threshold is preset to determine the size of the minimum scraped area, where the scraped size threshold may be 5mm × 5mm, which is not specifically limited in this embodiment.
If the smooth areas with the sizes larger than the set scraping size threshold exist, the surface of the bill to be detected can be considered to have the scraping phenomenon, and the smooth areas with the sizes larger than the set scraping size threshold are marked as the scraping areas. If the smooth area with the size larger than the set smearing size threshold value does not exist, the smearing phenomenon on the surface of the bill to be detected can be considered to be absent.
In the embodiment of the invention, the gray level image of the bill to be detected with dense background texture is processed by adopting the transverse sliding window and/or the longitudinal sliding window to obtain a processed image, at least one non-highlight connected domain is obtained in the processed image to be used as a smooth region corresponding to the bill to be detected, if at least one smooth region with the size larger than the set scraping size threshold exists, the scraping region in the bill to be detected can be confirmed, and the scraping region is at least one smooth region with the size larger than the set scraping size threshold. The bill surface scratch detection method provided by the embodiment of the invention is independent of color change to distinguish whether the scratch exists on the bill surface, and is independent of whether handwritten characters or printed characters exist in a scratch area, so that the identification capability of financial equipment on paper money, deposit receipt, checks and the like is improved, and the workload of manual secondary check is reduced.
Example two
Fig. 2 is a flowchart of a bill surface scratch detection method provided in the second embodiment of the present invention, which is embodied on the basis of the above technical solution, wherein a horizontal sliding window or a vertical sliding window is used to process a gray image to obtain a processed image, and at least one non-highlighted connected domain included in the processed image is obtained as a smooth region corresponding to a bill to be detected, specifically:
calculating a standard deviation matrix of the original gray level image or the sharpened gray level image by adopting a transverse sliding window or a longitudinal sliding window;
normalizing the elements in the standard deviation matrix to a set gray scale range to generate a standard deviation image;
carrying out binarization processing on the standard deviation image to obtain a binarization standard deviation image;
and solving at least one non-highlight connected domain included in the binary standard deviation image as a smooth region corresponding to the bill to be detected.
As shown in fig. 2, the method of this embodiment specifically includes:
s210, acquiring an original gray image or a sharpened gray image of the bill to be detected, wherein the background texture of the bill to be detected is dense.
And S220, calculating a standard deviation matrix of the original gray image or the sharpened gray image by adopting a transverse sliding window or a longitudinal sliding window.
And performing operation similar to mean filtering or median filtering on the original gray level image or the sharpened gray level image to obtain a corresponding standard deviation image, so as to measure the smoothness degree of the original gray level image or the sharpened gray level image.
In this embodiment, any one of the original grayscale image and the sharpened grayscale image can be selected for bill surface scratch detection.
Specifically, an mxn sliding window may be selected, the sliding window may slide on the original grayscale image or the sharpened grayscale image, a standard deviation of the grayscale values of mxn pixel points in the sliding window may be calculated, and the standard deviation may be filled in a central position of a corresponding window in the standard deviation matrix, so as to obtain a standard deviation matrix.
The size selection of the sliding window mxn may be adjusted according to an actual image, M and N may be the same natural number or different natural numbers, for example, the size of the sliding window is 3 × 3, 2 × 6, or 6 × 2, etc., a vertical sliding window is an mxn (e.g., 6 × 2) sliding window with M > N, and a horizontal sliding window is an mxn (e.g., 2 × 6) sliding window with M < N. When a sliding window with the size of 3 × 3 is selected to slide on the original gray image or the sharpened gray image, the standard deviation of the gray values of 9 pixels in the sliding window is calculated every time the sliding window slides, and the standard deviation is filled in the center position of the corresponding window (namely the 3 × 3 matrix) in the standard deviation matrix, so that a standard deviation matrix can be obtained.
Typically, according to the background texture trend of the bill to be detected, selecting a sliding window in a matching direction to calculate a standard deviation matrix, so that the difference between values of elements representing a smooth region and elements representing a non-smooth region in the calculated standard deviation matrix is larger, wherein when the background texture of the bill to be detected is a transverse texture, a vertical sliding window can be adopted to calculate the standard deviation matrix of an original gray image or a sharpened gray image; when the background texture of the bill to be detected is longitudinal texture, a standard deviation matrix of the original gray image or the sharpened gray image can be calculated by adopting a transverse sliding window.
And S230, normalizing the values of the elements in the standard deviation matrix to a set gray scale range to generate a standard deviation image.
Normalizing the values of the elements in the standard deviation matrix (namely, the calculated values of the standard deviations) to a set gray scale range of 0-255, wherein the element values are small, the normalized gray scale value is small, the element values are large, and the normalized gray scale value is large, so as to obtain a standard deviation image, namely a gray scale image.
And S240, carrying out binarization processing on the standard deviation image to obtain a binarization standard deviation image.
Selecting a binarization segmentation threshold value, and carrying out binarization processing on the standard deviation image, wherein the binarization segmentation threshold value can be determined according to an empirical value or a statistical value, the binarization segmentation threshold value can be set to be a numerical value between 45 and 55 according to the empirical value, further, the gray value of a pixel point of which the gray value is greater than or equal to the binarization segmentation threshold value in the standard deviation image is set to be 255, the gray value of a pixel point of which the gray value is less than the binarization segmentation threshold value in the standard deviation image is set to be 0, and denoising operation is carried out on the pixel point after binarization operation is carried out, so that the binarization standard deviation image is obtained.
The highlight connected domain in the binarized standard deviation image is an area with an uneven surface corresponding to the bill to be detected (the value of the standard deviation is large), and the non-highlight connected domain is an area with a smooth surface corresponding to the bill to be detected (the value of the standard deviation is small).
And S250, solving at least one non-highlighted connected domain included in the binary standard deviation image as a sliding region corresponding to the bill to be detected.
Specifically, a connected domain can be obtained from a binarized standard deviation image by using a common algorithm, such as Two-Pass scanning and Seed-Filling, where Two-Pass scanning refers to scanning Two-Pass images to find and mark all connected domains existing in the image, and Seed-Filling refers to selecting a foreground pixel point as a Seed, merging foreground pixels adjacent to the Seed into the same pixel set according to Two basic conditions (the same pixel value and adjacent positions) of the connected domain, and the obtained pixel set is a connected domain.
In the implementation of the invention, a non-highlight connected domain in the binary standard deviation image, namely a connected domain with a pixel gray value of 0, is solved according to a Two-Pass or Seed-Filling algorithm.
S260, judging whether at least one smooth area with the size larger than the set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
For those parts of this embodiment that are not explained in detail, reference is made to the aforementioned embodiments, which are not repeated herein.
The technical scheme provided by the embodiment is suitable for the bill to be detected with the unidirectional background texture, the original gray image or the sharpened gray image is processed by adopting the transverse sliding window or the longitudinal sliding window, at least one smooth area corresponding to the bill to be detected is determined, the smooth area with the size larger than the set scraping size threshold is marked as the scraping area, the detection rate of the scraping area on the surface of the bill is improved, the identification capability of financial equipment on paper money, deposit receipt, checks and the like is further improved, and the workload of manual secondary check is reduced.
EXAMPLE III
Fig. 3 is a flowchart of a method for detecting a scratch on a bill surface according to a third embodiment of the present invention, which is embodied on the basis of the foregoing technical solution, where a horizontal sliding window or a vertical sliding window is used to process a grayscale image to obtain a processed image, and at least one non-highlighted connected domain included in the processed image is obtained as a smooth region corresponding to the bill to be detected, where the method specifically includes:
calculating a first standard deviation matrix of the original gray level image and a second standard deviation matrix of the sharpened gray level image by adopting a transverse sliding window or a longitudinal sliding window;
calculating a standard deviation difference value matrix according to the first standard deviation matrix and the second standard deviation matrix;
normalizing the values of the elements in the standard deviation difference value matrix to a set gray scale range to generate a standard deviation difference value image;
carrying out binarization processing on the standard deviation difference image to obtain a binarization standard deviation difference image;
and solving at least one non-highlight connected domain included in the binarization standard difference image as a smooth region corresponding to the bill to be detected.
Specifically, when the background texture of the bill to be detected is a transverse texture, a longitudinal sliding window is adopted; and when the background texture of the bill to be detected is longitudinal texture, a transverse sliding window is adopted.
As shown in fig. 3, the method of this embodiment specifically includes:
s310, acquiring an original gray image and a sharpened gray image of the bill to be detected, wherein the background texture of the bill to be detected is dense.
And S320, calculating a first standard deviation matrix of the original gray-scale image by adopting a transverse sliding window or a longitudinal sliding window, and calculating a second standard deviation matrix of the sharpened gray-scale image.
In the step, when the background texture of the bill to be detected is the transverse texture, a first standard deviation matrix of the original gray level image and a second standard deviation matrix of the sharpened gray level image are calculated by adopting a longitudinal sliding window. And when the background texture of the bill to be detected is longitudinal texture, calculating a first standard deviation matrix of the original gray level image and a second standard deviation matrix of the sharpened gray level image by adopting a transverse sliding window.
And S330, calculating a standard deviation difference value matrix according to the first standard deviation matrix and the second standard deviation matrix.
And subtracting the second standard deviation matrix from the first standard deviation matrix to obtain a standard deviation difference matrix, and if the subtraction result corresponding to the elements is a negative value, taking the absolute value of the subtraction result as the corresponding element value in the standard deviation difference matrix, and further performing subsequent processing according to the obtained standard deviation difference matrix.
S340, normalizing the values of the elements in the standard deviation difference value matrix to a set gray scale range, and generating a standard deviation difference value image.
And S350, carrying out binarization processing on the standard deviation difference image to obtain a binarization standard deviation difference image.
And S360, solving at least one non-highlight connected domain included in the binarization standard difference image as a smooth region corresponding to the bill to be detected.
And S370, judging whether at least one smooth area with the size larger than the set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
For those parts of this embodiment that are not explained in detail, reference is made to the aforementioned embodiments, which are not repeated herein.
The technical scheme provided by the embodiment is suitable for the bill to be detected with the unidirectional background texture, the original gray image and the sharpened gray image are processed by adopting the transverse sliding window or the longitudinal sliding window, at least one smooth area corresponding to the bill to be detected is determined according to the binarization standard difference image determined by combining the original gray image and the sharpened gray image, and the smooth area with the size larger than the set smearing size threshold value is marked as a smearing area, so that the detection rate of the smearing area on the surface of the bill is further improved.
Example four
Fig. 4 is a flowchart of a bill surface scratch detection method according to a fourth embodiment of the present invention, which is embodied on the basis of the foregoing technical solution, where a horizontal sliding window and a vertical sliding window are used to process a grayscale image to obtain a processed image, and at least one non-highlighted connected domain included in the processed image is obtained as a smooth region corresponding to a bill to be detected, where the method specifically includes:
calculating a transverse standard deviation matrix and a longitudinal standard deviation matrix of the original gray level image or the sharpened gray level image by adopting a transverse sliding window and a longitudinal sliding window;
normalizing the values of elements in the transverse standard deviation matrix and the longitudinal standard deviation matrix to a set gray scale range to generate a transverse standard deviation image and a longitudinal standard deviation image;
performing binarization processing on the transverse standard deviation image and the longitudinal standard deviation image to obtain a binarized transverse standard deviation image and a binarized longitudinal standard deviation image;
and solving at least one non-highlight connected domain included in the intersection image of the valued transverse standard deviation image and the binarized longitudinal standard deviation image as a smooth region corresponding to the bill to be detected.
As shown in fig. 4, the method of this embodiment specifically includes:
s410, acquiring an original gray image or a sharpened gray image of the bill to be detected, wherein the background texture of the bill to be detected is dense.
And S420, calculating a transverse standard deviation matrix and a longitudinal standard deviation matrix of the original gray image or the sharpened gray image by adopting the transverse sliding window and the longitudinal sliding window.
In this embodiment, any one of the original gray image and the sharpened gray image can be selected for bill surface scratch detection.
Specifically, a transverse standard deviation matrix of the original gray image or the sharpened gray image is calculated by adopting a transverse sliding window, and a longitudinal standard deviation matrix of the original gray image or the sharpened gray image is calculated by adopting a longitudinal sliding window.
And S430, normalizing the values of the elements in the transverse standard deviation matrix and the longitudinal standard deviation matrix to a set gray scale range, and generating a transverse standard deviation image and a longitudinal standard deviation image.
Normalizing the values of the elements in the transverse standard deviation matrix to a set gray scale range to generate a transverse standard deviation image, and normalizing the values of the elements in the longitudinal standard deviation matrix to the set gray scale range to generate a longitudinal standard deviation image.
And S440, performing binarization processing on the transverse standard deviation image and the longitudinal standard deviation image to obtain a binarized transverse standard deviation image and a binarized longitudinal standard deviation image.
And after the binarization processing and the denoising processing are carried out on the transverse standard deviation image, a binarization transverse standard deviation image is obtained, and after the binarization processing and the denoising processing are carried out on the longitudinal standard deviation image, a binarization longitudinal standard deviation image is obtained.
S450, solving at least one non-highlight connected domain included in the intersection image of the binarization transverse standard deviation image and the binarization longitudinal standard deviation image as a smooth region corresponding to the bill to be detected.
And calculating an intersection image of the binarization transverse standard deviation image and the binarization longitudinal standard deviation image, performing denoising and expansion processing on the intersection image to communicate the local images to obtain a final image, and solving at least one non-highlight communicated region included in the final image as a smooth region corresponding to the bill to be detected.
And S460, judging whether at least one smooth area with the size larger than the set scraping size threshold exists, and if so, marking the at least one smooth area as a scraping area.
For those parts of this embodiment that are not explained in detail, reference is made to the aforementioned embodiments, which are not repeated herein.
The technical solution provided by this embodiment is to use the horizontal sliding window and the vertical sliding window to process the original gray image or the sharpened gray image to obtain the horizontal smooth degree image and the vertical smooth degree image (i.e. the horizontal standard deviation image and the vertical standard deviation image) on the bill surface, is suitable for the bill to be detected with the non-unidirectional background texture, and solves the problem that the effect of obtaining the smooth degree image by using the single sliding window is not good, then at least one smooth area corresponding to the bill to be detected is obtained from the intersection image of the determined binarization transverse standard deviation image and the binarization longitudinal standard deviation image, the smooth area with the size larger than the set smearing size threshold value is marked as a smearing area, therefore, the detection rate of the bill surface coating area is further improved, and the application range of the bill surface coating detection method is expanded.
EXAMPLE five
Fig. 5 is a flowchart of a method for detecting a scratch on a bill surface according to a fifth embodiment of the present invention, which is embodied on the basis of the foregoing technical solution, where a horizontal sliding window and a vertical sliding window are used to process a grayscale image to obtain a processed image, and at least one non-highlighted connected domain included in the processed image is obtained as a smooth region corresponding to the bill to be detected, and the method includes:
calculating a transverse first standard deviation matrix and a longitudinal first standard deviation matrix of the original gray level image and a transverse second standard deviation matrix and a longitudinal second standard deviation matrix of the sharpened gray level image by adopting a transverse sliding window and a longitudinal sliding window;
calculating a transverse standard deviation matrix according to the transverse first standard deviation matrix and the transverse second standard deviation matrix, and calculating a longitudinal standard deviation matrix according to the longitudinal first standard deviation matrix and the longitudinal second standard deviation matrix;
normalizing the values of elements in the transverse standard deviation difference value matrix and the longitudinal standard deviation difference value matrix to a set gray scale range to generate a transverse standard deviation difference value image and a longitudinal standard deviation difference value image;
performing binarization processing on the transverse standard difference image and the longitudinal standard difference image to obtain a binarized transverse standard difference image and a binarized longitudinal standard difference image;
and solving at least one non-highlight connected domain included in the intersection image of the binarization transverse standard difference image and the binarization longitudinal standard difference image as a smooth region corresponding to the bill to be detected.
As shown in fig. 5, the method of this embodiment specifically includes:
s510, acquiring an original gray image and a sharpened gray image of the bill to be detected, wherein the background texture of the bill to be detected is dense.
In this embodiment, a specific example is explained, fig. 6 is an original gray-scale image of a to-be-detected bill, fig. 7 is a sharpened gray-scale image of the to-be-detected bill, and compared with fig. 6, the background texture in fig. 7 is clearer.
S520, calculating a transverse first standard deviation matrix and a longitudinal first standard deviation matrix of the original gray-scale image by adopting the transverse sliding window and the longitudinal sliding window, and calculating a transverse second standard deviation matrix and a longitudinal second standard deviation matrix of the sharpened gray-scale image.
In the embodiment, a transverse sliding window of 2 × 6 and a longitudinal sliding window of 6 × 2 are specifically adopted to obtain the transverse smoothness image and the longitudinal smoothness image of the bill surface according to the size of the bill to be detected.
For the original gray image, adopting a 2 multiplied by 6 transverse sliding window to slide in a full range, calculating the standard deviation of 12 pixels in the window every time of sliding, and finally obtaining a transverse first standard deviation matrix of the original gray image; for the original gray image, adopting a 6 multiplied by 2 longitudinal sliding window to slide in a full range, calculating the standard deviation of 12 pixels in the window every time of sliding, and finally obtaining a longitudinal first standard deviation matrix of the original gray image; for the sharpened gray image, adopting 2 multiplied by 6 transverse sliding window to slide in a full frame, calculating the standard deviation of 12 pixels in the primary window every time of sliding, and finally obtaining a transverse second standard deviation matrix of the sharpened gray image; and for the sharpened gray image, adopting 6 multiplied by 2 longitudinal sliding window full-width sliding, calculating the standard deviation of 12 pixels in the window every time of sliding, and finally obtaining a longitudinal second standard deviation matrix of the sharpened gray image.
S530, calculating a transverse standard deviation matrix according to the transverse first standard deviation matrix and the transverse second standard deviation matrix, and calculating a longitudinal standard deviation matrix according to the longitudinal first standard deviation matrix and the longitudinal second standard deviation matrix.
And subtracting the transverse second standard deviation matrix from the transverse first standard deviation matrix to obtain a transverse standard deviation difference matrix, and subtracting the longitudinal second standard deviation matrix from the longitudinal first standard deviation matrix to obtain a longitudinal standard deviation difference matrix. And if the result of the corresponding subtraction of the elements is a negative value, taking the absolute value of the element as the corresponding element value in the transverse standard deviation difference matrix or the longitudinal standard deviation difference matrix.
And S540, normalizing the values of the elements in the transverse standard deviation difference value matrix and the longitudinal standard deviation difference value matrix to a set gray scale range, and generating a transverse standard deviation difference value image and a longitudinal standard deviation difference value image.
Normalizing the values of the elements in the transverse standard deviation difference matrix to a set gray scale range of 0-255 to obtain a transverse standard deviation difference image, as shown in fig. 8; normalizing the values of the elements in the longitudinal standard deviation difference matrix to a set gray scale range of 0-255 to obtain a longitudinal standard deviation difference image, as shown in fig. 9.
And S550, performing binarization processing on the transverse standard deviation difference image and the longitudinal standard deviation difference image to obtain a binarized transverse standard deviation difference image and a binarized longitudinal standard deviation difference image.
Performing binarization processing on the transverse standard deviation difference image to obtain a binarization initial transverse standard deviation image, and then performing denoising processing on the binarization initial transverse standard deviation image to finally obtain a binarization transverse standard deviation difference image, as shown in FIG. 10; the binarization processing is performed on the longitudinal standard deviation difference image to obtain a binarization initial longitudinal standard deviation image, and then the denoising processing is performed on the binarization initial longitudinal standard deviation image to finally obtain a binarization longitudinal standard deviation difference image, as shown in fig. 11.
In the binarized lateral standard difference image and the binarized longitudinal standard difference image as shown in fig. 10 and 11, a black region (non-highlighted region) indicates that the image is smooth, and a white region (highlighted region) indicates that the image is not smooth. Wherein, the smooth area of the image is the painting area to be determined.
And S560, solving at least one non-highlight connected domain included in the intersection image of the binarization transverse standard difference image and the binarization longitudinal standard difference image as a smooth region corresponding to the bill to be detected.
And solving an initial intersection image of the binarized transverse standard deviation difference image and the binarized longitudinal standard deviation difference image, and then performing denoising and local expansion processing on the initial intersection image to obtain an intersection image, as shown in fig. 12. To this end, the intersection image shown in fig. 12 is the final smooth image corresponding to the bill to be detected, non-highlight connected domains in the intersection image are obtained, and the non-highlight connected domains are used as smooth regions corresponding to the bill to be detected.
S570, judging whether at least one smooth area with the size larger than the set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
Judging the size of the non-highlight connected domain, judging whether the size meets the requirement of the minimum scraping size and whether the size is larger than the set scraping size threshold, marking the non-highlight connected domain meeting the requirement of the minimum scraping size (larger than the set scraping size threshold), and finally, determining the marked non-highlight connected domain as the scraping area, wherein as shown in fig. 13, the non-highlight connected domain 100 is the scraping area.
For those parts of this embodiment that are not explained in detail, reference is made to the aforementioned embodiments, which are not repeated herein.
The technical solution provided in this embodiment is to use a horizontal sliding window and a vertical sliding window to process an original gray image and a sharpened gray image to obtain a horizontal smooth image and a vertical smooth image (i.e. a horizontal standard deviation image and a vertical standard deviation image) on the surface of a bill, and is suitable for a bill to be detected with a non-unidirectional background texture, and solves the problem that the effect of obtaining a smooth image by using a single sliding window is not good, and obtains at least one smooth region corresponding to the bill to be detected in an intersection image of a binarized horizontal standard deviation difference image and a binarized vertical standard deviation difference image determined by combining the original gray image and the sharpened gray image, and marks the smooth region with a size larger than a set size threshold as a scratch region, so as to further improve the detection rate of the scratch region on the surface of the bill, and the application range of the bill surface scratch detection method is enlarged.
EXAMPLE six
Fig. 14 is a schematic structural diagram of a device for detecting scratch on the surface of a bill according to a sixth embodiment of the present invention, which is suitable for detecting whether there is a scratch on the surface of a bill (a bill, a check, a deposit receipt, etc.), and the device can be implemented in software and/or hardware, and can be generally integrated into a processor of a financial device (typically, a financial device includes various sorts of sorters and ATMs, etc.). As shown in fig. 14, the apparatus includes: a grayscale image acquisition module 610, a smooth region acquisition module 620, and a scratch determination module 630, wherein,
the gray image acquisition module 610 is configured to acquire a gray image of a to-be-detected bill, where background texture of the to-be-detected bill is dense, and the gray image includes an original gray image and/or a sharpened gray image;
a smooth region obtaining module 620, configured to process the grayscale image by using a horizontal sliding window and/or a vertical sliding window to obtain a processed image, and obtain at least one non-highlighted connected region included in the processed image as a smooth region corresponding to the to-be-detected bill;
and a scraping judging module 630, configured to judge whether there is at least one smooth area with a size larger than a set scraping size threshold, and if so, mark the at least one smooth area as a scraping area.
In the embodiment of the invention, the gray level image of the bill to be detected with dense background texture is processed by adopting the transverse sliding window and/or the longitudinal sliding window to obtain a processed image, at least one non-highlight connected domain is obtained in the processed image to be used as a smooth region corresponding to the bill to be detected, if at least one smooth region with the size larger than the set scraping size threshold exists, the scraping region in the bill to be detected can be confirmed, and the scraping region is at least one smooth region with the size larger than the set scraping size threshold. The bill surface scratch detection method provided by the embodiment of the invention is independent of color change to distinguish whether the scratch exists on the bill surface, and is independent of whether handwritten characters or printed characters exist in a scratch area, so that the identification capability of financial equipment on paper money, deposit receipt, checks and the like is improved, and the workload of manual secondary check is reduced.
As an optional implementation manner, the smooth region obtaining module 620 specifically includes:
a second standard deviation matrix calculation unit, configured to calculate a standard deviation matrix of the original grayscale image or the sharpened grayscale image by using a horizontal sliding window or a vertical sliding window;
the second standard deviation image construction unit is used for normalizing the values of the elements in the standard deviation matrix to a set gray scale range to generate a standard deviation image;
the second binarization processing unit is used for carrying out binarization processing on the standard deviation image to obtain a binarization standard deviation image;
and the second smooth region solving unit is used for solving at least one non-highlight connected region included in the binarization standard deviation image as a smooth region corresponding to the bill to be detected.
As an optional implementation manner, the smooth region obtaining module 620 specifically includes:
a third standard deviation matrix calculation unit, configured to calculate a first standard deviation matrix of the original grayscale image and a second standard deviation matrix of the sharpened grayscale image by using a horizontal sliding window or a vertical sliding window;
a third standard deviation difference matrix calculation unit, configured to calculate a standard deviation difference matrix according to the first standard deviation matrix and the second standard deviation matrix;
the third standard deviation difference image construction unit is used for normalizing the values of the elements in the standard deviation difference matrix to a set gray scale range to generate a standard deviation difference image;
a third binarization processing unit, configured to perform binarization processing on the standard deviation difference image to obtain a binarization standard deviation difference image;
and the third smooth region solving unit is used for solving at least one non-highlight connected region included in the binarization standard difference image as a smooth region corresponding to the bill to be detected.
Specifically, when the background texture of the bill to be detected is a transverse texture, the longitudinal sliding window is adopted; and when the background texture of the bill to be detected is longitudinal texture, the transverse sliding window is adopted.
As an optional implementation manner, the smooth region obtaining module 620 specifically includes:
a fourth standard deviation matrix calculation unit, configured to calculate a horizontal standard deviation matrix and a vertical standard deviation matrix of the original grayscale image or the sharpened grayscale image by using a horizontal sliding window and a vertical sliding window;
the fourth standard deviation image construction unit is used for normalizing the values of elements in the transverse standard deviation matrix and the longitudinal standard deviation matrix to a set gray scale range to generate a transverse standard deviation image and a longitudinal standard deviation image;
a fourth binarization processing unit, configured to perform binarization processing on the horizontal standard deviation image and the longitudinal standard deviation image to obtain a binarized horizontal standard deviation image and a binarized longitudinal standard deviation image;
and the fourth smooth region solving unit is used for solving at least one non-highlight connected region included in the intersection image of the valued transverse standard deviation image and the binarized longitudinal standard deviation image as a smooth region corresponding to the bill to be detected.
As an optional implementation manner, the smooth region obtaining module 620 specifically includes:
a first standard deviation matrix calculation unit, configured to calculate a horizontal first standard deviation matrix and a vertical first standard deviation matrix of the original grayscale image, and a horizontal second standard deviation matrix and a vertical second standard deviation matrix of the sharpened grayscale image by using a horizontal sliding window and a vertical sliding window;
a first standard deviation difference matrix calculation unit, configured to calculate a horizontal standard deviation difference matrix according to the horizontal first standard deviation matrix and the horizontal second standard deviation matrix, and calculate a vertical standard deviation difference matrix according to the vertical first standard deviation matrix and the vertical second standard deviation matrix;
the first standard deviation difference image construction unit is used for normalizing the values of elements in the transverse standard deviation difference matrix and the longitudinal standard deviation difference matrix to a set gray scale range to generate a transverse standard deviation difference image and a longitudinal standard deviation difference image;
the first binarization processing unit is used for carrying out binarization processing on the transverse standard deviation difference image and the longitudinal standard deviation difference image to obtain a binarization transverse standard deviation difference image and a binarization longitudinal standard deviation difference image;
and the first smooth region solving unit is used for solving at least one non-highlight connected region included in the intersection image of the binarization transverse standard difference image and the binarization longitudinal standard difference image as a smooth region corresponding to the bill to be detected.
The bill surface scratch detection device can execute the bill surface scratch detection method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed bill surface scratch detection method.
EXAMPLE seven
Fig. 15 is a schematic structural diagram of a computer apparatus according to a seventh embodiment of the present invention, as shown in fig. 15, the computer apparatus includes a processor 710, a memory 720, an input device 730, and an output device 740; the number of the processors 710 in the computer device may be one or more, and one processor 710 is taken as an example in fig. 15; the processor 710, the memory 720, the input device 730, and the output device 740 in the computer apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 15.
The memory 720, as a computer-readable storage medium, can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the bill surface scratch detection method in any embodiment of the present invention (e.g., the grayscale image acquisition module 610, the smooth region acquisition module 620, and the scratch determination module 630 in the bill surface scratch detection apparatus). The processor 710 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the memory 720, i.e., implements the operations for the computer device described above.
The memory 720 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 use of the device, and the like. Further, the memory 720 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 720 may further include memory located remotely from the processor 710, which may be connected to a computer device via 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 730 may be used to receive input touch information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 740 may include a display device such as a display screen.
Example eight
The eighth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the storage medium stores a computer program, and when the computer program is executed by a processor, the storage medium implements the method for detecting scratch on a surface of a ticket according to any embodiment of the present invention, where the method includes:
acquiring a gray image of a bill to be detected, wherein the background texture of the bill to be detected is dense, and the gray image comprises an original gray image and/or a sharpened gray image;
processing the gray image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the bill to be detected;
and judging whether at least one smooth area with the size larger than a set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
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 instructions for enabling a computer device to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the device for detecting surface scratch on a bill, each unit and each module included in the embodiment are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function can be realized; 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 (10)

1. A method for detecting the scratch on the surface of a bill is characterized by comprising the following steps:
acquiring a gray image of a bill to be detected, wherein the background texture of the bill to be detected is dense, and the gray image comprises an original gray image and/or a sharpened gray image;
processing the gray image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the bill to be detected;
and judging whether at least one smooth area with the size larger than a set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
2. The method according to claim 1, wherein the processing of the grayscale image using a horizontal sliding window or a vertical sliding window to obtain a processed image, and the obtaining of at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the to-be-detected bill comprises:
calculating a standard deviation matrix of the original gray-scale image or the sharpened gray-scale image by adopting a transverse sliding window or a longitudinal sliding window;
normalizing the values of the elements in the standard deviation matrix to a set gray scale range to generate a standard deviation image;
carrying out binarization processing on the standard deviation image to obtain a binarization standard deviation image;
and solving at least one non-highlight connected domain included in the binary standard deviation image as a smooth region corresponding to the bill to be detected.
3. The method according to claim 1, wherein the processing of the grayscale image using a horizontal sliding window or a vertical sliding window to obtain a processed image, and the obtaining of at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the to-be-detected bill comprises:
calculating a first standard deviation matrix of the original gray-scale image and a second standard deviation matrix of the sharpened gray-scale image by adopting a transverse sliding window or a longitudinal sliding window;
calculating a standard deviation difference value matrix according to the first standard deviation matrix and the second standard deviation matrix;
normalizing the values of the elements in the standard deviation difference value matrix to a set gray scale range to generate a standard deviation difference value image;
carrying out binarization processing on the standard deviation difference image to obtain a binarization standard deviation difference image;
and solving at least one non-highlight connected domain included in the binarization standard difference image as a smooth region corresponding to the bill to be detected.
4. The method according to claim 2 or 3,
when the background texture of the bill to be detected is a transverse texture, the longitudinal sliding window is adopted;
and when the background texture of the bill to be detected is longitudinal texture, the transverse sliding window is adopted.
5. The method according to claim 1, wherein the processing of the grayscale image using a horizontal sliding window and a vertical sliding window to obtain a processed image, and the obtaining of at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the to-be-detected bill comprises:
calculating a transverse standard deviation matrix and a longitudinal standard deviation matrix of the original gray-scale image or the sharpened gray-scale image by adopting a transverse sliding window and a longitudinal sliding window;
normalizing the values of elements in the transverse standard deviation matrix and the longitudinal standard deviation matrix to a set gray scale range to generate a transverse standard deviation image and a longitudinal standard deviation image;
performing binarization processing on the transverse standard deviation image and the longitudinal standard deviation image to obtain a binarized transverse standard deviation image and a binarized longitudinal standard deviation image;
and solving at least one non-highlight connected domain included in the intersection image of the valued transverse standard deviation image and the binarized longitudinal standard deviation image as a smooth region corresponding to the bill to be detected.
6. The method according to claim 1, wherein the processing of the grayscale image using a horizontal sliding window and a vertical sliding window to obtain a processed image, and the obtaining of at least one non-highlighted connected domain included in the processed image as a smooth region corresponding to the to-be-detected bill comprises:
calculating a transverse first standard deviation matrix and a longitudinal first standard deviation matrix of the original gray-scale image and a transverse second standard deviation matrix and a longitudinal second standard deviation matrix of the sharpened gray-scale image by adopting a transverse sliding window and a longitudinal sliding window;
calculating a transverse standard deviation matrix according to the transverse first standard deviation matrix and the transverse second standard deviation matrix, and calculating a longitudinal standard deviation matrix according to the longitudinal first standard deviation matrix and the longitudinal second standard deviation matrix;
normalizing the values of elements in the transverse standard deviation difference value matrix and the longitudinal standard deviation difference value matrix to a set gray scale range to generate a transverse standard deviation difference value image and a longitudinal standard deviation difference value image;
performing binarization processing on the transverse standard difference image and the longitudinal standard difference image to obtain a binarized transverse standard difference image and a binarized longitudinal standard difference image;
and solving at least one non-highlight connected domain included in the intersection image of the binarization transverse standard difference image and the binarization longitudinal standard difference image as a smooth region corresponding to the bill to be detected.
7. The utility model provides a detection device is scraped to bill surface coating which characterized in that includes:
the system comprises a gray level image acquisition module, a background image acquisition module and a processing module, wherein the gray level image acquisition module is used for acquiring a gray level image of a bill to be detected, the background texture of the bill to be detected is dense, and the gray level image comprises an original gray level image and/or a sharpened gray level image;
the smooth area acquisition module is used for processing the gray level image by adopting a transverse sliding window and/or a longitudinal sliding window to obtain a processed image, and solving at least one non-highlight connected domain included in the processed image as a smooth area corresponding to the bill to be detected;
and the scraping judging module is used for judging whether at least one smooth area with the size larger than the set scraping size threshold exists or not, and if so, marking the at least one smooth area as a scraping area.
8. The apparatus of claim 7, wherein the smooth region obtaining module comprises:
a first standard deviation matrix calculation unit, configured to calculate a horizontal first standard deviation matrix and a vertical first standard deviation matrix of the original grayscale image, and a horizontal second standard deviation matrix and a vertical second standard deviation matrix of the sharpened grayscale image by using a horizontal sliding window and a vertical sliding window;
a first standard deviation difference matrix calculation unit, configured to calculate a horizontal standard deviation difference matrix according to the horizontal first standard deviation matrix and the horizontal second standard deviation matrix, and calculate a vertical standard deviation difference matrix according to the vertical first standard deviation matrix and the vertical second standard deviation matrix;
the first standard deviation difference image construction unit is used for normalizing the values of elements in the transverse standard deviation difference matrix and the longitudinal standard deviation difference matrix to a set gray scale range to generate a transverse standard deviation difference image and a longitudinal standard deviation difference image;
the first binarization processing unit is used for carrying out binarization processing on the transverse standard deviation difference image and the longitudinal standard deviation difference image to obtain a binarization transverse standard deviation difference image and a binarization longitudinal standard deviation difference image;
and the first smooth region solving unit is used for solving at least one non-highlight connected region included in the intersection image of the binarization transverse standard difference image and the binarization longitudinal standard difference image as a smooth region corresponding to the bill to be detected.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-6 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201910080302.7A 2019-01-28 2019-01-28 Bill surface scratch detection method, device, equipment and storage medium Active CN111563845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910080302.7A CN111563845B (en) 2019-01-28 2019-01-28 Bill surface scratch detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910080302.7A CN111563845B (en) 2019-01-28 2019-01-28 Bill surface scratch detection method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111563845A true CN111563845A (en) 2020-08-21
CN111563845B CN111563845B (en) 2023-10-20

Family

ID=72069564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910080302.7A Active CN111563845B (en) 2019-01-28 2019-01-28 Bill surface scratch detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111563845B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255657A (en) * 2020-12-31 2021-08-13 深圳怡化电脑股份有限公司 Method and device for detecting scratch on surface of bill, electronic equipment and machine-readable medium
CN116403098A (en) * 2023-05-26 2023-07-07 四川金投科技股份有限公司 Bill tampering detection method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000222588A (en) * 1999-01-29 2000-08-11 Mitsubishi Electric Corp Image target detecting device
CN103914833A (en) * 2014-03-11 2014-07-09 辰通智能设备(深圳)有限公司 Method and system for automatically detecting whether bill is incomplete or not
CN104952077A (en) * 2015-06-18 2015-09-30 辰通智能设备(深圳)有限公司 Oil stain detection method and oil stain detection system for bill images
CN107622562A (en) * 2017-09-11 2018-01-23 深圳怡化电脑股份有限公司 Extracting method, device, equipment and the storage medium of banknote image
CN108154510A (en) * 2018-01-17 2018-06-12 深圳市亿图视觉自动化技术有限公司 Method for detecting surface defects of products, device and computer readable storage medium
CN108230321A (en) * 2018-01-19 2018-06-29 深圳市亿图视觉自动化技术有限公司 Defect inspection method and device
CN108764225A (en) * 2018-04-11 2018-11-06 深圳怡化电脑股份有限公司 Identify the method, apparatus and electronic equipment of horizontally-spliced bank note

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000222588A (en) * 1999-01-29 2000-08-11 Mitsubishi Electric Corp Image target detecting device
CN103914833A (en) * 2014-03-11 2014-07-09 辰通智能设备(深圳)有限公司 Method and system for automatically detecting whether bill is incomplete or not
CN104952077A (en) * 2015-06-18 2015-09-30 辰通智能设备(深圳)有限公司 Oil stain detection method and oil stain detection system for bill images
CN107622562A (en) * 2017-09-11 2018-01-23 深圳怡化电脑股份有限公司 Extracting method, device, equipment and the storage medium of banknote image
CN108154510A (en) * 2018-01-17 2018-06-12 深圳市亿图视觉自动化技术有限公司 Method for detecting surface defects of products, device and computer readable storage medium
CN108230321A (en) * 2018-01-19 2018-06-29 深圳市亿图视觉自动化技术有限公司 Defect inspection method and device
CN108764225A (en) * 2018-04-11 2018-11-06 深圳怡化电脑股份有限公司 Identify the method, apparatus and electronic equipment of horizontally-spliced bank note

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255657A (en) * 2020-12-31 2021-08-13 深圳怡化电脑股份有限公司 Method and device for detecting scratch on surface of bill, electronic equipment and machine-readable medium
CN113255657B (en) * 2020-12-31 2024-04-05 深圳怡化电脑股份有限公司 Method and device for detecting scratch on bill surface, electronic equipment and machine-readable medium
CN116403098A (en) * 2023-05-26 2023-07-07 四川金投科技股份有限公司 Bill tampering detection method and system
CN116403098B (en) * 2023-05-26 2023-08-08 四川金投科技股份有限公司 Bill tampering detection method and system

Also Published As

Publication number Publication date
CN111563845B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN110276754B (en) Surface defect detection method, terminal device and storage medium
CN102682514B (en) Paper identification method and relative device
AU2014289869B2 (en) Banknote recognition and classification method and system
CN107103683B (en) Paper money identification method and device, electronic equipment and storage medium
CN107330979A (en) Vector diagram generation method and device for building house type and terminal
CN104992496A (en) Paper money face identification method and apparatus
US20070253040A1 (en) Color scanning to enhance bitonal image
CN107016363A (en) Bill images managing device, bill images management system and method
CN107610322B (en) Banknote version identification method and device, electronic equipment and storage medium
CN106096610A (en) A kind of file and picture binary coding method based on support vector machine
CN107610316B (en) Method and device for detecting defect of paper money and terminal equipment
CN105184957A (en) Paper currency discrimination method and system
CN107038794B (en) Method, device and equipment for identifying authenticity of paper money and storage medium
CN111563845B (en) Bill surface scratch detection method, device, equipment and storage medium
CN116977358A (en) Visual auxiliary detection method for corrugated paper production quality
CN106780966A (en) A kind of paper money discrimination method and device
Ali et al. Recognition system for Pakistani paper currency
CN107680246B (en) Method and equipment for positioning curve boundary in paper money pattern
CN107742357A (en) A kind of recognition methods of paper money number and device
CN113435219B (en) Anti-counterfeiting detection method and device, electronic equipment and storage medium
Shi et al. Image enhancement for degraded binary document images
CN109543554B (en) Bill detection method, device, terminal and computer readable storage medium
CN115797327A (en) Defect detection method and device, terminal device and storage medium
CN116109577A (en) Printing label defect detection system and method
CN115346306A (en) Method and device for identifying stained 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