CN108320372B - Effective identification method for folded paper money - Google Patents

Effective identification method for folded paper money Download PDF

Info

Publication number
CN108320372B
CN108320372B CN201810059119.4A CN201810059119A CN108320372B CN 108320372 B CN108320372 B CN 108320372B CN 201810059119 A CN201810059119 A CN 201810059119A CN 108320372 B CN108320372 B CN 108320372B
Authority
CN
China
Prior art keywords
slope
folding
straight line
points
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810059119.4A
Other languages
Chinese (zh)
Other versions
CN108320372A (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.)
Central South University
Original Assignee
Central South University
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 Central South University filed Critical Central South University
Priority to CN201810059119.4A priority Critical patent/CN108320372B/en
Publication of CN108320372A publication Critical patent/CN108320372A/en
Application granted granted Critical
Publication of CN108320372B publication Critical patent/CN108320372B/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
    • G07D7/2008Testing patterns thereon using pre-processing, e.g. de-blurring, averaging, normalisation or rotation
    • 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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an effective identification method of folded paper money, which comprises the following steps: extracting front and back images of the paper money; judging the diagonally folded paper money by using the trained convolutional neural network; according to a set threshold value, performing edge detection based on straight line fitting on gray level images of front and back side images of the extracted corner folded paper money, further determining each folding area and folding position of the corner folded paper money, and completely splicing the paper money images; and identifying the authenticity of the spliced paper money. The invention mainly solves the problem that the receiving rate of folded paper money is too low in paper money identification, and can improve the identification efficiency of the paper money identifier, thereby improving the efficiency of the Internet of things self-service and improving the user experience.

Description

Effective identification method for folded paper money
Technical Field
The invention relates to a paper money identification method, in particular to a folding paper money identification method.
Background
With the continuous development of social informatization, computers relate to aspects of social life. The paper money is an operation hub of the financial market, and the paper money identification is developed from initial manual identification to intelligent identification in the social informatization environment.
The paper money identification device is used as a core accessory of a self-service financial industry and a self-service system, and has great application in many places, such as vending machines, newspaper vending machines, meal card automatic recharging machines and the like arranged at two sides of streets of large and medium-sized cities, at the periphery of schools and near office buildings; automatic teller machines, automatic registration machines, automatic ticket vending machines and the like which are arranged in banks, hospitals and railway stations; the mobile phone self-service recharging machine, the automatic bag depositing machine, the automatic game coin purchasing machine and the like which are arranged in the communication business hall, the shopping mall and the entertainment place need to use paper money identification equipment. Due to the characteristics of wide application range, large application quantity, multiple application scenes and the like of the paper money identification equipment, the production and the sale of the paper money identification equipment gradually form an industrial mode, and the paper money identification equipment is specially researched, developed, produced and sold by a plurality of enterprises.
In addition, intelligent recognition of currency is a key factor for efficient operation of banks. The general banking cash business comprises large-amount cash business and loose-family cash business, the large-amount cash business is usually cash flow of large and medium-sized enterprises, and can be accessed by means of 'data' transfer, checks and the like, and the loose-family cash business generally adopts counter access and automatic teller machine access. The ATM key technology is used for identifying paper money, ATM can detect the integrity of the paper money, a large number of normal paper money with small folding angles can not pass through the paper money detection and is regarded as the condition of abnormal paper money, one business usually needs to handle two to three required time, the operation efficiency of the ATM is greatly influenced, and the experience of customers is also influenced.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an effective folded paper currency identification method aiming at the problem of low folded paper currency receiving rate in paper currency identification, and thickness judgment is not needed, so that the cost and the cost are reduced, the currency detection operation efficiency of an ATM (automatic teller machine) and the like is improved, and the user experience is improved.
In order to solve the technical problems, the invention adopts the technical scheme that: an effective folded banknote recognition method, comprising the steps of:
step S1: setting a sensor to sample 8 pixel points per millimeter, and acquiring front and back images of the paper money;
step S2: reducing the collected pixels of the front and back images of the paper currency into 32 × 32, and inputting the pixels into a trained convolutional neural network to obtain corner folded paper currency;
step S3: extracting the front and back images of the corner folded banknote obtained in the step S2, collected in the step S1, performing median filtering, and performing edge detection based on straight line fitting on the gray level images of the front and back images of the extracted corner folded banknote according to a set threshold value, so as to determine each folding area and folding position of the corner folded banknote;
s4, according to the folding area and the folding position of the corner folding banknote image determined in the step S3, performing image splicing on the front and back images of the corner folding banknote to restore the image of the folding area;
and step S5, performing similarity matching on the spliced angle folding paper currency image and the front and back side images of the complete paper currency in the sample library to realize true and false identification.
In the foregoing solution, the step S2 includes:
201) and establishing a paper currency sample bank (the paper currency sample bank comprises the front and back images of complete paper currency, corner folded paper currency, corner missing paper currency and other damaged paper currency. ) Building a convolutional neural network, setting the output layer result as a complete paper currency 0, an angle folding paper currency 1, an angle missing paper currency 2 and other damaged paper currencies 3, pre-training the convolutional neural network by using an MNIST data set, inputting a paper currency sample library image data set into the convolutional neural network, and adjusting the convolutional neural network according to the recognition accuracy rate;
202) the collected banknote front and back side images are Input into a trained convolutional neural network (in the convolutional neural network, the convolutional neural network is generally divided into an Input layer (Input), a convolutional layer (C1, C3 and C5), a downsampling layer (S2 and S4), a full-connection layer (F1) and an Output layer (Output), wherein the convolutional layer, the downsampling layer and the full-connection layer correspond to hidden layers in the network. ) And obtaining the corner folded paper money.
In the above scheme, the length of the banknote image collected by the edge detection setting based on straight line fitting is w, and the width of the banknote image is h, and the specific method includes the following steps:
301) searching scanning points with the first gray value larger than a set threshold value at two ends of the line with x being equal to w/2, namely the detected upper and lower boundary points, and enabling the detected upper boundary point to be
Figure GDA0002354426370000021
The lower boundary point is
Figure GDA0002354426370000022
Wherein
Figure GDA0002354426370000023
Is in the range of 0 to h/2,
Figure GDA0002354426370000024
the search range of (1) is h to h/2;
302) in that
Figure GDA0002354426370000025
Searching upper and lower boundary points on the straight line, and recording the obtained upper boundary point
Figure GDA0002354426370000026
And
Figure GDA0002354426370000027
the lower boundary point obtained by recording is
Figure GDA0002354426370000028
And
Figure GDA0002354426370000029
Figure GDA00023544263700000210
wherein, Δ w is a search step length;
303) to be provided with
Figure GDA00023544263700000211
And
Figure GDA00023544263700000212
and step 302) is repeatedly executed for the initial point, when the boundary point cannot be found on the set straight line, the search is stopped, and the obtained boundary points form a sequence in sequence, namely the sequence of the upper edge point:
Figure GDA00023544263700000213
to be provided with
Figure GDA00023544263700000214
And
Figure GDA00023544263700000215
step 302) is repeatedly executed for the initial point, when the boundary point cannot be found on the set straight line, the search is stopped, and the obtained boundary points form a sequence in sequence, namely the sequence of the following boundary points:
Figure GDA0002354426370000031
304) searching scanning points with the first gray value larger than a set threshold value at two ends of the straight line y being h/2, namely the detected left and right edge points, and setting the left edge point as the left edge point
Figure GDA0002354426370000032
The right edge point is
Figure GDA0002354426370000033
Wherein
Figure GDA0002354426370000034
The search range of (1) is 0 to w/2;
Figure GDA0002354426370000035
the search range of (2) is w to w/2, and according to the principle of detecting the upper and lower boundary points in step 302), the left and right edge point sequences are obtained:
Figure GDA0002354426370000036
Figure GDA0002354426370000037
305) respectively calculating the slope of a straight line between two adjacent points in the upper edge point sequence to obtain a slope set between the adjacent points; finding an element with the most occurrence times in the slope set, and enabling the element to be the slope k1 of the upper edge straight line; then, searching an element with larger absolute value difference and the most occurrence times between the absolute value and the upper edge straight line slope k1 in the slope set, and enabling the element to be the first folding line slope k2 of the upper edge; finding the element with the maximum occurrence frequency and the opposite sign of the slope k1 of the upper edge straight line in the slope set, wherein the absolute value of the element is different from the absolute value of the slope k1 of the upper edge straight line, and the element is made to be the slope k3 of the second fold line of the upper edge; performing least square linear fitting by using all points with the slope of the straight line between the points and adjacent points being equal to the slope k1 of the straight line of the upper edge in the upper edge point sequence to obtain an upper edge linear equation; performing least square linear fitting by using all points, the slope of which is equal to the slope k2 of the first broken line of the upper edge, between the points and adjacent points to obtain a first broken line equation of the upper edge; performing least square linear fitting by using all points with the slope of the straight line between the points and the adjacent points being equal to the slope k3 of the second fold line of the upper edge to obtain a second fold line equation of the upper edge;
respectively calculating the slope of a straight line between two adjacent points in the lower edge point sequence to obtain a slope set between the adjacent points; finding an element with the most occurrence times in the slope set, and enabling the element to be the slope k 'of the lower edge straight line'1(ii) a Then find the absolute value in the slope set and the slope k of the lower edge straight line'1The element with larger absolute value difference and the most occurrence number is taken as the lower edge first folding line slope k'2(ii) a Finding and lower edge straight line slope k 'in slope set'1Of opposite sign and absolute value to the slope k of the lower edge straight line'1Is the element with the largest occurrence number, and the element is the slope k 'of the second fold line of the lower edge'3(ii) a In the sequence of lower edge points, the slope of the straight line between all the adjacent points is equal to the slope k 'of the lower edge straight line'1Performing least square linear fitting to obtain a lower edge linear equation; with the slope of the straight line between all and adjacent points being equal to the slope k 'of the first folding line of the lower edge'2Performing least square linear fitting to obtain a first broken line equation of the lower edge; with the slope of the straight line between all and adjacent points being equal to the slope k 'of the second fold line of the lower edge'3Performing least square linear fitting to obtain a second fold line equation of the lower edge;
respectively calculating the slope of a straight line between two adjacent points in the left edge point sequence to obtain a slope set between the adjacent points, and searching an element with the most occurrence times in the slope set to enable the element to be the slope k11 of the left edge straight line; performing least square linear fitting on all points in the left edge point sequence, wherein the slope of a straight line between each point and each adjacent point is equal to the slope k11 of the left edge straight line, so as to obtain a left edge straight line equation;
respectively calculating the slope of a straight line between two adjacent points in the right edge point sequence to obtain a slope set between the adjacent points, and searching an element with the largest occurrence frequency in the slope set to enable the element to be the slope k22 of the right edge straight line; performing least square linear fitting by using all points with the slope of the straight line between the points and the adjacent points being equal to the slope k22 of the straight line of the right edge in the right edge point sequence to obtain a straight line equation of the right edge;
306) calculating the intersection points between the upper edge linear equation and the lower edge linear equation and the left edge linear equation and the right edge linear equation respectively to obtain coordinates of four vertexes of the complete banknote image, and calculating the vertex coordinates of the first broken line and the second broken line of the upper edge and the lower edge by using the first broken line equation and the second broken line equation of the upper edge and the lower edge and the upper edge linear equation, the lower edge linear equation, the left edge linear equation and the right edge linear equation to determine each folding area and each folding position;
307) and counting the pixel number of each folding area, if the pixel number of one folding area is greater than the threshold value of a single missing area or the total folding area of a plurality of folding angles is greater than the threshold value of the total missing area, determining that the folding area of the paper currency is too large, rejecting the paper currency abnormally, and otherwise, continuing the subsequent identification process. In the exemplary embodiment of the present invention, the single missing region threshold is set to 2560, and the total missing region threshold is set to 3840.
According to the standard of RMB paper currency which is not suitable for circulation, paper currency with a single unfilled corner on the surface and an unfilled corner area larger than 20 square millimeters or paper currency with a plurality of unfilled corners on the surface and an unfilled corner area larger than 30 square millimeters is not suitable for circulation and should be recycled. The single unfilled corner area arranged in the invention is 40 square millimeters or a plurality of unfilled corners on the surface of the ticket, and the unfilled corner area is more than 60 square millimeters. Therefore, if 8 pixels are sampled per millimeter, the banknote is not suitable for circulation and should be recycled when the number of pixels in a single missing area is larger than 2560 or the number of pixels in the total missing area is larger than 3840.
In the foregoing solution, the step S4 specifically includes: matching the similarity of the front and back images of the folding area and the corresponding area in the sample library, and if the front image of the folding area is matched with the front image of the corresponding area in the sample library, rotating and zooming the back image of the folding area to splice the symmetrical positions of the front folding area relative to the broken line; splicing the reverse side images of the parts, corresponding to the folding areas, in the sample library to the reverse side images of the folding areas; splicing the reverse side image of the symmetrical part of the folding area corresponding to the folding area with respect to the folding line in the sample library to the symmetrical position of the reverse side image of the folding area with respect to the folding line;
if the reverse image of the folding area is matched with the reverse image of the corresponding area in the sample library, rotating and zooming the front image of the folding area, and splicing the front image of the folding area to the symmetrical position of the reverse folding area relative to the broken line; splicing the front images of the parts, corresponding to the folding areas, in the sample library to the front images of the folding areas; and splicing the partial front images corresponding to the folding areas in the sample library, which are symmetrical to the folding lines, to the positions of the front images of the folding areas, which are symmetrical to the folding lines.
In the scheme, the step of building the convolutional neural network is as follows:
1) through the input layer, an image is input to the network.
2) And setting n convolution kernels w and an offset b, and performing convolution operation on the image to obtain a C1 layer image. The convolution layer mainly plays a role in extracting image features through convolution operation of an image and a large number of convolution kernels.
3) The image of the C1 layer is reduced to half of the original image by down-sampling the layer. The down-sampling layer generally adopts maximum pooling, mean pooling and the like, and the pixel size is usually 2 x 2. The down-sampling layer can reduce the data amount of operation, and meanwhile, as the image is compressed by the pooling operation, partial information of the image is lost, and some unnecessary details of the image can be erased.
4) And repeating the steps 2) and 3) for a plurality of times of convolution and pooling operations, wherein specific data are determined according to actual conditions, and finally, flattening operation is carried out on the pooled result S4, wherein the flattening operation is to split the original image according to rows and then combine the head and the tail of each row into a one-dimensional array. Assume that the S4 layer image pixel size is 3 x 5 and the flattened image pixel size is 1 x 15.
5) The flattened image is input to the full-link layer F1 for calculation, and the classification result is finally input to the Output layer.
Extracting front and back images of paper money, screening out folded paper money through a convolutional neural network, carrying out boundary detection on the folded paper money, and determining a folding area and a folding position; the image splicing recovery is carried out according to the similarity of the folding area and the sample library, the paper money images in the unfolded state are restored, and true and false identification is carried out on the spliced positive and negative images, so that the phenomenon that paper money is spitted due to misjudgment of the recognizer is reduced, the recognition efficiency of the paper money recognizer is improved, and the efficiency of the self-service of the Internet of things is improved and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below. The drawings in the following description are directed to merely some embodiments of the invention.
FIG. 1 is a flow chart of an embodiment of the present invention for efficient identification of folded notes.
FIG. 2 is a convolutional neural network structure used in an embodiment of the present invention.
FIG. 3 is a diagram of a coordinate system used in an embodiment of the present invention.
FIG. 4 is a view of a folded note (4 corner folds) according to an embodiment of the present invention.
FIG. 5 is a view of a folded note (3 corner folds) according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, the technical solutions adopted, and the technical effects achieved by the present invention clearer, the technical solutions of the embodiments of the present invention will be further described in detail with reference to the accompanying drawings. The described embodiments are only a few embodiments and are intended to illustrate, not limit, the invention.
The present embodiment takes the rmb as an example.
Referring to fig. 1, a flow chart of an effective identification method for folded paper money is provided in the embodiment of the invention. As shown in fig. 1, the method for effectively identifying folded paper money of the present invention comprises the following steps:
step S1: the sensor is arranged to sample 8 pixel points per millimeter, the front and back images of the paper money are collected, and the collected images are subjected to inclination correction.
Step S2: the extracted banknote image pixels are scaled to 32 x 32 and then input to a trained convolutional neural network as shown in fig. 2, and finally the banknote classified as folded is obtained.
In order to train the convolutional neural network, the rmb sample library established in this embodiment includes 30000 front images and 30000 back images. Wherein, the sample storehouse contains the positive and negative image of complete paper currency, angle folding paper currency, angle disappearance paper currency and other damage paper currency.
The convolutional neural network is built by the following steps:
201) input layer Input: the input layer data is an image with 32 x 32 pixels.
202) Convolutional layer C1: the method comprises the steps of forming 6 characteristic graphs with the pixel size of 28 x 28, connecting each neuron in each characteristic graph with a region with the pixel size of 5 x 5 in an input layer (5 x 5 is the size of a convolution kernel), performing convolution calculation, taking a modified linear unit as an activation function, randomly generating the weight of the convolution kernel by using normal distribution with the variance of 0.1, and taking the value of offset as 1.
203) Downsampling layer S2: the method is characterized by comprising 6 characteristic graphs with the pixel size of 14 x 14, each neuron of each characteristic graph is connected with a region with the pixel size of 2 x 2 in the corresponding characteristic graph of the convolutional layer C1, maximum pooling calculation is carried out, and a sigmoid function is used as an activation function.
204) Convolutional layer C3: the feature map is composed of 16 feature maps with the pixel size of 10 x 10. The first 6 feature maps of convolutional layer C3 are input as a subset of the 3 neighboring feature maps in the lower sampling layer S2; the next 6 feature maps are input by 4 subsets of adjacent feature maps in the downsampling layer S2; then 4 feature map subsets which are not adjacent in the 3 lower sampling layers S2 are used as input; the last one takes as input all the feature maps in the downsampled layer S2. Each neuron in each characteristic diagram is connected with a region with the input layer pixel size of 5 x 5, convolution operation is carried out, a modified linear unit is used as an activation function, the weight of a convolution kernel is randomly generated by using normal distribution with the variance of 0.1, and the offset value is 1.
205) Downsampling layer S4: the maximum pooling calculation is performed by connecting 16 feature maps with the pixel size of 5 × 5, each neuron of each feature map to a region with the pixel size of 2 × 2 in the corresponding feature map of convolutional layer C3, and the sigmoid function is used as an activation function.
206) Convolutional layer C5: there are 120 signatures of size 1 x 1, each cell is connected to all 16 regions of size 5 x 5 of the pixels of the downsampled layer S4, convolution calculations are performed, and the linear cells are modified as an activation function. Since the convolution kernel pixel size is 5 × 5, the convolution layer C5 feature map has a pixel size of 1 × 1, constituting a full connection between the downsampled layer S4 and the convolution layer C5.
207) Full connection layer F6: with 84 cells, full-link layer F6 calculates the dot product between the input vector and the weight vector, adds an offset, and finally passes it to the sigmoid function, resulting in a state of a cell.
208) Output layer Output: the system consists of Euclidean Radial Basis Function (Euclidean Radial Basis Function) units, wherein each unit is of one type and four units in total, and each unit has 84 inputs.
In the fully connected layer, the Dropout method is used to avoid overfitting. Dropout refers to randomly disabling the weights of some hidden layer nodes in the network. The optimization method used in the network is an Adam optimizer. After the network is built, the network is pre-trained by using an MNIST data set, and the obtained model is used for initializing the network. And inputting the sample library image data set into the network, and carrying out fine adjustment according to the identification precision. And finally, inputting the image of the paper money to be identified into a convolutional neural network to obtain the identified folded paper money.
Step S3: for the folded banknote obtained in step S2, the tilt-corrected front and back images corresponding to the image acquired in step S1 are extracted and median filtered. And performing edge detection based on straight line fitting on the extracted gray images of the front and back sides of the folded paper money according to a set threshold value. The selection of the set threshold needs to be determined according to actual conditions, generally speaking, the background area of the scanned image is black, the boundary between the image boundary of the rmb and the background is obvious, the set threshold can be estimated only by performing experiments on all the rmbs in the actual system environment, the set threshold is 145,146,147,148, and 146 is adopted here.
Let the length of the acquired image be w and the width be h (w, h have been set on the image acquisition device, both are fixed size, refer to fig. 3).
(301) And finding an upper boundary point and a lower boundary point on the x-w/2 straight line. For the upper boundary point, the search range for y is 0 to h/2, and for the lower boundary point, the search range for y is h to h/2. And recording scanning points with the first-time gray value larger than the set threshold value at two ends of the x-w/2 straight line, namely the detected upper and lower boundary points, and stopping searching. Let the detected upper boundary point be
Figure GDA0002354426370000071
The lower boundary point is
Figure GDA0002354426370000072
(302) In that
Figure GDA0002354426370000073
Searching upper and lower boundary points on the straight line, and recording the obtained upper boundary point
Figure GDA0002354426370000074
And
Figure GDA0002354426370000075
the lower boundary point obtained by recording is
Figure GDA0002354426370000076
And
Figure GDA0002354426370000077
Figure GDA0002354426370000078
where Δ w is the search step.
(303) To be provided with
Figure GDA0002354426370000079
And
Figure GDA00023544263700000710
re-executing step (302) for the initial point when the straight line can not be foundAnd when the boundary points exist, stopping searching, and sequentially forming a sequence by the obtained boundary points, namely an upper boundary point sequence:
Figure GDA00023544263700000711
to be provided with
Figure GDA00023544263700000712
And
Figure GDA00023544263700000713
and (2) executing the step (302) again for the initial point, stopping searching when the boundary point cannot be found by the straight line, and sequentially forming a sequence by the obtained boundary points, namely the sequence of the following boundary points:
Figure GDA00023544263700000714
(304) and searching left and right edge points on the straight line y which is h/2. For the left edge point, searching x ranges from 0 to w/2; and searching the right edge point, wherein the x range is w to w/2, recording scanning points of which the first gray values at two ends of the straight line y are h/2 are greater than a set threshold value, namely the detected left and right edge points, and stopping searching. Let the left edge point obtained at this time be
Figure GDA0002354426370000081
The right edge point is
Figure GDA0002354426370000082
According to the principle of detecting the upper and lower boundary points in the step (302), the left and right edge point sequences can be obtained:
Figure GDA0002354426370000083
and
Figure GDA0002354426370000084
(305) respectively calculating the slope of a straight line between two adjacent points in the upper edge point sequence to obtain a slope set between the adjacent points; finding a most frequently occurring element in a collectionElement, let the element be the slope k1 of the upper edge straight line; then, an element with a larger difference between the absolute value of the slope set and the absolute value of the slope k1 of the upper edge straight line and the element with the largest occurrence frequency is searched (if the slope meeting the condition exists, the upper left corner or the upper right corner of the banknote image is in a folded state), and the element is the first folding slope k2 of the upper edge; the element with the largest number of occurrences, which is found to be the second edge slope k3, is found in the slope set with the opposite sign to the upper edge line slope k1 (if k1 is positive, k2 is found to be negative) and the absolute value of the element is different from the absolute value of the upper edge line slope k 1. Performing least square linear fitting by using all points with the slope of the straight line between the points and adjacent points being equal to the slope k1 of the straight line of the upper edge in the upper edge point sequence to obtain an upper edge linear equation; performing least square linear fitting by using all points, the slope of which is equal to the slope k2 of the first broken line of the upper edge, between the points and adjacent points to obtain a first broken line equation of the upper edge; and performing least square linear fitting by using all the points with the slope of the straight line between the points and the adjacent points equal to the slope k3 of the second fold line of the upper edge to obtain an equation of the second fold line of the upper edge. The same thing can obtain the slope k of the lower edge straight line'1And first, second fold line slope k 'on the lower edge'2And k'3Left and right edge straight line slopes k11 and k 22. As shown in fig. 4.
(306) And calculating the intersection points between the upper edge linear equation and the lower edge linear equation and the left edge linear equation and the right edge linear equation respectively to obtain the coordinates of the four vertexes of the (rectangular) banknote image, and calculating the coordinates of the vertexes of the folding lines by using the first folding line equation and the upper edge linear equation and the lower edge linear equation as well as the upper edge linear equation and the lower edge linear equation and the left edge linear equation and the right edge linear equation. As in fig. 4, there are 4 break angles, and the slopes of the upper, lower, left, right edges and four broken lines are as labeled in the figure. In FIG. 5, there are three folding angles, and the slope of the upper, lower, left and right edges of the three folding lines can be obtained, and the slopes of the three folding lines are marked as in the figure. The intersection points between the straight line equations of the upper edge and the lower edge and the left edge and the right edge respectively can be obtained through calculation, and the coordinates of four vertexes of the complete banknote image (rectangle) can be obtained. And (3) calculating the coordinates of the folding points by the first and second folding line equations and the upper, lower, left and right edge straight line equations, and determining the folding areas and the positions of the folding areas.
The setting of the pixel point threshold in this embodiment is as follows: 8 pixel points are sampled per square millimeter, the threshold value of the pixel point of a single missing area is 2560, and the number of the pixels of the total missing area is more than 3840. Then, the pixel count of each folding area is counted, and if the pixel count of any folding area is greater than a set threshold 2560 or the pixel count of the total folding area is greater than 3840, the folding area of the paper currency is too large, and the paper currency is regarded as abnormal paper currency. Otherwise, the subsequent identification process is continued.
And step S4, determining the folding area and the position of the banknote image in the step S3, and performing image splicing to restore the image.
Step 401 performs similarity matching on front and back images of the folded region and a corresponding region in the sample library (hereinafter, the images are all reflection images). If the front images of the folding areas are matched with the front images of the corresponding areas in the sample library, rotating and zooming the back images of the folding areas, and splicing the back images of the folding areas to the symmetrical positions of the front folding areas relative to the broken lines; splicing the reverse side images of the parts, corresponding to the folding areas, in the sample library to the reverse side images of the folding areas; and splicing the reverse side image of the part, which corresponds to the folding area and is symmetrical to the folding line, of the sample library to the position, which is symmetrical to the folding line, of the reverse side image of the folding area. Similarly, when the back image of the folding area is matched with the back image of the corresponding area in the sample library, the front and back images of the paper money can be completed.
And step S5, performing true and false recognition on the spliced banknote images, and performing similarity matching on the spliced front and back images and the images in the sample library to realize true and false recognition.
The invention has the beneficial effects that: extracting front and back images of the paper money, screening out folded paper money through a convolutional neural network, carrying out boundary detection on the folded paper money, and determining a folding area and a folding position; and carrying out image splicing recovery according to the similarity of the folding area and the sample library, and carrying out true and false identification on the spliced positive and negative images.

Claims (4)

1. An effective folded banknote recognition method is characterized by comprising the following steps:
step S1: setting a sensor to sample 8 pixel points per millimeter, and acquiring front and back images of the paper money;
step S2: reducing the pixels of the collected front and back images of the paper currency into 32 × 32, and inputting the pixels into a trained convolutional neural network to obtain corner folded paper currency;
step S3: extracting the front and back images of the corner folded banknote acquired in the step S1 from the corner folded banknote acquired in the step S2, performing median filtering, and performing edge detection based on straight line fitting on the gray level images of the front and back images of the extracted corner folded banknote according to a set threshold value, thereby determining each folding area and folding position of the corner folded banknote;
the length of the acquired banknote image is w, the width of the acquired banknote image is h, and the specific method comprises the following steps:
301) searching scanning points with the first gray value larger than a set threshold value at two ends of the line with x being equal to w/2, namely the detected upper and lower boundary points, and enabling the detected upper boundary point to be
Figure FDA0002626562880000011
The lower boundary point is
Figure FDA0002626562880000012
Wherein
Figure FDA0002626562880000013
Is in the range of 0 to h/2,
Figure FDA0002626562880000014
the search range of (1) is h to h/2;
302) in that
Figure FDA0002626562880000015
Searching upper and lower boundary points on the straight line, and recording the obtained upper boundary point
Figure FDA0002626562880000016
And
Figure FDA0002626562880000017
recording the obtained lower boundary point
Figure FDA0002626562880000018
And
Figure FDA0002626562880000019
Figure FDA00026265628800000110
wherein, Δ w is a search step length;
303) to be provided with
Figure FDA00026265628800000111
And
Figure FDA00026265628800000112
step 302) is repeatedly executed for the initial point, when the boundary point can not be found on the set straight line, the search is stopped, and the obtained boundary points form an upper edge point sequence in sequence;
to be provided with
Figure FDA00026265628800000113
And
Figure FDA00026265628800000114
step 302) is repeatedly executed for the initial point, when the boundary point cannot be found on the set straight line, the search is stopped, and the obtained boundary points form a lower edge point sequence in sequence;
304) searching scanning points with the first gray value larger than a set threshold value at two ends of the straight line y being h/2, namely the detected left and right edge points, and setting the left edge point as the left edge point
Figure FDA00026265628800000115
The right edge point is
Figure FDA00026265628800000116
Wherein
Figure FDA00026265628800000117
The search range of (1) is 0 to w/2;
Figure FDA00026265628800000118
the search range of (1) is w to w/2, and a left edge point sequence and a right edge point sequence are obtained according to the principle of detecting upper and lower edge points in the step 302);
305) respectively calculating the slope of a straight line between two adjacent points in the upper edge point sequence to obtain a slope set between the adjacent points; finding an element with the most occurrence times in the slope set, and enabling the element to be the slope k1 of the upper edge straight line; then, searching an element with larger absolute value difference and the most occurrence times between the absolute value and the upper edge straight line slope k1 in the slope set, and enabling the element to be the first folding line slope k2 of the upper edge; finding the element with the maximum occurrence frequency and the opposite sign of the slope k1 of the upper edge straight line in the slope set, wherein the absolute value of the element is different from the absolute value of the slope k1 of the upper edge straight line, and the element is made to be the slope k3 of the second fold line of the upper edge; performing least square linear fitting by using all points with the slope of the straight line between the points and adjacent points being equal to the slope k1 of the straight line of the upper edge in the upper edge point sequence to obtain an upper edge linear equation; performing least square linear fitting by using all points with the slope of the straight line between the points and the adjacent points being equal to the slope k2 of the first broken line to obtain a first broken line equation of the upper edge; performing least square linear fitting by using all points with the slope of the straight line between the points and the adjacent points being equal to the slope k3 of the second fold line to obtain a second fold line equation of the upper edge;
respectively calculating the slope of a straight line between two adjacent points in the lower edge point sequence to obtain a slope set between the adjacent points; finding an element with the most occurrence times in the slope set, and enabling the element to be the slope k 'of the lower edge straight line'1(ii) a Then find the absolute value in the slope set and the slope k of the lower edge straight line'1The element with larger absolute value difference and the most occurrence number is taken as the lower edge first folding line slope k'2(ii) a Finding and lower edge straight line slope k 'in slope set'1Of opposite sign and absolute value to the slope k of the lower edge straight line'1Is the element with the largest occurrence number, and the element is the slope k 'of the second fold line of the lower edge'3(ii) a In the sequence of lower edge points, the slope of the straight line between all the adjacent points is equal to the slope k 'of the lower edge straight line'1Performing least square linear fitting to obtain a lower edge linear equation; with the slope of the straight line between all and adjacent points being equal to the slope k 'of the first folding line of the lower edge'2Performing least square linear fitting to obtain a first broken line equation of the lower edge; with the slope of the straight line between all and adjacent points being equal to the slope k 'of the second fold line of the lower edge'3Performing least square linear fitting to obtain a second fold line equation of the lower edge;
respectively calculating the slope of a straight line between two adjacent points in the left edge point sequence to obtain a slope set between the adjacent points, and searching an element with the most occurrence times in the slope set to enable the element to be the slope k11 of the left edge straight line; performing least square linear fitting on all points in the left edge point sequence, wherein the slope of a straight line between each point and each adjacent point is equal to the slope k11 of the left edge straight line, so as to obtain a left edge straight line equation;
respectively calculating the slope of a straight line between two adjacent points in the right edge point sequence to obtain a slope set between the adjacent points, and searching an element with the largest occurrence frequency in the slope set to enable the element to be the slope k22 of the right edge straight line; performing least square linear fitting by using all points with the slope of the straight line between the points and the adjacent points being equal to the slope k22 of the straight line of the right edge in the right edge point sequence to obtain a straight line equation of the right edge;
306) calculating the intersection points between the upper edge linear equation and the lower edge linear equation and the left edge linear equation and the right edge linear equation respectively to obtain coordinates of four vertexes of the complete banknote image, and calculating the vertex coordinates of the first broken line and the second broken line of the upper edge and the lower edge by using the first broken line equation and the second broken line equation of the upper edge and the lower edge and the upper edge linear equation, the lower edge linear equation, the left edge linear equation and the right edge linear equation to determine each folding area and each folding position;
307) counting the pixel number of each folding area, if the pixel number of one folding area is greater than the threshold value of a single missing area or the total folding area of a plurality of folding angles is greater than the threshold value of the total missing area, determining that the folding area of the paper currency is too large, rejecting the paper currency which is not normal, and otherwise, continuing to step S4;
s4, according to the folding area and the folding position of the corner folding banknote image determined in the step S3, performing image splicing on the front and back images of the corner folding banknote to restore the image of the folding area;
and step S5, performing similarity matching on the spliced angle folding paper currency image and the front and back side images of the complete paper currency in the sample library to realize true and false identification.
2. A folded banknote validation method according to claim 1, wherein said step S2 includes:
201) establishing a paper currency sample library, constructing a convolutional neural network, setting the result of an output layer as a complete paper currency 0, an angle folding paper currency 1, an angle missing paper currency 2 and other damaged paper currencies 3, pre-training the convolutional neural network by using an MNIST data set, inputting an image data set of the paper currency sample library into the convolutional neural network, and adjusting the convolutional neural network according to the recognition accuracy;
202) and inputting the collected front and back images of the paper money into the trained convolutional neural network to obtain the corner folding paper money.
3. A folded banknote validation method according to claim 1 wherein the single missing region threshold is set to 2560 and the total missing region threshold is set to 3840.
4. The method for effectively discriminating folded bills as claimed in claim 1, wherein the step S4 is specifically: matching the similarity of the front and back images of the folding area and the corresponding area in the sample library, and if the front image of the folding area is matched with the front image of the corresponding area in the sample library, rotating and zooming the back image of the folding area to splice the symmetrical positions of the front folding area relative to the broken line; splicing the reverse side images of the parts, corresponding to the folding areas, in the sample library to the reverse side images of the folding areas; splicing the reverse side image of the symmetrical part of the folding area corresponding to the folding area with respect to the folding line in the sample library to the symmetrical position of the reverse side image of the folding area with respect to the folding line;
if the reverse image of the folding area is matched with the reverse image of the corresponding area in the sample library, rotating and zooming the front image of the folding area, and splicing the front image of the folding area to the symmetrical position of the reverse folding area relative to the broken line; splicing the front images of the parts, corresponding to the folding areas, in the sample library to the front images of the folding areas; and splicing the partial front images corresponding to the folding areas in the sample library, which are symmetrical to the folding lines, to the positions of the front images of the folding areas, which are symmetrical to the folding lines.
CN201810059119.4A 2018-01-22 2018-01-22 Effective identification method for folded paper money Active CN108320372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810059119.4A CN108320372B (en) 2018-01-22 2018-01-22 Effective identification method for folded paper money

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810059119.4A CN108320372B (en) 2018-01-22 2018-01-22 Effective identification method for folded paper money

Publications (2)

Publication Number Publication Date
CN108320372A CN108320372A (en) 2018-07-24
CN108320372B true CN108320372B (en) 2020-10-09

Family

ID=62887517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810059119.4A Active CN108320372B (en) 2018-01-22 2018-01-22 Effective identification method for folded paper money

Country Status (1)

Country Link
CN (1) CN108320372B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109191407A (en) * 2018-09-20 2019-01-11 湘潭大学 A kind of a scrap of paper splicing restored method and system based on extreme learning machine
CN112233313B (en) * 2020-10-19 2022-06-21 中国工商银行股份有限公司 Paper money identification method, device and equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026068A (en) * 2005-07-15 2007-02-01 Toshiba Corp Paper sheet judging method and device
WO2011132806A1 (en) * 2010-04-23 2011-10-27 한국조폐공사 Folding-type portable counterfeit detector
CN104809715B (en) * 2014-01-23 2018-04-20 广州南沙资讯科技园有限公司博士后科研工作站 Banknote image slant correction and method for extracting region
CN104851183A (en) * 2015-05-15 2015-08-19 深圳怡化电脑股份有限公司 Paper currency face and orientation recognition method and device
CN105354914B (en) * 2015-08-18 2018-01-02 深圳怡化电脑股份有限公司 A kind of bank note knuckle is towards recognition methods and device
CN105551133B (en) * 2015-11-16 2018-11-23 新达通科技股份有限公司 The recognition methods and system of a kind of bank note splicing seams or folding line
CN106898081B (en) * 2017-02-28 2019-11-15 深圳怡化电脑股份有限公司 A kind of extracting method and device of dog-ear bank note

Also Published As

Publication number Publication date
CN108320372A (en) 2018-07-24

Similar Documents

Publication Publication Date Title
Doush et al. Currency recognition using a smartphone: Comparison between color SIFT and gray scale SIFT algorithms
KR102207533B1 (en) Bill management method and system
Hasanuzzaman et al. Robust and effective component-based banknote recognition by SURF features
Kumar et al. Writer-independent off-line signature verification using surroundedness feature
CN104464079B (en) Multiple Currencies face amount recognition methods based on template characteristic point and topological structure thereof
JP4932177B2 (en) Coin classification device and coin classification method
CN103456003A (en) Device and method for tracking object by using characteristic point descriptor, device and method for removing erroneous characteristic
CN101142584A (en) Method for facial features detection
Tessfaw et al. Ethiopian banknote recognition and fake detection using support vector machine
JP5372183B2 (en) Coin classification device and coin classification method
CN107103683B (en) Paper money identification method and device, electronic equipment and storage medium
Youn et al. Efficient multi-currency classification of CIS banknotes
CN104715240A (en) Hong Kong dollar texture image version classifying method based on gray-level co-occurrence matrix
CN115272652A (en) Dense object image detection method based on multiple regression and adaptive focus loss
CN108320372B (en) Effective identification method for folded paper money
Cruz et al. Feature representation selection based on classifier projection space and oracle analysis
Aseffa et al. Ethiopian banknote recognition using convolutional neural network and its prototype development using embedded platform
CN113688821A (en) OCR character recognition method based on deep learning
Mannan et al. Optimized segmentation and multiscale emphasized feature extraction for traffic sign detection and recognition
Harfiya et al. Offline signature verification based on pyramid histogram of oriented gradient features
Bahrani Deep learning approach for Indian currency classification
Sousa et al. Banknote identification methodology for visually impaired people
Liu et al. New and old banknote recognition based on convolutional neural network
Jadhav et al. GM,“Forged Multinational Currency Identification and Detection System using Deep Learning Algorithm,”
Zhao et al. The recognition of RMB serial number based on CNN

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