Paper currency number recognition apparatus and recognition method
09741193 · 2017-08-22
Assignee
Inventors
Cpc classification
G07D7/0047
PHYSICS
International classification
Abstract
A paper currency number recognition apparatus and method. The apparatus comprises: a contact-type sensor (10) for acquiring paper currency image data; a white-light LED transmission light source board (20); an image acquisition processing board (40) which is integrated with an FPGA and a DSP, the FPGA being used for controlling ON/OFF of the white-light LED transmission light source board (20) and driving the contact-type sensor (10) to acquire an image, and the DSP being used for processing and recognizing the paper currency image data; and two pairs of position sensors (30) for detecting whether there is a paper currency entering the paper currency number recognition apparatus, wherein the white-light LED transmission light source board (20) has two light source modes which are strong and weak, and the two light source modes alternately provide a transmission light source for the contact-type sensor (10) to acquire the paper currency image data. The apparatus can acquire two white-light transmission images with different brightness of one and the same paper currency each time; therefore, the numbers of both new and old paper currencies can be effectively recognized, and the accuracy rate of paper currency number recognition is improved.
Claims
1. A paper currency number recognition device, comprising: a contact sensor configured to acquire paper currency image data by way of transmission imaging; a white light LED transmission light source board arranged right in front of the contact sensor to provide the contact sensor with a transmission light source for use in collecting the paper currency image data; an image collection processing plate connected to the contact sensor through a data cable, wherein a Field Programmable Gate Array and a digital signal processor are integrated on the image collection processing plate, the Field Programmable Gate Array is configured to control the white light LED transmission light source board to be on or off and drive a CIS to acquire images, and the digital signal processor is configured to process and recognize the paper currency image data; and two pairs of position sensors arranged on a paper currency transport pathway at a position with a predetermined distance from the contact sensor and configured to detect whether there is a paper currency entering the paper currency number recognition device; wherein the white light LED transmission light source board has a strong light mode and a weak light mode, and the two light modes alternately provides the contact sensor with the transmission light source for use in collecting the paper currency image data, and wherein, after the Field Programmable Gate Array completes collection of a row of image data, the Field Programmable Gate Array informs the digital signal processor in a manner of an interruption of acquiring data, and the digital signal processor enters an interrupt service routine and detects an image type register to determine a type of the row of image data.
2. The paper currency number recognition device according to claim 1, wherein the two light modes are formed by controlling turn-on time of the white light LED transmission light source board by the Field Programmable Gate Array, the strong light mode is formed in a case that the turn-on time is longer, the weak light mode is formed in a case that the turn-on time is shorter, and the ratio between the turn-on time for forming the strong light mode and the turn-on time for forming the weak light mode is 3:1.
3. The paper currency number recognition device according to claim 1, wherein a memory is integrated on the image collection processing plate, the memory comprises two buffers and the register, the buffers are configured to store the paper currency image data collected by the contact sensor, and the register is configured to indicate a type of the paper currency image data in the buffers, with 1 indicating strong light image data and 0 indicating weak light image data.
4. The paper currency number recognition device according to claim 1, wherein a clock MCLK with a cycle of 0.125 ms and a row counter are provided inside the Field Programmable Gate Array.
5. A paper currency number recognition method, comprising: step 1 comprising acquiring strong light image data and weak light image data of a paper currency by way of transmission imaging in the case that a transmission light source irradiates alternately in a strong light mode and in a weak light mode; step 2 comprising performing an edge detection on the weak light image data to acquire four edges of an image to determine a target image; step 3 comprising processing the target image to recognize a version, a nominal value, an orientation of the paper currency and determine an area where the paper currency number is located; step 4 comprising calling a pattern recognition algorithm, comparing a gray value of the paper currency image with a threshold value by using a pattern recognition method based on artificial neural networks to recognize that the paper currency is new or old, and using the strong light image data for recognition in the case of an old paper currency, or selecting the weak light image data for recognition in the case of a new paper currency; and step 5 comprising outputting a recognition result of the paper currency number, wherein, after the Field Programmable Gate Array completes collection of a row of image data, the Field Programmable Gate Array informs the digital signal processor in a manner of an interruption of acquiring data, and the digital signal processor enters an interrupt service routine and detects an image type register to determine a type of the row of image data.
6. The paper currency number recognition method according to claim 5, wherein four vertex coordinates of the paper currency image are acquired, slope-a slopes of lines at which borders of the paper currency is located is computed by using a least square line fitting method, and four edges of the image are acquired, in step 2.
7. The paper currency number recognition method according to claim 5, wherein acquiring strong light image data and weak light image data of a paper currency in step 1 comprises: step 101 comprising detecting a state of a position sensor; step 102 comprising judging whether the position sensor is triggered, proceeding to step 103 in the case that the position sensor is triggered, or returning to step 101 in the case that the position sensor is not triggered; step 103 comprising starting to scan to acquire the paper currency image data, resetting a row counter, and proceeding to step 104; step 104 comprising detecting a rising edge of a MCLK; step 105 comprising judging whether the rising edge of the MCLK is detected, proceeding to step 106 in the case that the rising edge of MCLK is detected, or returning to step 104 in the case that the rising edge of MCLK is not detected; step 106 comprising switching a LED for strong light irradiation; step 107 comprising driving, by a FPGA, a CIS to collect a row of image data, and proceeding simultaneously to step 108 and step 120, wherein step 108 and subsequent steps of step 108 are performed in parallel with step 120 and subsequent steps of step 120; step 108 comprising detecting the rising edge of the MCLK again; step 109 comprising judging whether the rising edge of the MCLK is detected, proceeding to step 110 in the case that the rising edge of the MCLK is detected, or returning to step 108 in the case that the rising edge of the MCLK is not detected; step 110 comprising switching the LED for weak light irradiation; step 111 comprising driving, by the FPGA, the CIS to collect a row of image data again, and proceeding simultaneously to step 112 and step 120, wherein step 112 and subsequent steps of step 112 are performed in parallel with step 120 and subsequent steps of step 112; step 112 comprising adding 2 to the row counter in the FPGA; step 113 comprising judging whether the count of the row counter in FPGA is equal to 960, proceeding to step 114 in the case that the count of the row counter in FPGA is equal to 960, or returning to step 104 in the case that the count of the row counter in FPGA is not equal to 960; step 114 comprising completing image collection and ending scan; step 120 comprising a DSP entering an interrupt service routine; step 121 comprising detecting the image type register; step 122 comprising judging whether the image data is strong light image data, proceeding to step 123 in the case that the image data is strong light image data, or proceeding to step 124 in the case that the image data is not strong light image data; step 123 comprising storing a row of data into a strong light image buffer; and step 124 comprising storing a row of data into a weak light image buffer.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
DETAILED DESCRIPTION
(4) Hereinafter, the technical solutions in embodiments of the disclosure are described clearly and completely in conjunction with the drawings.
(5) The paper currency number recognition device according to a preferable embodiment of the disclosure, as shown in
(6) In the case that a paper currency enters the transport pathway and triggers the position sensors 30, FPGA drives CIS to collect image data by way of a line by line scan. In order to make the image clear, the transverse resolution of CIS is set to 200 dpi and the longitudinal resolution of CIS is set to 100 dpi. It's provided that the paper currency passes through the pathway at a constant speed of 1 m/s. For obtaining two images with the longitudinal resolution of 100 dpi, FPGA needs to complete collection of a row of image data as the paper currency proceeds approximately each 0.125 mm. Therefore, a clock MCLK with a cycle of 0.125 ms is provided inside FPGA. Once a rising edge of the clock is detected, it indicates that the paper currency proceeds 0.125 mm, and then the scan process is started and a row of image data is scanned.
(7) In order to obtain two images with different brightness, LED generates two different lights of strong and weak. The turn-on time of LED is set to two different values and the ratio between which is one to three (two factors correspond to the processing of the new paper currency and the processing of the old paper currency respectively). In a practical testing, the two factors correspond to 30 μs and 90 μs respectively, both of which are less than the time for the paper currency proceeding 0.125 mm, and LED is in the off state in the rest of the time for the paper currency proceeding 0.125 mm. During the proceeding of the paper currency, FPGA switches the turn-on time of LED once and lights LED upon detection of the rising edge of MCLK each time. In the LED irradiation period of time, CIS is sensitized, and then LED lights out when the period of time reaches an upper limit of the turn-on time. For one paper currency, if it's irradiated by the LED with strong lights, the lights induced by CIS become stronger, and the amplitude of a signal output is larger, a row of strong light image data is formed by converting the signal output by the analog to digital AD converter; or if it's irradiated by the LED with weak lights, the lights induced by CIS become weaker, and the amplitude of the signal output is smaller, a row of weak light image data is formed by converting the output by the analog to digital AD converter. FPGA acquires the row of data into the image buffer therein within 0.125 ms.
(8) When FPGA acquires data, in addition to the image buffer, a register is also provided and is configured to indicate a type of the image data in the image buffers, with 1 indicating strong light image data and 0 indicating weak light image data. Two buffers are provided inside DSP to store the two types of the image data respectively. After FPGA completes collection of a row of image data, FPGA informs DSP in a manner of an interruption of acquiring data. DSP enters an interrupt service routine and detects an image type register in FPGA to determine the image type this time, and then the enhanced direct memory access (EDMA) transmission is started, the data is stored in order into a space for the respective image type. FPGA scans 120 mm (corresponding to collect 960 rows of data) and ends scan. In the case that all of the image data is transmitted, each of the two buffers in DSP may obtain one image, one image is bright and the other image is dim, each has 480 rows.
(9) DSP recognizes the two images of one bright and the other dim as a whole, performs recognition on the bright image in the case where it is determined that the images belongs to an old paper currency, or performs recognition on the dim image in the case where it is determined that the images does not belong to an old paper currency, and thus the paper currency number of the paper currencies of the new and old is recognized.
(10) Specifically, as shown in
(11) Since the edge of the weak light image differs greatly from the background in pixel values, edge detection may be performed on both the new and old paper currencies by using the weak light image. Hence, the weak light image data is used to perform edge detection to obtain the target image in step 2.
(12) In step 3, since the position of the paper currency number on the paper currency is fixed, the area of the paper currency number may be determined depending on the version, the nominal value, the orientation of the paper currency.
(13) Preferably, four vertex coordinates of the paper currency image are acquired firstly, slopes of lines at which borders of the paper currency are located are computed by using a least square line fitting method, and four edges of the image are acquired, in step 2.
(14) As shown in
(15) Step 120 to step 124 is the a storing process for a image, that is to say, image data of a row of a image is stored once the row of the image is scanned, and the storing process is performed according to the type of the image data. The storing process may be proceeded in parallel with the image scan process. For example, after step 107, step 108 and step 120 are simultaneously proceeded to. Alternatively, firstly the image data may be stored once a row of image is scanned, and then a next row of image is scanned, that is to say, after step 107, step 120 is proceeded to, and the step 121, step 122 are performed in turn, until step 123 or step 124 is performed, and then step 108 is performed. In this case, the processing speed is reduced, and the setting of the cycle of the clock MCLK inside the Field Programmable Gate Array may be influenced, and the setting of the turn-on time of the white light LED transmission light source may also be influenced, the cycle and the turn-on time both may need to be adjusted. Therefore, preferably, the image scan and the reading and storing of each row of the image data proceed in parallel.
(16) In the case of scanning in single mode, only one weak light image data is collected, and the paper currency with worn degree or defaced degree of less than 50% meets the condition for algorithm recognition. For the old paper currency, the light transmittance is reduced due to the dirt, oil existing on the surface, and thus the gray value of the image is too low. Although the edge of the image may be acquired correctly, the contrast ratio of the image is too low. the nominal value and the orientation of the paper currency can not be recognized by applying the algorithm effectively, and then the position of the paper currency number on the paper currency can not be determined. Also, with low contrast ratio, it is difficult to distinguish the paper currency, and the accuracy for the recognition of the paper currency number is greatly decreased and the recognition effect is influenced seriously. In the case that the light is strengthened, only one strong light image data is collected, the old paper currency meets the condition for the algorithm of the recognition. But the new paper currency can not meet the condition for the algorithm of the recognition, because the high light transmittance causes the image is prone to be overexposed for the new paper currency and the edge of the image is missed. Therefore the length and width of the paper currency can not be determined by applying the algorithm effectively. An individual digit in the paper currency number may also be missed and thus an error occurs in the recognition.
(17) Dual modes are used in the embodiment, the algorithm is performed in the recognition on the bright image of the old paper currency images and is performed in the recognition on the dim image of the new paper currency images, in which the paper currency number image is clearer and suitable for the algorithm to determine the position of the paper currency number and recognize the paper currency correctly.
(18) What is described above is only the detailed description of the disclosure, but the scope of protection of the disclosure is not limited thereto. Any changes and substitutions realized easily by any one of those skilled in the art within the scope of technologies disclosed in the disclosure are all contained in the scope of protection of the disclosure. Hence, the scope of protection of the disclosure subjects to the scope of protection of the claims.