Bill number recognition method and device, electronic equipment and storage medium

By repeatedly performing various binarization and character segmentation operations, adapting to different invoice formats and printing manufacturers' styles, the problem of low accuracy in invoice number recognition is solved, achieving efficient invoice number recognition.

CN116580410BActive Publication Date: 2026-03-27GRG BANKING EQUIPMENT CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-12
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in recognizing ticket numbers when dealing with tickets of different formats and printing styles. This is mainly because fixed-type grayscale and coordinate detection operations cannot adapt to the differences in various ticket formats and printing manufacturers.

Method used

By iteratively performing different binarization and character segmentation operations until a clear target character segmentation image is obtained, various methods such as color channel interpolation, adaptive binarization, high thresholding, low thresholding, and gradient binarization are used, combined with connected component method and projection method for character segmentation, to adapt to different ticket formats and printing manufacturers' styles.

Benefits of technology

It improves the accuracy of invoice number recognition, adapts to different invoice formats and printing styles, and enhances the accuracy and efficiency of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116580410B_ABST
    Figure CN116580410B_ABST
Patent Text Reader

Abstract

The application discloses a kind of bill number identification method, device, electronic equipment and storage medium, belong to image processing technical field.The method comprises: obtaining the target bill image of bill to be identified;The binary operation is executed to the target bill image, and target binary image is obtained;The character segmentation operation is executed to the target binary image;In the case where the character segmentation operation is not obtained corresponding target character segmentation image, the binary operation and the character segmentation operation are re-executed, until the target character segmentation image is obtained;The character recognition is carried out to the target character segmentation image, and the number identification information corresponding to the bill to be identified is obtained;Wherein, the binary processing mode of last time execution binary operation is different from the binary processing mode of previous time execution binary operation.The method can improve the identification accuracy of bill number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to a method, apparatus, electronic device and storage medium for recognizing ticket numbers. Background Technology

[0002] With the rapid development of my country's economy and trade, financial services have been widely adopted and applied in cities and regions of all sizes. When handling financial transactions related to negotiable instruments such as checks, deposit certificates, and business authorization letters, the serial number in the negotiable instrument is also called the negotiable instrument number, or simply the instrument number. It serves as the basis for recording and indexing the aforementioned negotiable instruments and is also one of the important means of retrieving and locating the corresponding negotiable instruments and transactions in subsequent management and transactions.

[0003] Automatic ticket number recognition is a fundamental technology for financial self-service equipment. However, because there are multiple versions of tickets, and even tickets of the same version can have significant differences in ticket number characteristics due to different printing manufacturers.

[0004] Currently, most automatic ticket number recognition uses detection technologies such as grayscale and coordinate detection. When using grayscale and coordinate detection for automatic recognition, fixed types of grayscale and coordinate detection operations are usually used to execute the ticket number recognition process. When encountering tickets of different formats or ticket styles from different printing manufacturers, the accuracy of ticket number recognition is low. Summary of the Invention

[0005] This application aims to at least solve one of the technical problems existing in the prior art. To this end, this application proposes a method, apparatus, electronic device, and storage medium for identifying ticket numbers, thereby improving the accuracy of ticket number identification.

[0006] Firstly, this application provides a method for identifying invoice numbers, the method comprising:

[0007] Obtain the target document image of the document to be identified;

[0008] Perform a binarization operation on the target ticket image to obtain a target binarized image;

[0009] Perform character segmentation on the target binarized image;

[0010] If the character segmentation operation does not yield the corresponding target character segmentation image, the binarization operation and the character segmentation operation are re-executed until the target character segmentation image is obtained.

[0011] Perform character recognition on the target character segmentation image to obtain the number recognition information corresponding to the ticket to be recognized;

[0012] The binarization process performed in the latter instance differs from the binarization process performed in the former instance.

[0013] According to the invoice number recognition method of this application, when a clear target character segmentation image cannot be obtained, a different binarization processing method is re-adopted than the previous one. The binarization operation and character segmentation operation are executed cyclically to find and use a suitable binarization processing method and character segmentation operation to adapt to different invoice formats and invoice styles of different printing manufacturers, thereby improving the accuracy of invoice number recognition.

[0014] According to one embodiment of this application, performing character segmentation on the target binarized image includes:

[0015] Perform first character segmentation processing on the target binarized image;

[0016] If the first character segmentation process fails to produce the target character segmentation image, the second character segmentation process is performed on the target ticket image.

[0017] Obtaining the target character segmentation image includes:

[0018] Obtain the target character segmentation image corresponding to the second character segmentation process.

[0019] According to one embodiment of this application, performing character segmentation on the target binarized image includes:

[0020] Perform first character segmentation processing on the target binarized image;

[0021] Obtaining the target character segmentation image includes:

[0022] Obtain the target character segmentation image corresponding to the first character segmentation process.

[0023] According to one embodiment of this application, the character segmentation operation includes at least one of a first character segmentation process and a second character segmentation process, wherein the first character segmentation process is connected component character segmentation and the second character segmentation process is projection character segmentation.

[0024] According to one embodiment of this application, the binarization operation includes at least one of color channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization, and gradient binarization.

[0025] According to one embodiment of this application, the step of performing character recognition on the target character segmentation image to obtain the number recognition information corresponding to the ticket to be recognized includes:

[0026] performing single character feature extraction on the target character segmentation image to obtain feature information corresponding to a single character in the target character segmentation image;

[0027] performing classification recognition on the feature information to obtain the number recognition information.

[0028] In a second aspect, the present application provides a bill number recognition device, which comprises:

[0029] an acquisition module configured to acquire a target bill image of a bill to be recognized;

[0030] a first processing module configured to perform a binarization operation on the target bill image to obtain a target binarization image;

[0031] a second processing module configured to perform a character segmentation operation on the target binarization image;

[0032] a third processing module configured to, in a case where the character segmentation operation does not obtain a corresponding target character segmentation image, re-perform the binarization operation and the character segmentation operation until the target character segmentation image is obtained;

[0033] a fourth processing module configured to perform character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized;

[0034] wherein a binarization processing mode of a last time of performing the binarization operation is different from a binarization processing mode of a previous time of performing the binarization operation.

[0035] According to the bill number recognition device of the present application, when a clear target character segmentation image cannot be obtained, a binarization processing mode different from the previous one is used to perform the binarization operation and the character segmentation operation repeatedly, so that a suitable binarization processing mode and character segmentation operation can be found and used to adapt to different bill formats and different bill styles of different printing manufacturers, thereby improving the recognition accuracy of bill numbers.

[0036] In a third aspect, the present application provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the bill number recognition method of the first aspect when executing the computer program.

[0037] In a fourth aspect, the present application provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the bill number recognition method of the first aspect.

[0038] In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the bill number recognition method according to the first aspect above.

[0039] Additional aspects and advantages of the present application will be made apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0040] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the following description, taken in conjunction with the accompanying drawings, in which:

[0041] Figure 1 is one of flow diagrams of the bill number recognition method provided by the embodiments of the present application;

[0042] Figure 2 is a structural diagram of the financial self-service equipment provided by the embodiments of the present application;

[0043] Figure 3 is another flow diagram of the bill number recognition method provided by the embodiments of the present application;

[0044] Figure 4 is a structural diagram of the bill number recognition device provided by the embodiments of the present application;

[0045] Figure 5 is a structural diagram of the electronic device provided by the embodiments of the present application.

[0046] LIST OF REFERENCES

[0047] The signal acquisition module 210, the image preprocessing module 220, and the OCR recognition module 230. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present application.

[0049] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0050] The following description, in conjunction with the accompanying drawings, details the invoice number recognition method, invoice number recognition device, electronic device, and readable storage medium provided in this application through specific embodiments and application scenarios.

[0051] The ticket number identification method can be applied to a terminal, specifically executed by the hardware or software within the terminal.

[0052] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).

[0053] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.

[0054] like Figure 1 As shown, the ticket number identification method includes steps 110 to 150.

[0055] Step 110: Obtain the target document image of the document to be identified.

[0056] The ticket to be identified can be a ticket placed at the inlet of a financial self-service machine. An image sensor can be set up at the inlet of the financial self-service machine to obtain the target ticket image and the corresponding number identification information, so that the financial self-service machine can perform further operations on the ticket to be identified.

[0057] The target document image can be obtained by acquiring it through a complementary metal-oxide-semiconductor (CMOS) image sensor and then performing an image cropping operation.

[0058] In actual execution, a complementary metal oxide semiconductor image sensor can be arranged at a bill inlet of the financial self-service device, and the complementary metal oxide semiconductor image sensor can be in contact with the bill to be identified when the bill to be identified is placed in the bill inlet, and the image sensor collects an original bill image of the bill to be identified.

[0059] It can be understood that the original bill image is an image including a number area of the bill to be identified, and since most bills are printed according to fixed rules, the position of the bill number in the target bill image is relatively fixed, and the original bill image can be cropped according to the position of the bill number to obtain an image corresponding to the number area of the bill to be identified, that is, the target bill image.

[0060] Step 120, performing a binarization operation on the target bill image to obtain a target binarization image.

[0061] The binarization operation on the target bill image is to set the gray value of the pixel in the target bill image to 0 or 255, and the image with only 0 or 255 gray values presents a visual effect of only black and white.

[0062] In actual execution, the gray value of the character image in the target bill image can be set to 255, and the gray value of the background image can be set to 0, so as to obtain a target binarization image corresponding to the target bill image with white characters on a black background.

[0063] In this embodiment, the target binarization image obtained has only two gray levels, and there is no filtering value in the middle, and the target binarization image can exhibit the outline of the number in the target bill image through the density of the pixel points.

[0064] In actual execution, the binarization operation on the target bill image can be performed by using a color channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization, or gradient binarization.

[0065] Before the binarization processing of the target bill image, the target bill image can also be preprocessed to improve the effect of the binarization processing. The preprocessing can be image edge detection and image correction operations on the target bill image, so as to better identify the target bill image and obtain number recognition information with higher accuracy.

[0066] Step 130, performing a character segmentation operation on the target binarization image.

[0067] The character segmentation operation is a process of separating different characters in a text line image by image analysis.

[0068] For example, the character segmentation operation can be implemented based on an average segmentation algorithm, which calculates the interval points between two adjacent characters according to the number of characters in the target binary image, and then performs segmentation vertically at the interval points to obtain a plurality of single character images.

[0069] The average segmentation algorithm has good accuracy in the case of simple binary image, same character font size, and average distribution, and the algorithm is simple and easy to operate.

[0070] The character segmentation operation on the target binary image can result in a target character segmentation image or fail to obtain the target character segmentation image.

[0071] The target character segmentation image is a clear image of a bill number including a plurality of single characters.

[0072] The character segmentation operation includes the steps of obtaining the region coordinates of a single character, obtaining a single character segmentation image according to the region coordinates of the single character, and obtaining a target character segmentation image according to a plurality of single character segmentation images.

[0073] In actual execution, the failure to obtain the corresponding target character segmentation image can include at least one of the following cases.

[0074] First, the region coordinates of the single character segmentation image cannot be obtained.

[0075] Due to the blurred outline of the obtained target binary image, the region coordinates of the single character cannot be obtained when the character segmentation operation is performed.

[0076] Second, the single character segmentation image is blurred.

[0077] Due to the blurred single character segmentation image obtained according to the region coordinates of the single character when the character segmentation operation is performed, the target character segmentation image cannot be obtained according to the plurality of single character segmentation images.

[0078] Third, the plurality of single character segmentation images overlap.

[0079] Due to the overlapping of the plurality of single character segmentation images when the plurality of single character segmentation images are combined when the character segmentation operation is performed, the target character segmentation image obtained has ghosting, and the next character recognition cannot be performed.

[0080] In actual execution, the reasons for the failure to obtain the corresponding target character segmentation image when the character segmentation operation is performed can include at least one of the following cases.

[0081] First, the binary processing method does not match.

[0082] Since the binarization processing manner used does not match the style of the target bill image of the bill to be recognized, the outline of the obtained target binarization image is blurred, and when the character segmentation operation is performed on the target binarization image, the region coordinates of the single character segmentation image cannot be obtained.

[0083] Secondly, the binarization operation parameters are not properly selected.

[0084] Since the selected gray threshold is too large or too small when the binarization processing manner is used to binarize the target bill image of the bill to be recognized, the information of the target binarization image is greatly different from the information actually represented by the target bill image, and when the character segmentation operation is performed on the target binarization image, the single character segmentation image is blurred, and the target character segmentation image cannot be obtained.

[0085] Step 140, in the case that the corresponding target character segmentation image is not obtained by performing the character segmentation operation, the binarization operation and the character segmentation operation are re-performed until the target character segmentation image is obtained.

[0086] The binarization processing manner used in the last binarization operation is different from the binarization processing manner used in the previous binarization operation.

[0087] In this embodiment, when the corresponding target character segmentation image cannot be obtained by performing the character segmentation operation, the binarization operation and the character segmentation operation are re-performed, and when the binarization operation is performed again, the selected binarization processing manner is different from the binarization processing manner used in the previous binarization operation.

[0088] By using two different binarization processing manners, the problem that the binarization processing manner does not match the style of the target bill or the binarization operation parameters are not properly selected can be well solved, so that a clear target character segmentation image is obtained, and the recognition accuracy of the bill number is improved.

[0089] For example, the binarization processing manner used in the previous binarization operation can be implemented based on a color channel difference binarization algorithm, and the binarization processing manner used in the last binarization operation can be implemented based on an adaptive binarization algorithm.

[0090] In this embodiment, in the case that the pixel value difference of each color channel of the target bill image is small, the target binarization image obtained by using the binarization processing manner implemented based on the color channel difference binarization algorithm is blurred in outline and has poor effect, and a target binarization image with clear outline and good effect can be obtained by using other binarization manners.

[0091] In actual implementation, the step of re-executing the binarization operation and the character segmentation operation can be executed multiple times. Each time the binarization operation is executed, a different binarization processing mode can be used to adapt to different formats of the to-be-identified bill and different styles of the bill of the same format caused by the style and printing quality of a printing manufacturer, so that the target character segmentation image is successfully obtained.

[0092] For example, the case of executing the loop twice can be that the target binarization image is obtained by using the color channel difference binarization processing mode the first time, and the target character segmentation image cannot be obtained when the character segmentation is performed on the target binarization image. Then, the target binarization image is obtained by using the adaptive binarization processing mode again, and the target character segmentation image can be obtained when the character segmentation is performed on the target binarization image.

[0093] For another example, the case of executing the loop three times can be that the target binarization image is obtained by using the color channel difference binarization processing mode the first time, and the target character segmentation image cannot be obtained when the character segmentation is performed on the target binarization image. Then, the target binarization image is obtained by using the adaptive binarization processing mode again, and the target character segmentation image still cannot be obtained. Then, the target binarization image is obtained by using the high-threshold binarization processing mode again, and the target character segmentation image can be obtained when the character segmentation is performed on the target binarization image.

[0094] For the case that the pixel value difference of each color channel in the target bill image is small, the color channel difference binarization processing mode does not match the color style of the target bill image, and it is difficult to obtain a suitable binarization threshold for performing binarization processing on the target bill image by using the high-threshold binarization processing mode or the low-threshold binarization processing mode. The target binarization image obtained by using the adaptive binarization processing mode contains noise. At this time, the gradient binarization processing mode can be used to obtain the target binarization image with clear contours and good effects.

[0095] In the loop, the binarization processing mode can be the color channel difference binarization, the adaptive binarization, the high-threshold binarization, the low-threshold binarization, or the gradient binarization.

[0096] In step 150, character recognition is performed on the target character segmentation image to obtain the number recognition information corresponding to the target bill image.

[0097] The character recognition (OCR) technology refers to a technology for recognizing printed and printed characters on paper and storing the recognition result in a computer in a text manner. The number recognition information is a bill number in the to-be-identified bill, which can be a sequence of Arabic numerals and English.

[0098] In this step, the character recognition on the target character segmented image can be implemented through a neural network model or a support vector machine model.

[0099] In actual implementation, the target character image obtained through the character segmentation operation can be input into the trained model to obtain the number recognition information output by the model.

[0100] In related technologies, the character recognition technology of the financial self-service equipment usually uses fixed type grayscale operation and coordinate detection operation to recognize the bill number. However, because the bill has multiple formats, and the bill number features in the bill of the same format also present great differences because of different printing manufacturers, the use of fixed type grayscale operation and coordinate detection operation to execute the recognition process has a low bill number recognition accuracy when encountering bills of different formats or bills of different printing manufacturers.

[0101] In the embodiments of the present application, the binaryzation operation and the character segmentation operation are performed on the target bill image to obtain a target character segmented image for character recognition. When a clear target character segmented image cannot be obtained, a different binaryzation processing mode from the previous one is used again, and the binaryzation operation and the character segmentation operation are repeatedly executed to find and use a suitable binaryzation processing mode and character segmentation operation, so as to overcome the problem caused by improper binaryzation processing mode or binaryzation parameter selection, obtain a clear target character segmented image, adapt to different bill formats and different bill styles of different printing manufacturers, and improve the recognition accuracy of the bill number.

[0102] According to the bill number recognition method provided in the embodiments of the present application, when a clear target character segmented image cannot be obtained, a different binaryzation processing mode from the previous one is used again, and the binaryzation operation and the character segmentation operation are repeatedly executed to find and use a suitable binaryzation processing mode and character segmentation operation, so as to adapt to different bill formats and different bill styles of different printing manufacturers, and improve the recognition accuracy of the bill number.

[0103] In some embodiments, step 130, performing a character segmentation operation on the target binaryzation image, includes:

[0104] performing a first character segmentation processing on the target binaryzation image;

[0105] in a case where it is determined that the first character segmentation processing does not obtain a target character segmented image, performing a second character segmentation processing on the target bill image;

[0106] obtaining a target character segmented image, includes:

[0107] obtaining a target character segmented image corresponding to the second character segmentation processing.

[0108] The character segmentation processing method used in the first character segmentation processing and the second character segmentation processing is different.

[0109] In this embodiment, the character segmentation operation is performed on the target binary image, the first character segmentation processing is performed on the target binary image, and when the target character image is not obtained through the first character segmentation processing, the second character segmentation processing different from the first character segmentation processing is performed on the target binary image.

[0110] After the binary operation, two different character segmentation processes are performed in series based on two different character segmentation algorithms, so as to enhance the ability of the bill recognition method to adapt to different scenes, and to help improve the accuracy and speed of bill number recognition.

[0111] In actual execution, when the two character segmentation processes in the character segmentation operation cannot obtain a clear target character segmentation image, the binary operation and the character segmentation operation are recycled, and the binary operation performed again uses a different binary processing method from the binary operation performed last time, so as to obtain a clear target character segmentation image and realize bill number recognition.

[0112] In some embodiments, the step 130 of performing a character segmentation operation on the target binary image comprises:

[0113] performing the first character segmentation processing on the target binary image;

[0114] obtaining the target character segmentation image comprises:

[0115] obtaining the target character segmentation image corresponding to the first character segmentation processing.

[0116] In this embodiment, the first character segmentation processing is performed on the target binary image, and the character image corresponding to the first character segmentation processing is obtained. When the character image corresponding to the first character segmentation processing is clear and can be recognized, the character image obtained by the first character segmentation processing is taken as the target character segmentation image, and the character segmentation operation does not need to be performed again, and the next character recognition is directly performed.

[0117] In some embodiments, the character segmentation operation comprises at least one of the first character segmentation processing and the second character segmentation processing, the first character segmentation processing is a connected domain method character segmentation, and the second character segmentation processing is a projection method character segmentation.

[0118] In this embodiment, when the target character segmentation image can be obtained by performing the first character segmentation processing, the character segmentation operation only includes the first character segmentation processing, and when the target character segmentation image cannot be obtained by performing the first character segmentation processing and can be obtained by performing the second character segmentation processing, the character segmentation operation includes the first character segmentation processing and the second character segmentation processing.

[0119] In this embodiment, the first character segmentation processing is a connected domain method character segmentation. The connected domain method character segmentation is to perform connected domain searching, screening, and obtaining of a region coordinate of a single character on a target binarization image according to prior knowledge such as a width and height size of the bill, and obtain the target character segmentation image according to the region coordinate of the single character.

[0120] In actual execution, the connected domain method character segmentation includes the following steps.

[0121] All connected domains of the target binarization image are searched and marked. The connected domain refers to an image region composed of foreground pixel points with the same pixel value and adjacent positions in the image.

[0122] The connected domains in the target binarization image are screened and removed according to the shape and adjacent relationship of the connected domains, the connected domains similar in shape and adjacent are connected, the connected domain in which the single character is located is obtained, and then the target character segmentation image is obtained according to the frame line and coordinate of the connected domain.

[0123] In this embodiment, the second character segmentation processing is a projection method character segmentation.

[0124] In actual execution, the projection method character segmentation includes the following steps.

[0125] When it is determined that the layout of the characters in the target binarization image is of a left-to-right type, the target binarization image is vertically projected according to the number of pixels in the target binarization image to obtain a distribution histogram of the pixels, and the target character segmentation image is obtained according to the coordinate of the histogram.

[0126] When it is determined that the layout of the characters in the target binarization image is of an up-to-down type, the target binarization image is horizontally projected according to the number of pixels in the target binarization image to obtain a distribution histogram of the pixels, and the target character segmentation image is obtained according to the coordinate of the histogram.

[0127] When it is determined that the layout of the characters in the target binarization image is of a vertical and horizontal interlaced type, a vertical projection and then a horizontal projection can be used to obtain a distribution histogram of the pixels, and the target character segmentation image is obtained according to the coordinate of the histogram.

[0128] In some embodiments, the binarization processing mode of the binarization operation includes at least one of color channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization, and gradient binarization.

[0129] In this embodiment, according to the characteristics that the bill number is mainly black or red, or the bill number is dark or light, the target bill image can be subjected to color channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization, and gradient binarization.

[0130] In the color channel difference binarization, the pixel values at the same position in different color channels of the target bill image are subtracted, and binarization processing is performed according to a set threshold to obtain a color channel difference binarization result.

[0131] The color channel difference binarization can make full use of the color information of the target bill image, and can achieve good binarization effect when the pixel values in different color channels of the target bill image are greatly different.

[0132] The adaptive binarization includes a global adaptive binarization processing mode and a local adaptive binarization processing method.

[0133] In the global adaptive binarization processing mode, a binarization threshold is calculated according to the pixels of the target bill image, the pixel gray value is set to 255 if the pixel is greater than the binarization threshold, and the pixel gray value is set to 0 if the pixel is less than the binarization threshold, so that a target binarization image is obtained through global adaptive binarization.

[0134] The global adaptive binarization processing method is simple in processing process and short in processing time, and can quickly obtain a target binarization image.

[0135] The local adaptive binarization processing method calculates a plurality of local binarization thresholds according to the pixel values of a pixel block and the pixel blocks adjacent to the pixel block, and binarizes the corresponding pixel block according to each local binarization threshold, sets the pixel gray value to 255 if the pixel is greater than the binarization threshold, and sets the pixel gray value to 0 if the pixel is less than the binarization threshold, so that a target binarization image is obtained through local adaptive binarization.

[0136] The local adaptive binarization processing method has strong anti-interference performance, and can maintain good binarization effect in the case of uneven light.

[0137] The high threshold binarization sets a larger binarization threshold according to the pixel histogram of the target bill image, and obtains a target binarization image according to the above binarization processing mode.

[0138] The low threshold binarization is to set a small binarization threshold according to a pixel histogram of the target bill image, and obtain a target binarization image according to the above binarization processing mode.

[0139] The two binarization processing modes can skip the adaptive calculation of the binarization threshold when processing bills of the same format and produced by the same printing manufacturer, accelerate the bill number recognition process, and obtain a good binarization effect at the same time.

[0140] The gradient binarization is to determine a binarization threshold according to the gradient feature of the target bill image, and perform binarization processing on the target bill image to obtain a target binarization image.

[0141] The gradient binarization can obtain a suitable binarization threshold and obtain a target binarization image without noise when the pixel value difference of each color channel in the target bill image is small.

[0142] In the embodiment of the application, the target bill image is subjected to binarization operation and character segmentation operation, the binarization operation includes one-time binarization operation, and the character segmentation operation includes one-time or two-time character segmentation operation, wherein the two-time character segmentation operations are different, and when clear target character segmentation images are not obtained through the two-time character segmentation operations, the binarization operation and the character segmentation operation are cyclically executed again, the binarization processing mode adopted in the next-time binarization operation is different from the binarization processing mode adopted in the previous-time binarization operation, to obtain a new target binarization image, and then the target character segmentation image is obtained according to the new target binarization image, and then character recognition is performed on the target character segmentation image, so that different kinds of binarization operation and character segmentation operation can adapt to different bill formats and different bill styles of different printing manufacturers, and the recognition accuracy of the bill number is improved.

[0143] In some embodiments, the target character segmentation image is subjected to character recognition to obtain the number recognition information corresponding to the bill to be recognized, including:

[0144] The target character segmentation image is subjected to single character feature extraction to obtain feature information corresponding to a single character in the target character segmentation image.

[0145] The feature information is subjected to classification recognition to obtain the number recognition information.

[0146] The feature extraction is a method of transforming a group of measurement values of a certain mode to highlight the representative features of the mode, and can be extracted by image analysis and transformation.

[0147] In this embodiment, the target character segmented image includes a plurality of single characters, and the single character feature extraction is performed on the target character segmented image to obtain the feature information of the plurality of single characters. Further, the HOG feature information can be constructed by calculating and counting the gradient direction histogram of the local region of the target character segmented image.

[0148] In actual implementation, the target character segmented image can be divided into small connected regions, which are called cell units. Then, the gradient or edge direction histogram of each pixel in the cell unit is collected. Finally, the histograms are combined to construct the HOG feature information.

[0149] Since the HOG feature information is operated on the local grid unit of the target character segmented image, it can maintain good invariance to the geometric shape and optical deformation of the target character segmented image. In subsequent classification and recognition, the original serial number of the bill number can be well maintained to obtain the number recognition information.

[0150] In this embodiment, the target character segmented image can also be divided into a plurality of sub-blocks, and each sub-block is processed to obtain the LBP feature information of the target character segmented image.

[0151] In actual implementation, for each pixel in each sub-block, the gray values of the eight adjacent pixels are compared with the center pixel. If the values of the surrounding pixels are greater than the value of the center pixel, the pixel is marked as 1, otherwise, it is marked as 0. In this way, 8-bit binary numbers can be generated as the LBP feature information of the pixel by comparing the 8 pixels in the 3*3 region. The frequency of each LBP feature information in each sub-block is calculated to obtain the distribution histogram of the LBP feature information. The distribution histogram is normalized and each sub-block is connected to form a feature vector to obtain the LBP feature information of the target character segmented image.

[0152] The LBP feature information can effectively measure and extract the texture information in the target character image, and has the advantages of rotation invariance and gray invariance.

[0153] The classification and recognition of the feature information can be inputting the feature information into a classifier to obtain the number recognition information output by the classifier.

[0154] In actual implementation, the model can be used to classify and recognize the feature information to obtain the number recognition result output by the model. Finally, the result with the largest confidence is taken as the number recognition information.

[0155] For example, the feature information can be classified using a support vector machine model, or the feature information can be classified using a neural network model to obtain the number recognition information.

[0156] A specific embodiment is introduced below to describe a specific application scenario of the bill number recognition method provided in the embodiments.

[0157] As shown in Figure 2 The financial self-service device can include a signal acquisition module 210, an image preprocessing module 220, and an OCR recognition module 230.

[0158] The signal acquisition module 210 can be an image sensor, and the signal acquisition module 210 can be arranged at a bill inlet of the financial self-service device. The signal acquisition module 210 is configured to acquire an image signal of a bill to be recognized at the bill inlet.

[0159] The signal acquisition module 210 can generate a target bill image according to the acquired image signal, and transmit the target bill image to the image preprocessing module 220. The image preprocessing module 220 pre-processes the target bill image and transmits the target bill image to the OCR recognition module 230, so that the OCR recognition module 230 performs a binarization operation and a character segmentation operation on the image.

[0160] As shown in Figure 3 The OCR recognition module 230 performs a binarization operation and a character segmentation operation on the target bill image to obtain a target character segmentation image, and performs bill number recognition on the target character segmentation image to obtain number recognition information.

[0161] The first character segmentation processing is taken as an example of the connected domain method character segmentation, and the second character segmentation processing is taken as an example of the projection method character segmentation.

[0162] The OCR recognition module 230 performs a binarization operation on the target bill image to obtain a target binarization image, performs a connected domain method character segmentation operation on the target binarization image, and performs character recognition on the target character segmentation image to obtain number recognition information in a case where the connected domain method character segmentation successfully obtains a target character segmentation image.

[0163] In a case where the connected domain method character segmentation does not obtain a target character segmentation image, the OCR recognition module 230 performs a projection method character segmentation operation on the target binarization image, and performs character recognition on the target character segmentation image to obtain number recognition information in a case where the projection method character segmentation successfully obtains a target character segmentation image.

[0164] In the case that the target character segmentation image is not obtained by the projection method character segmentation, the target bill image is binarized again using a different binarization processing mode from the last time to obtain a new target binarization image, and the connected domain method character segmentation and the projection method character segmentation are performed again on the new target binarization image until the target character segmentation image is obtained, and finally the number recognition information is obtained, and the financial self-service equipment can perform further operations according to the number recognition information.

[0165] In the case that the clear single character target character segmentation image cannot be obtained, a new target binarization image is obtained by using a different binarization processing mode from the last time, and a character segmentation operation is performed again on the new target binarization image to obtain the clear single character target character segmentation image, which can adapt to different bill formats and different bill styles of different printing manufacturers, and improve the recognition accuracy of the bill number.

[0166] The bill recognition method provided in the embodiments of the present application has been applied to the bill number recognition of nearly one hundred kinds of bills of dozens of banks, and has achieved very high accuracy, effectively improving the work efficiency.

[0167] The bill number recognition method provided in the embodiments of the present application can be executed by an electronic device or a function module or function entity capable of implementing the bill number recognition method in the electronic device. The electronic device mentioned in the embodiments of the present application includes but is not limited to a mobile phone, a tablet computer, a computer, a camera, a wearable device, and the like. The bill number recognition method provided in the embodiments of the present application will be described below by taking an electronic device as an example.

[0168] The bill number recognition method provided in the embodiments of the present application can be executed by an electronic device or a function module or function entity capable of implementing the bill number recognition method in the electronic device. The electronic device mentioned in the embodiments of the present application includes but is not limited to a mobile phone, a tablet computer, a computer, a camera, a wearable device, and the like. The bill number recognition method provided in the embodiments of the present application will be described below by taking an electronic device as an example.

[0169] The bill number recognition method provided in the embodiments of the present application can be executed by an electronic device or a function module or function entity capable of implementing the bill number recognition method in the electronic device. The electronic device mentioned in the embodiments of the present application includes but is not limited to a mobile phone, a tablet computer, a computer, a camera, a wearable device, and the like. The bill number recognition method provided in the embodiments of the present application will be described below by taking an electronic device as an example.

[0170] As shown in Figure 4 The bill number recognition device includes:

[0171] The acquisition module 410 is configured to acquire a target bill image of a bill to be recognized.

[0172] The first processing module 420 is configured to perform a binarization operation on the target bill image to obtain a target binarization image.

[0173] The second processing module 430 is configured to perform a character segmentation operation on the target binarization image.

[0174] The third processing module 440 is configured to re-execute the binarization operation and the character segmentation operation until the target character segmentation image is obtained, in a case that the character segmentation operation does not obtain the target character segmentation image.

[0175] The fourth processing module 450 is configured to perform character recognition on the target character segmentation image to obtain the number recognition information corresponding to the to-be-recognized bill.

[0176] The binarization processing mode of the second time of executing the binarization operation is different from the binarization processing mode of the first time of executing the binarization operation.

[0177] According to the bill number recognition device provided in the embodiments of the present application, when a clear target character segmentation image cannot be obtained, a binarization processing mode different from the previous one is used to execute the binarization operation and the character segmentation operation repeatedly, so that a suitable binarization processing mode and character segmentation operation can be found and used, so as to adapt to different bill formats and different bill styles of different printing manufacturers, and the recognition accuracy of the bill number is improved.

[0178] In some embodiments, the second processing module 430 is configured to perform first character segmentation processing on the target binarization image; and perform second character segmentation processing on the target bill image in a case that the first character segmentation processing does not obtain the target character segmentation image.

[0179] The third processing module 440 is configured to obtain the target character segmentation image corresponding to the second character segmentation processing.

[0180] In some embodiments, the second processing module 430 is configured to perform first character segmentation processing on the target binarization image.

[0181] The third processing module 440 is configured to obtain the target character segmentation image corresponding to the first character segmentation processing.

[0182] In some embodiments, the character segmentation operation includes at least one of first character segmentation processing and second character segmentation processing, the first character segmentation processing is connected domain method character segmentation, and the second character segmentation processing is projection method character segmentation.

[0183] In some embodiments, the binarization processing mode of the binarization operation includes at least one of color channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization and gradient binarization.

[0184] In some embodiments, the fourth processing module 450 is configured to perform single character feature extraction on the target character segmentation image to obtain feature information corresponding to a single character in the target character segmentation image.

[0185] The feature information is classified and recognized to obtain the number recognition information.

[0186] The bill number recognition apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like. The embodiments of the present application are not limited in this regard.

[0187] The bill number recognition apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system, or other possible operating system, and the embodiments of the present application are not limited in this regard.

[0188] The bill number recognition apparatus provided in the embodiments of the present application can implement Figures 1 to 3 The method embodiments are implemented by the bill number recognition apparatus, and the details are not described herein again to avoid repetition.

[0189] In some embodiments, as shown in Figure 5 The embodiments of the present application also provide an electronic device 500, which includes a processor 501, a memory 502, and a computer program stored in the memory 502 and capable of running on the processor 501. When the processor 501 executes the computer program, each of the above-mentioned bill number recognition method embodiments is implemented, and the same technical effects are achieved. To avoid repetition, the details are not described herein again.

[0190] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.

[0191] The embodiments of the present application also provide a non-transitory computer readable storage medium, which stores a computer program. When the processor executes the computer program, each of the above-mentioned bill number recognition method embodiments is implemented, and the same technical effects are achieved. To avoid repetition, the details are not described herein again.

[0192] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0193] The application also provides a computer program product, including a computer program, which is executed by a processor to implement the above bill number recognition method.

[0194] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0195] It should be noted that, in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusions, so that a method, article or device including a list of elements does not only include those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the present application is not limited to the order of performing the functions shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in reverse order, for example, the described method can be performed in an order different from that described, and various steps can also be added, omitted or combined. In addition, the features described with reference to certain examples can be combined in other examples.

[0196] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server or network equipment, etc.) execute the method described in each embodiment of the present application.

[0197] The embodiments of the present application are described above with reference to the drawings, but the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative, not restrictive, and a person of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims, all of which belong to the protection of the present application.

[0198] In the description of the present specification, the description referring to the terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the exemplary description of the above terms does not necessarily mean the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0199] Although the embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made thereto without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for identifying ticket numbers, characterized in that, include: Obtain the target document image of the document to be identified; Perform a binarization operation on the target ticket image to obtain a target binarized image; A character segmentation operation is performed on the target binarized image; the character segmentation operation includes at least one of a first character segmentation process and a second character segmentation process, wherein the first character segmentation process is a connected component method character segmentation, and the second character segmentation process is a projection method character segmentation. The step of performing character segmentation on the target binarized image includes: Perform a first character segmentation process on the target binarized image; if the first character segmentation process does not produce a target character segmented image, perform a second character segmentation process on the target ticket image; Obtaining the target character segmentation image includes: obtaining the target character segmentation image corresponding to the first character segmentation process, or obtaining the target character segmentation image corresponding to the second character segmentation process; If the character segmentation operation does not yield the corresponding target character segmentation image, the binarization operation and the character segmentation operation are re-executed until the target character segmentation image is obtained. Perform character recognition on the target character segmentation image to obtain the number recognition information corresponding to the ticket to be recognized; The binarization process performed in the latter instance differs from the binarization process performed in the former instance.

2. The ticket number identification method according to claim 1, characterized in that, The binarization operation includes at least one of the following binarization methods: color channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization, and gradient binarization.

3. The ticket number identification method according to claim 1, characterized in that, The step of performing character recognition on the target character segmentation image to obtain the number recognition information corresponding to the ticket to be recognized includes: Single-character feature extraction is performed on the target character segmentation image to obtain the feature information corresponding to each single character in the target character segmentation image; The feature information is classified and identified to obtain the number identification information.

4. A ticket number recognition device, characterized in that, include: The acquisition module is used to acquire the target document image of the document to be identified; The first processing module is used to perform a binarization operation on the target ticket image to obtain a target binarized image; The second processing module is used to perform character segmentation operation on the target binarized image. The character segmentation operation includes at least one of a first character segmentation process and a second character segmentation process. The first character segmentation process is connected component character segmentation, and the second character segmentation process is projection character segmentation. The step of performing character segmentation on the target binarized image includes: performing a first character segmentation process on the target binarized image; and performing a second character segmentation process on the target ticket image if the first character segmentation process fails to produce a target character segmented image. The third processing module is used to obtain the target character segmentation image corresponding to the first character segmentation process, or to obtain the target character segmentation image corresponding to the second character segmentation process; if the character segmentation operation does not obtain the corresponding target character segmentation image, the binarization operation and the character segmentation operation are re-executed until the target character segmentation image is obtained. The fourth processing module is used to perform character recognition on the target character segmentation image to obtain the number recognition information corresponding to the ticket to be recognized; The binarization process performed in the latter instance differs from the binarization process performed in the former instance.

5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the ticket number recognition method as described in any one of claims 1-3.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the ticket number identification method as described in any one of claims 1-3.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the ticket number recognition method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Projection method and connected domain method-based double-row structure license plate character segmentation method

    CN103400133A

  • Note denomination identification method and device, equipment and storage medium

    CN107507334A

  • Image generation method and device, computer equipment and storage medium

    CN113989814A

  • Character recognition processing device, character recognition processing method, and computer program

    JP2007086954A