CN116580410A - Bill number identification method and device, electronic equipment and storage medium - Google Patents
Bill number identification method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116580410A CN116580410A CN202310390174.2A CN202310390174A CN116580410A CN 116580410 A CN116580410 A CN 116580410A CN 202310390174 A CN202310390174 A CN 202310390174A CN 116580410 A CN116580410 A CN 116580410A
- Authority
- CN
- China
- Prior art keywords
- image
- target
- character segmentation
- binarization
- bill
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 118
- 230000011218 segmentation Effects 0.000 claims abstract description 246
- 238000012545 processing Methods 0.000 claims abstract description 95
- 230000008569 process Effects 0.000 claims description 54
- 238000004590 computer program Methods 0.000 claims description 14
- 230000003044 adaptive effect Effects 0.000 claims description 10
- 238000007639 printing Methods 0.000 description 14
- 230000000694 effects Effects 0.000 description 9
- 238000003672 processing method Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000001514 detection method Methods 0.000 description 6
- 238000007781 pre-processing Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 238000000605 extraction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 229910044991 metal oxide Inorganic materials 0.000 description 2
- 150000004706 metal oxides Chemical class 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000003703 image analysis method Methods 0.000 description 1
- 238000003702 image correction Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/30—Character recognition based on the type of data
- G06V30/302—Images containing characters for discriminating human versus automated computer access
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/148—Segmentation of character regions
- G06V30/153—Segmentation of character regions using recognition of characters or words
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/19—Recognition using electronic means
- G06V30/191—Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
- G06V30/19173—Classification techniques
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Character Input (AREA)
Abstract
The application discloses a bill number identification method, a bill number identification device, electronic equipment and a storage medium, and belongs to the technical field of image processing. The method comprises the following steps: acquiring a target bill image of a bill to be identified; performing binarization operation on the target bill image to obtain a target binarization image; performing a character segmentation operation on the target binarized image; re-executing the binarization operation and the character segmentation operation until the target character segmentation image is obtained under the condition that the corresponding target character segmentation image is not obtained by executing the character segmentation operation; performing character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized; wherein, the binarization processing mode of executing the binarization operation at the last time is different from the binarization processing mode of executing the binarization operation at the previous time. The method can improve the identification accuracy of the bill numbers.
Description
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a bill number identification method, a bill number identification device, electronic equipment and a storage medium.
Background
With the high-speed development of economic trade in China, financial services are widely popularized and applied in large, medium and small cities and regions, and when the financial services related to bills such as checks, deposit slips and service orders are transacted, the serial number in the bills is also called as a bill number, and the bill number is simply called as a bill number, is used as the basis of the record and index of the bills, and is one of important means for searching and positioning corresponding bills and transactions in subsequent management and transactions.
Automatic identification of ticket numbers is a basic technology of financial self-service equipment, but due to the fact that tickets exist in multiple formats, tickets in the same format can show large differences in ticket number characteristics due to different printing factories.
At present, automatic ticket number identification is mostly carried out by using detection technologies such as graying and coordinate detection, and when automatic ticket number identification is carried out by using technologies such as graying operation and coordinate detection, fixed type graying operation and coordinate detection operation are usually adopted, ticket number identification flow is carried out, and ticket number identification accuracy is low when tickets of different formats or ticket styles of different printing manufacturers are met.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides a bill number identification method, a bill number identification device, electronic equipment and a storage medium, and the identification accuracy of bill numbers is improved.
In a first aspect, the present application provides a method for identifying a ticket number, the method comprising:
acquiring a target bill image of a bill to be identified;
performing binarization operation on the target bill image to obtain a target binarization image;
performing a character segmentation operation on the target binarized image;
re-executing the binarization operation and the character segmentation operation until the target character segmentation image is obtained under the condition that the corresponding target character segmentation image is not obtained by executing the character segmentation operation;
performing character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized;
wherein, the binarization processing mode of executing the binarization operation at the last time is different from the binarization processing mode of executing the binarization operation at the previous time.
According to the bill number identification method, when a clear target character segmentation image cannot be acquired, the binarization processing mode which is different from the last binarization processing mode is adopted again, the binarization operation and the character segmentation operation are executed circularly, and the proper binarization processing mode and character segmentation operation are found and used, so that the bill number identification method is suitable for different bill formats and bill styles of different printing manufacturers, and the identification accuracy of the bill numbers is improved.
According to one embodiment of the present application, the performing a character segmentation operation on the target binarized image includes:
performing a first character segmentation process on the target binarized image;
performing a second character segmentation process on the target ticket image in a case where it is determined that the target character segmentation image is not obtained by the first character segmentation process;
the obtaining the target character segmentation image includes:
and obtaining the target character segmentation image corresponding to the second character segmentation processing.
According to one embodiment of the present application, the performing a character segmentation operation on the target binarized image includes:
performing a first character segmentation process on the target binarized image;
the obtaining the target character segmentation image includes:
and obtaining the target character segmentation image corresponding to the first character segmentation processing.
According to one embodiment of the present application, the character segmentation operation includes at least one of a first character segmentation process, which is connected-domain normal character segmentation, and a second character segmentation process, which is projective character segmentation.
According to an embodiment of the present application, the binarization processing manner of the binarization operation includes at least one of color channel difference value binarization, adaptive binarization, high-threshold binarization, low-threshold binarization, and gradient binarization.
According to an embodiment of the present application, the performing character recognition on the target character segmentation image to obtain number recognition information corresponding to the ticket to be recognized includes:
extracting single character features of the target character segmentation image to obtain feature information corresponding to single characters in the target character segmentation image;
and carrying out classification and identification on the characteristic information to obtain the number identification information.
In a second aspect, the present application provides a bill number recognition apparatus, comprising:
the acquisition module is used for acquiring a target bill image of the bill to be identified;
the first processing module is used for executing binarization operation on the target bill image to obtain a target binarization image;
the second processing module is used for executing character segmentation operation on the target binarized image;
a third processing module, configured to re-execute the binarization operation and the character segmentation operation until the target character segmentation image is obtained, where the corresponding target character segmentation image is not obtained by executing the character segmentation operation;
the fourth processing module is used for carrying out character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized;
Wherein, the binarization processing mode of executing the binarization operation at the last time is different from the binarization processing mode of executing the binarization operation at the previous time.
According to the bill number recognition device, when a clear target character segmentation image cannot be acquired, the binarization processing mode which is different from the last binarization processing mode is adopted again, the binarization operation and the character segmentation operation are circularly executed, and the proper binarization processing mode and character segmentation operation are found and used, so that the bill number recognition device is suitable for different bill formats and bill styles of different printing manufacturers, and the recognition accuracy of bill numbers is improved.
In a third aspect, the present application provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the ticket number identification method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a ticket number recognition method as described in the first aspect above.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements a ticket number recognition method as described in the first aspect above.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIG. 1 is a schematic flow chart of a bill number recognition method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a financial self-service device according to an embodiment of the present application;
FIG. 3 is a second flow chart of a bill number recognition method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a bill number recognition device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Reference numerals:
a signal acquisition module 210, an image preprocessing module 220, and an OCR recognition module 230.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The bill number recognition method, the bill number recognition device, the electronic equipment and the readable storage medium provided by the embodiment of the application are described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
The bill number identification method can be applied to the terminal, and can be specifically executed by hardware or software in the terminal.
The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet having a touch sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad).
In the following various embodiments, a terminal including a display and a touch sensitive surface is described. 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.
As shown in fig. 1, the bill number recognition method includes steps 110 to 150.
And 110, acquiring a target bill image of the bill to be identified.
The bill to be identified can be a bill placed at a bill inlet of the self-service financial equipment, an image sensor can be arranged at the bill inlet of the self-service financial equipment to acquire a target bill image of the bill to be identified, corresponding number identification information is acquired, and the self-service financial equipment is convenient to execute further operation on the bill to be identified.
The target ticket image may be obtained by a Complementary Metal Oxide Semiconductor (CMOS) image sensor and subjected to an image capture operation.
In actual implementation, a complementary metal oxide semiconductor image sensor can be arranged at the ticket inlet of the self-service financial equipment, and can be contacted with the ticket to be identified when the ticket to be identified is placed into the ticket inlet, and the image sensor acquires the original ticket image of the ticket to be identified.
It can be understood that the original bill image is an image except the number area including the bill to be identified, and as most of the bills are printed according to the fixed rule, the positions of the bill numbers in the target bill image are relatively fixed, and the original bill image can be cut according to the positions of the bill numbers, so that an image corresponding to the number area of the bill to be identified, namely the target bill image, is obtained.
And 120, performing binarization operation on the target bill image to obtain a target binarized image.
The binarization operation is performed on the target ticket image by setting the gray value of the pixel in the target ticket image to 0 or 255, and an image with the gray value of 0 or 255 exhibits the visual effect of only black and white.
In actual implementation, the gray value of the character image in the target bill image may be set to 255, and the gray value of the background image may be set to 0, so as to obtain the target binarized image of the black matrix white word corresponding to the target bill image.
In this embodiment, the gray levels in the obtained target binarized image are only two, and there is no filter value in the middle, and the target binarized image can show the outline of the number in the target ticket image through the density degree of the pixel points.
In actual implementation, binarization processing modes such as color channel difference value binarization, adaptive binarization, high-threshold binarization, low-threshold binarization or gradient binarization can be used for executing binarization operation on the target bill image.
Before the target bill image is subjected to binarization processing, the target bill image can be subjected to preprocessing so as to improve the effect of the binarization processing, and the preprocessing can be the operations of image edge detection, image correction and the like on the target bill image so as to better identify the target bill image and obtain the number identification information with higher accuracy.
And 130, performing character segmentation operation on the target binarized image.
The character segmentation operation is a process of segmenting different characters in the text line image by an image analysis method.
For example, the character segmentation operation may be implemented based on an average segmentation algorithm, in which, according to the number of characters in the target binarized image, the distance points between two adjacent characters are calculated on average, and the distance points are used for vertical segmentation, so as to obtain a plurality of single-character images.
The average segmentation algorithm is simple in the face of a binarized image, characters are the same in font size, the situation of average distribution has good accuracy, and the algorithm is simple and convenient to operate.
And performing character segmentation operation on the target binarized image, wherein one segmentation operation result is that the target character segmentation image can be obtained, and the other segmentation operation result is that the target character segmentation image cannot be obtained.
Wherein the target character segmentation image is an image that is clear and includes a plurality of ticket numbers of a single character.
The character segmentation operation includes the steps of obtaining region coordinates of a single character, obtaining a segmented image of the single character from the region coordinates of the single character, and obtaining a target character segmented image from the segmented images of the plurality of single characters.
In actual execution, the failure to obtain the corresponding target character segmentation image may include at least one of the following.
First, the region coordinates of the single character divided image cannot be acquired.
Because of the blurring of the contours of the acquired target binarized image, the region coordinates of a single character cannot be acquired when the character segmentation operation is performed.
And secondly, blurring the segmented image of the single character.
Since the obtained segmented image of a single character is blurred according to the region coordinates of the single character when the character segmentation operation is performed, the target character segmented image cannot be obtained according to the segmented images of a plurality of single characters.
Third, a plurality of single character segmentation images overlap.
Since the divided images of the plurality of single characters overlap when the character division operation is performed and the combination is performed based on the divided images of the plurality of single characters, the obtained target character divided image is ghost and cannot be subjected to the next character recognition.
In actual execution, the reason why the corresponding target character segmentation image is not obtained by performing the character segmentation operation may include at least one of the following cases.
First, the binarization processing mode is not matched.
Because the binarization processing mode is not matched with the style of the target bill image of the bill to be identified, the contour of the acquired target binarization image is blurred, and when the character segmentation operation is carried out on the target binarization image, the region coordinates of the single character segmentation image cannot be acquired.
And secondly, the binarization operation parameter is selected improperly.
When the target bill image of the bill to be identified is binarized by using a binarization processing mode, the selected gray threshold is selected to be too large or too small, so that 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 carried out on the target binarization image, the segmented image of a single character is blurred, and the segmented image of the target character cannot be obtained.
And 140, re-executing the binarization operation and the character segmentation operation until the target character segmentation image is obtained under the condition that the corresponding target character segmentation image is not obtained by executing the character segmentation operation.
The binarization processing mode of the binarization operation executed at the last time is different from the binarization processing mode of the binarization operation executed at the previous time.
In this embodiment, when the character segmentation operation is performed without obtaining the corresponding target character segmentation image, the binarization operation is re-performed and the character segmentation operation is performed again, and when the binarization operation is performed again, the selected binarization processing mode is different from the binarization processing mode of the previous binarization operation.
By using different binarization processing modes twice, the problem that the binarization processing mode is not matched with 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 identification accuracy of the bill number is improved.
For example, the previous binarization may be performed based on a color channel difference binarization algorithm, and the next binarization may be performed based on an adaptive binarization algorithm.
In this embodiment, under the condition that the difference of pixel values of each color channel of the target bill image is small, the target binarized image obtained by using the binarization processing mode realized based on the color channel difference binarization algorithm has a blurred contour and a poor effect, and the target binarized image with a clear contour and a good effect can be obtained by using other binarization modes.
In actual execution, the step of re-executing the binarization operation and the character segmentation operation may be repeated, and each time the binarization operation is executed, the binarization processing manner used may be different, so as to adapt to the bills to be identified of different formats, and the bills of different styles of the same format caused by the style and the printing quality of the printing manufacturer, so that the target character segmentation image is successfully obtained.
For example, the loop may be performed twice, in which the target binary image is obtained by the color channel difference value binarization processing method for the first time, when the target binary image is character-segmented, the target character-segmented image cannot be obtained, and the adaptive binary processing method is reused for the loop, in which case the target binary image is character-segmented, so that the target character-segmented image can be obtained.
For another example, the case of performing the loop three times may be that the target binarized image is obtained by the color channel difference binarization processing method for the first time, when the target binarized image is subjected to character segmentation, the target character segmentation image cannot be obtained, and then the adaptive binarization processing method is recycled again to obtain the target binarized image, or the target character segmentation image cannot be obtained, and the high-threshold binarization processing method is recycled again to obtain the target binarized image, and at this time, the target character segmentation image is obtained by performing character segmentation on the target binarized image.
Aiming at the situation that the pixel value difference of each color channel in the target bill image is smaller, because the color channel difference value binarization processing mode is not matched with the color style of the target bill image, the target bill image is subjected to binarization processing by using a high-threshold binarization processing mode or a low-threshold binarization processing mode, and the target binarization image obtained by using adaptive binarization contains noise, at the moment, the target binarization image with clear outline and good effect can be obtained by using a gradient binarization processing mode.
The binarization processing mode used in the circulation process can be binarization processing modes such as color channel difference value binarization, self-adaptive binarization, high-threshold binarization, low-threshold binarization or gradient binarization.
And 150, performing character recognition on the target character segmentation image to obtain number recognition information corresponding to the target bill image.
The character recognition (Optical Character Recognise, OCR) technology is used to recognize printed characters on paper and print text characters, and the recognition result is stored in a computing machine in a text mode, and the number recognition information is a bill number in a bill to be recognized, and the expression form can be a series of arabic numerals and english sequences.
In this step, character recognition of the target character segmentation image may be performed by a neural network model or a support vector machine model.
In actual execution, the target character image obtained by the character segmentation operation may be input into the trained model, and the number identification information of the output of the model may be obtained.
In the related art, a character recognition technology of a financial self-service device generally uses a fixed type graying operation and a coordinate detection operation to recognize a bill number, but since a plurality of formats exist in the bill, and the bill number characteristics in the bill also show a larger difference due to different printing manufacturers, the bill number recognition accuracy is lower when the bill of different formats or different printing manufacturers styles are met by using the fixed type graying operation and the coordinate detection operation to execute a recognition process.
According to the embodiment of the application, through executing the binarization operation and the character segmentation operation on the target bill image, acquiring the target character segmentation image for character recognition, when the clear target character segmentation image cannot be acquired, the binarization processing mode which is different from the last time is adopted again, the binarization operation and the character segmentation operation are circularly executed, and the proper binarization processing mode and character segmentation operation are found and used, so that the problem caused by improper selection of the binarization processing mode or the binarization parameters is solved, the clear target character segmentation image is acquired, the method can adapt to different bill formats and bill styles of different printing manufacturers, and the identification accuracy of bill numbers is improved.
According to the bill number identification method provided by the embodiment of the application, when a clear target character segmentation image cannot be acquired, the binarization processing mode which is different from the last binarization processing mode is adopted again, the binarization operation and the character segmentation operation are circularly executed, and the proper binarization processing mode and character segmentation operation are found and used, so that the bill number identification method is suitable for different bill formats and bill styles of different printing manufacturers, and the identification accuracy of the bill number is improved.
In some embodiments, step 130, performing a character segmentation operation on the target binarized image, includes:
performing a first character segmentation process on the target binarized image;
performing a second character segmentation process on the target ticket image in a case where it is determined that the target character segmentation image is not obtained by the first character segmentation process;
obtaining a target character segmentation image, comprising:
and obtaining a target character segmentation image corresponding to the second character segmentation processing.
Wherein the character segmentation processing modes used by the first character segmentation processing and the second character segmentation processing are different.
In this embodiment, a character segmentation operation is performed on a target binarized image, first a first character segmentation process is performed on the target binarized image, and when the first character segmentation process does not result in a target character image, a second character segmentation process different from the first character segmentation process is performed on the target binarized image.
After one binarization operation, based on two different character segmentation algorithms, two different character segmentation processes are performed in series, so that the capability of the bill identification method for adapting to different scenes is enhanced, and the accuracy and the speed of bill number identification are improved.
In actual execution, when the two character segmentation processes in the character segmentation operation cannot obtain a clear target character segmentation image, the binarization operation and the character segmentation operation are recycled, and the binarization operation executed again uses a different binarization processing mode from the binarization operation executed last time so as to obtain the clear target character segmentation image and realize bill number identification.
In some embodiments, step 130, performing a character segmentation operation on the target binarized image, includes:
performing a first character segmentation process on the target binarized image;
obtaining a target character segmentation image, comprising:
and obtaining a target character segmentation image corresponding to the first character segmentation process.
In this embodiment, the first character segmentation process is performed on the target binarized image, a character image corresponding to the first character segmentation process is acquired, and when the character image corresponding to the first character segmentation process is clear and character recognition is possible, the character image obtained by the first character segmentation process is used as the target character segmentation image, and the next character recognition is directly performed without performing the character segmentation operation again.
In some embodiments, the character segmentation operation includes at least one of a first character segmentation process that is connected domain normal character segmentation and a second character segmentation process that is projected normal character segmentation.
In this embodiment, when the target character-divided image can be acquired by performing the first character-dividing process, the character-dividing operation includes only the first character-dividing process, when the target character-divided image is not acquired by performing the first character-dividing process, and when the target character-divided image is acquired by performing the second character-dividing process, the character-dividing operation includes the first character-dividing process and the second character-dividing process.
In this embodiment, the first character segmentation process is connected domain method character segmentation, and connected domain method character segmentation is to search, screen and obtain the region coordinates of a single character for the target binary image according to priori knowledge such as the width and height dimensions of the bill, and obtain the target character segmentation image according to the region coordinates of the single character.
In actual execution, the connected domain method character segmentation includes the following steps:
and searching and marking all connected domains of the target binarized image, wherein the connected domains refer to image areas which are formed by foreground pixel points with the same pixel value and adjacent positions in the image.
Screening according to the shape of the connected domain and the neighbor relation, screening and removing invalid connected domains in the target binary image, connecting the connected domains which are similar in shape and adjacent to each other to obtain the connected domain where the single character is located, and then obtaining the target character segmentation image according to the frame line and the coordinates of the connected domain.
In this embodiment, the second character segmentation process is projective character segmentation.
In actual implementation, the projective character segmentation includes the steps of:
when the layout of characters in the target binarization image is determined to be of a left-to-right type, the target binarization image is subjected to vertical projection according to the number of pixels in the target binarization image, a distribution histogram of the pixels is obtained, and a target character segmentation image is obtained according to the coordinates of the histogram.
When the layout of characters in the target binarized image is determined to be of a top-down type, horizontally projecting the target binarized image according to the number of pixels in the target binarized image to obtain a distribution histogram of the pixels, and obtaining a target character segmentation image according to the coordinates of the histogram.
When the layout of characters in the target binarized image is determined to be of a crisscross type, a mode of vertical projection and then horizontal projection can be adopted to obtain a distribution histogram of pixels, and the target character segmentation image is obtained according to the coordinates of the histogram.
In some embodiments, the binarization processing mode of the binarization operation includes at least one of color channel difference value binarization, adaptive binarization, high-threshold binarization, low-threshold binarization, and gradient binarization.
In this embodiment, according to the characteristics that the bill number is mainly black or red, or the bill number is dark or bright, the color channel difference value binarization, the adaptive binarization, the high-threshold binarization, the low-threshold binarization and the gradient binarization can be performed on the target bill image.
The color channel difference value binarization is to make differences between pixel values at the same positions in different color channels of the target bill image, and perform binarization processing according to a set threshold value to obtain a color channel difference value binarization result.
The color channel difference value binarization can fully utilize the color information of the target bill image, and when the pixel value difference of each color channel of the target bill image is large, a good binarization effect can be obtained.
The self-adaptive binarization comprises a global self-adaptive binarization processing mode and a local self-adaptive binarization processing method.
The global self-adaptive binarization processing mode is to calculate a binarization threshold value according to the pixels of the target bill image, the gray value of the pixels is set to 255 when the pixels are larger than the binarization threshold value, and the gray value of the pixels is set to 0 when the pixels are smaller than the binarization threshold value, so that the target binarization image can be obtained through global self-adaptive binarization.
The global self-adaptive binarization processing method has simple processing process and short processing time, and can rapidly obtain the target binarization image.
The local self-adaptive binarization processing method is to calculate according to pixel blocks and pixel values of adjacent pixel blocks to obtain a plurality of local binarization thresholds, binarize the corresponding pixel blocks according to each local binarization threshold, set the pixel gray value of the pixel larger than the binarization threshold as 255, set the pixel gray value of the pixel smaller than the binarization threshold as 0, and obtain the target binarization image through local self-adaptive binarization.
The local self-adaptive binarization processing method has strong anti-interference performance, and can maintain good binarization effect under the condition of uneven illumination.
The high threshold binarization is to set a larger binarization threshold according to the pixel histogram of the target bill image by people, and obtain the target binarization image according to the binarization processing mode.
The low threshold binarization is to set a smaller binarization threshold according to the pixel histogram of the target bill image by people, and obtain the target binarization image according to the binarization processing mode.
When the two binarization processing modes process bills produced by the same printing manufacturer in the same format, the process of adaptively calculating the binarization threshold value can be skipped, the identification process of bill numbers is accelerated, and meanwhile, a better binarization effect can be obtained.
The gradient binarization is to determine a binarization threshold according to the gradient characteristics of the target bill image, and perform binarization processing on the target bill image to obtain a target binarization image.
In the case of small difference of pixel values of all color channels in the target bill image, the gradient binarization can obtain a proper binarization threshold value to obtain a target binarization image without noise.
In the embodiment of the application, the binarization operation and the character segmentation operation are carried out on the target bill image, the binarization operation comprises one-time binarization operation, the character segmentation operation comprises one-time or two-time character segmentation operation, the character segmentation operation carried out twice is different, and when the clear target character segmentation image is not obtained by the two-time character segmentation operation, the binarization operation and the character segmentation operation are carried out again in a circulating way, the binarization processing mode adopted by the next execution of the binarization operation is different from the binarization processing mode adopted by the previous binarization operation, so that a new target binarization image is obtained, the target character segmentation image is further obtained according to the new target binarization image, then the character recognition is carried out on the target character segmentation image, and the different bill formats and different printing manufacturer bill styles can be adapted through the different types of the binarization operation and the character segmentation operation, and the recognition accuracy of bill numbers is improved.
In some embodiments, performing character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized, including:
extracting single character features of the target character segmentation image to obtain feature information corresponding to the single characters in the target character segmentation image;
and carrying out classification and identification on the characteristic information to obtain the number identification information.
The feature extraction is a method for transforming a group measurement value of a certain mode to highlight a representative feature of the mode, and the required feature can be extracted through image analysis and transformation.
In this embodiment, the target character-divided image includes a plurality of single-character-divided images, the single-character feature extraction is performed on the target character-divided image, feature information of the plurality of single characters can be obtained, and further the direction gradient histogram (Histogram of oriented gradient, HOG) feature information can be formed by calculating and counting the gradient direction histogram of the local area of the target character-divided image.
In practical implementation, the target character segmentation image may be divided into small connected regions, which are called cell units, then gradient or edge direction histograms of each pixel point in the cell units are collected, and finally the histograms are combined to form the direction gradient histogram feature information.
The feature information of the directional gradient histogram is operated on the local square grid unit of the target character segmentation image, so that the geometric shape and the optical deformation of the target character segmentation image can be kept unchanged, and the original serial number of the bill number can be well kept during the subsequent classification and identification, so that the number identification information is obtained.
In this embodiment, the local binary (Local Binary Pattern, LBP) feature information of the target character-divided image may also be obtained by dividing the target character-divided image into a plurality of sub-block diagrams, and processing each sub-block diagram.
In actual execution, for one pixel in each sub-block diagram, comparing the gray value of 8 adjacent pixels with the gray value, if the surrounding pixel value is larger than the central pixel value, marking the pixel point as 1, otherwise marking the pixel point as 0, so that 8 points in a 3*3 area can be obtained, 8-bit binary numbers can be generated as local binary characteristic information of the pixel point through comparison, the occurrence frequency of each local binary characteristic information in each sub-block diagram is calculated, a distribution histogram of the occurrence of the local binary characteristic information is obtained, normalization processing is carried out on the distribution histogram, and each sub-block diagram is connected into a characteristic vector, so that the local binary characteristic information of the target character segmentation image is obtained.
The local binary characteristic information can effectively measure and extract texture information in the target character image, and has the advantages of rotation invariance, gray invariance and the like.
The classifying and identifying the feature information may be to input the feature information into a classifier to obtain the number identifying information output by the classifier.
In actual implementation, the feature information can be classified and identified by using the model to obtain a number identification result output by the model, and finally, the result with the maximum confidence is taken as the number identification information.
For example, the feature information may be classified by using a support vector machine model, or the feature information may be classified by using a neural network model, to obtain the number identification information.
The following describes a specific embodiment, which is used to describe a specific application scenario of the bill number recognition method provided by the embodiment of the present application.
As shown in fig. 2, the financial self-service apparatus may include a signal acquisition module 210, an image preprocessing module 220, and an OCR recognition module 230.
The signal acquisition module 210 may be an image sensor, the signal acquisition module 210 may be disposed at a ticket inlet of the self-service financial device, and the signal acquisition module 210 is configured to acquire an image signal of a ticket to be identified at the ticket inlet.
The signal acquisition module 210 may generate a target ticket image from the acquired image signal and transmit the target ticket image to the image preprocessing module 220, and the image preprocessing module 220 preprocesses the target ticket image and transmits the target ticket image to the OCR recognition module 230 so that the OCR recognition module 230 performs a binarization operation and a character segmentation operation of the image.
As shown in fig. 3, the OCR recognition module 230 performs a binarization operation and a character segmentation operation on the target ticket image to obtain a target character segmentation image, and performs ticket number recognition on the target character segmentation image to obtain number recognition information.
The following takes the first character segmentation process as connected domain method character segmentation and the second character segmentation process as projection method character segmentation as an example.
The OCR recognition module 230 performs a binarization operation on the target ticket image to obtain a target binarized image, performs a connected domain method character segmentation operation on the target binarized image, and performs character recognition on the target character segmentation image to obtain number recognition information under the condition that the connected domain method character segmentation successfully obtains the target character segmentation image.
And under the condition that the connected domain method character segmentation does not obtain the target character segmentation image, performing a projection method character segmentation operation on the target binarization image, and under the condition that the projection method character segmentation successfully obtains the target character segmentation image, performing character recognition on the target character segmentation image to obtain the number recognition information.
Under the condition that the target character segmentation image is not obtained by the projection method character segmentation, the target bill image is binarized again by using a binarization processing mode different from the previous one, a new target binarization image is obtained, and the connected domain method character segmentation and the projection method character segmentation are re-executed on the new target binarization image until the target character segmentation image is obtained, so that the number identification information is finally obtained, and the financial self-service equipment can execute further operation according to the number identification information.
Under the condition that a clear target character segmentation image of a single character cannot be obtained, a new target binarization image is obtained by adopting a binarization processing mode different from that of the last time, and character segmentation operation is carried out on the new target binarization image again to obtain the clear target character segmentation image of the single character, so that the method can adapt to different bill formats and bill styles of different printing manufacturers, and the identification accuracy of bill numbers is improved.
The bill identification method provided by the embodiment of the application is applied to bill number identification of hundreds of bills of tens of banks, and has extremely high accuracy, thereby effectively improving the working efficiency.
The execution main body of the bill number identification method provided by the embodiment of the application can be electronic equipment or a functional module or a functional entity capable of realizing the bill number identification method in the electronic equipment, and the electronic equipment provided by the embodiment of the application comprises, but is not limited to, a mobile phone, a tablet computer, a camera, a wearable device and the like.
According to the bill number identification method provided by the embodiment of the application, the execution main body can be a bill number identification device. In the embodiment of the application, a bill number recognition device is taken as an example to execute a bill number recognition method, and the bill number recognition device provided by the embodiment of the application is described.
The embodiment of the application also provides a bill number recognition device.
As shown in fig. 4, the bill number recognition apparatus includes:
an acquisition module 410, configured to acquire a target ticket image of a ticket to be identified;
a first processing module 420, configured to perform a binarization operation on the target ticket image, to obtain a target binarized image;
a second processing module 430 for performing a character segmentation operation on the target binarized image;
A third processing module 440, configured to re-perform the binarization operation and the character segmentation operation until the target character segmentation image is obtained, in a case where the corresponding target character segmentation image is not obtained by performing the character segmentation operation;
a fourth processing module 450, configured to perform character recognition on the target character segmentation image to obtain number identification information corresponding to the ticket to be recognized;
wherein, the binarization processing mode of the binarization operation executed at the last time is different from the binarization processing mode of the binarization operation executed at the previous time.
According to the bill number recognition device provided by the embodiment of the application, when a clear target character segmentation image cannot be obtained, the binarization processing mode which is different from the last binarization processing mode is adopted again, the binarization operation and the character segmentation operation are circularly executed, and the proper binarization processing mode and character segmentation operation are found and used, so that the bill number recognition device is suitable for different bill formats and bill styles of different printing manufacturers, and the recognition accuracy of the bill numbers is improved.
In some embodiments, the second processing module 430 is configured to perform a first character segmentation process on the target binarized image; performing a second character segmentation process on the target ticket image in a case where it is determined that the target character segmentation image is not obtained by the first character segmentation process;
The third processing module 440 is configured to obtain a target character segmentation image corresponding to the second character segmentation process.
In some embodiments, the second processing module 430 is configured to perform a first character segmentation process on the target binarized image;
the third processing module 440 is configured to obtain a target character segmentation image corresponding to the first character segmentation process.
In some embodiments, the character segmentation operation includes at least one of a first character segmentation process that is connected domain normal character segmentation and a second character segmentation process that is projected normal character segmentation.
In some embodiments, the binarization processing mode of the binarization operation includes at least one of color channel difference value binarization, adaptive binarization, high-threshold binarization, low-threshold binarization, and gradient binarization.
In some embodiments, the fourth processing module 450 is configured to perform single character feature extraction on the target character segmentation image, so as to obtain feature information corresponding to the single character in the target character segmentation image;
and carrying out classification and identification on the characteristic information to obtain the number identification information.
The bill number recognition device in the embodiment of the application can be electronic equipment or a component in the electronic equipment, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The bill number recognition device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The bill number recognition device provided by the embodiment of the present application can implement each of the embodiments of the methods of fig. 1 to 3, and in order to avoid repetition, a detailed description is omitted here.
In some embodiments, as shown in fig. 5, an electronic device 500 is further provided in the embodiments of the present application, 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, where the program when executed by the processor 501 implements each of the above embodiments of the bill number recognition method, and the same technical effects can be achieved, and for avoiding repetition, a detailed description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
The embodiment of the application also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements each of the above-mentioned bill number identification method embodiments, and can achieve the same technical effects, and in order to avoid repetition, no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program realizes the bill number identification method when being executed by a processor.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a method, article or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the application, the scope of which is defined by the claims and their equivalents.
Claims (10)
1. A bill number recognition method, comprising:
acquiring a target bill image of a bill to be identified;
performing binarization operation on the target bill image to obtain a target binarization image;
Performing a character segmentation operation on the target binarized image;
re-executing the binarization operation and the character segmentation operation until the target character segmentation image is obtained under the condition that the corresponding target character segmentation image is not obtained by executing the character segmentation operation;
performing character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized;
wherein, the binarization processing mode of executing the binarization operation at the last time is different from the binarization processing mode of executing the binarization operation at the previous time.
2. The ticket number recognition method as claimed in claim 1, wherein the performing a character segmentation operation on the target binarized image comprises:
performing a first character segmentation process on the target binarized image;
performing a second character segmentation process on the target ticket image in a case where it is determined that the target character segmentation image is not obtained by the first character segmentation process;
the obtaining the target character segmentation image includes:
and obtaining the target character segmentation image corresponding to the second character segmentation processing.
3. The ticket number recognition method as claimed in claim 1, wherein the performing a character segmentation operation on the target binarized image comprises:
Performing a first character segmentation process on the target binarized image;
the obtaining the target character segmentation image includes:
and obtaining the target character segmentation image corresponding to the first character segmentation processing.
4. A ticket number recognition method according to claim 2 or 3, wherein the character segmentation operation comprises at least one of a first character segmentation process which is connected domain normal character segmentation and a second character segmentation process which is projective character segmentation.
5. A method of identifying a ticket number according to any one of claims 1 to 3 wherein the binarization processing means of the binarization operation comprises at least one of colour channel difference binarization, adaptive binarization, high threshold binarization, low threshold binarization and gradient binarization.
6. The bill number recognition method according to any one of claims 1-3, wherein the character recognition is performed on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized, including:
extracting single character features of the target character segmentation image to obtain feature information corresponding to single characters in the target character segmentation image;
And carrying out classification and identification on the characteristic information to obtain the number identification information.
7. A bill number recognition device, characterized by comprising:
the acquisition module is used for acquiring a target bill image of the bill to be identified;
the first processing module is used for executing binarization operation on the target bill image to obtain a target binarization image;
the second processing module is used for executing character segmentation operation on the target binarized image;
a third processing module, configured to re-execute the binarization operation and the character segmentation operation until the target character segmentation image is obtained, where the corresponding target character segmentation image is not obtained by executing the character segmentation operation;
the fourth processing module is used for carrying out character recognition on the target character segmentation image to obtain number recognition information corresponding to the bill to be recognized;
wherein, the binarization processing mode of executing the binarization operation at the last time is different from the binarization processing mode of executing the binarization operation at the previous time.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the ticket number recognition method of any of claims 1-6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a ticket number recognition method as claimed in any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements a ticket number recognition method as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310390174.2A CN116580410A (en) | 2023-04-12 | 2023-04-12 | Bill number identification method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310390174.2A CN116580410A (en) | 2023-04-12 | 2023-04-12 | Bill number identification method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116580410A true CN116580410A (en) | 2023-08-11 |
Family
ID=87534881
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310390174.2A Pending CN116580410A (en) | 2023-04-12 | 2023-04-12 | Bill number identification method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116580410A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117423126A (en) * | 2023-12-18 | 2024-01-19 | 广州市省信软件有限公司 | Bill image-text recognition method and system based on data analysis |
-
2023
- 2023-04-12 CN CN202310390174.2A patent/CN116580410A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117423126A (en) * | 2023-12-18 | 2024-01-19 | 广州市省信软件有限公司 | Bill image-text recognition method and system based on data analysis |
CN117423126B (en) * | 2023-12-18 | 2024-03-08 | 广州市省信软件有限公司 | Bill image-text recognition method and system based on data analysis |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Yuan et al. | A robust and efficient approach to license plate detection | |
Raghunandan et al. | Riesz fractional based model for enhancing license plate detection and recognition | |
Bi et al. | Fast reflective offset-guided searching method for copy-move forgery detection | |
US20170287252A1 (en) | Counterfeit Document Detection System and Method | |
CN104751093B (en) | Method and apparatus for obtaining the video identification code that host equipment is shown | |
Özgen et al. | Text detection in natural and computer-generated images | |
Zhao et al. | A robust hybrid method for text detection in natural scenes by learning-based partial differential equations | |
CN103198311A (en) | Method and apparatus for recognizing a character based on a photographed image | |
CN114049499A (en) | Target object detection method, apparatus and storage medium for continuous contour | |
CN116580410A (en) | Bill number identification method and device, electronic equipment and storage medium | |
Wicht et al. | Camera-based sudoku recognition with deep belief network | |
Akpojotor et al. | Automatic license plate recognition on microprocessors and custom computing platforms: A review | |
Tsai et al. | Recognition of Vehicle License Plates from a Video Sequence. | |
Rajan et al. | Text detection and character extraction in natural scene images using fractional Poisson model | |
Mohammad et al. | Practical recognition system for text printed on clear reflected material | |
Zhu et al. | Chip surface character recognition based on improved LeNet-5 convolutional neural network | |
Soumya et al. | Enhancement and segmentation of historical records | |
Fang et al. | 1-D barcode localization in complex background | |
Huang et al. | Feature extraction for license plate location based on L 0-norm smoothing | |
Revathi et al. | Optical Character Recognition for Handwritten Telugu Text | |
Chakraborty et al. | Frame selection for OCR from video stream of book flipping | |
Zhang et al. | Digital image forensics of non-uniform deblurring | |
Shekar | Skeleton matching based approach for text localization in scene images | |
Prasanna et al. | KANNADA TEXT EXTRACTION FROM IMAGES AND VIDEOS FORVISION IMPAIRED PERSONS | |
US9202097B2 (en) | Information processing apparatus, information processing method, and computer program product |
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 |