Lottery service-based ticket face optical character recognition method and device
By adopting a variety of preset optical character recognition rules and image preprocessing technologies in the lottery business, the lottery ticket faces are identified, which solves the problem of low recognition success rate and accuracy in the existing technology, and achieves more efficient face-to-face information extraction .
Patent Information
- Application Number
- CN202411294777.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art is difficult to effectively identify soft special material faces in lottery business, resulting in low recognition success and accuracy.
A method of adopting a preset optical character recognition rule, including a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure number type, and a third optical character recognition based on a whitelist special character Rules, identify target face image, and improve recognition accuracy through image preprocessing and neural network model training.
The success rate and accuracy of optical character recognition on the lottery ticket business face are improved, ensuring the reliability and accuracy of the recognition results.
Smart Images

Figure CN119399769A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a ticket optical character recognition method and device based on lottery business. Background Art
[0002] OCR (Optical Character Recognition) technology is a technology that uses optical equipment and software tools to convert printed or handwritten text into machine-processable text. It obtains image information through scanning, taking pictures, etc., and then uses image processing and pattern recognition algorithms to convert the text in the image into editable text data. OCR technology requires a large amount of annotated data for training to improve recognition accuracy.
[0003] The OCR technology in the existing technology can recognize flat general screenshot text, but cannot effectively recognize the information of target objects (such as ticket objects made of soft special materials) that meet the rules of specific industry businesses (such as lottery business). The recognition success rate is low and the accuracy is not high.
[0004] How to improve the success rate and accuracy of optical character recognition on lottery tickets is a technical problem that needs to be solved at present. Summary of the invention
[0005] The present invention provides a ticket optical character recognition method and device based on lottery business, which are used to solve the defects in the prior art.
[0006] The present invention provides a ticket optical character recognition method based on lottery business, which is applied to a server and includes the following steps: Receive a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by: obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; Recognize the target ticket image based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0007] According to a ticket optical character recognition method based on lottery business provided by the present invention, before the target ticket image is recognized based on a preset optical character recognition rule and structured data corresponding to the target ticket image is obtained, the method further includes: Performing image preprocessing on the target ticket image; The image preprocessing includes: image binarization, noise removal, feature extraction, edge detection and image sharpening.
[0008] According to a lottery ticket optical character recognition method based on lottery business provided by the present invention, the training process of the lottery ticket recognition intelligent agent includes: Receive the historical target ticket image sent by the recognition terminal, and perform image preprocessing on the historical target ticket image; wherein the historical target ticket image is obtained by obtaining the historical original ticket image through the recognition terminal and performing cropping preprocessing; Perform structural font annotation on the historical target ticket images after image preprocessing to obtain the ticket structural fonts; The neural network model is trained based on the ticket face structure font to obtain the lottery ticket face recognition intelligent agent.
[0009] According to a ticket optical character recognition method based on lottery business provided by the present invention, the target ticket image is recognized based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, including: The target ticket image is recognized based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule respectively to obtain structured data corresponding to the target ticket image.
[0010] According to a ticket optical character recognition method based on lottery business provided by the present invention, the target ticket image is recognized based on the first optical character recognition rule, the second optical character recognition rule and the third optical character recognition rule respectively to obtain structured data corresponding to the target ticket image, including: Recognize the target ticket image based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule to obtain a target recognition result; The target recognition result is cleaned and predicted to obtain structured data corresponding to the target ticket image.
[0011] According to a ticket optical character recognition method based on lottery business provided by the present invention, after the target ticket image is recognized based on a preset optical character recognition rule and structured data corresponding to the target ticket image is obtained, the method further includes: The structured data is sent to the identification terminal so that the identification terminal displays the structured data.
[0012] According to a ticket optical character recognition method based on lottery business provided by the present invention, the target ticket image is recognized based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, including: Recognize the target ticket image based on preset optical character recognition rules to obtain initial structured data corresponding to the target ticket image; Anomaly detection and correction are performed on the initial structured data to obtain structured data corresponding to the target ticket image.
[0013] The present invention also provides a ticket optical character recognition device based on lottery business, which is applied to a server and includes the following modules: A receiving module, used for receiving a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; A recognition module, used to recognize the target ticket image based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the ticket optical character recognition method based on lottery business as described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the ticket optical character recognition method based on lottery business as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the ticket optical character recognition method based on lottery business as described above is implemented.
[0017] The present invention provides a ticket optical character recognition method and device based on lottery business, which is applied to a server, and receives a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by obtaining the original ticket image through the recognition terminal and performing cropping preprocessing; the target ticket image is recognized based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image; wherein the optical character recognition rule includes: a first optical character recognition rule based on a lottery ticket recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist of special characters; the lottery ticket recognition agent is obtained by training a neural network model based on historical original ticket images. It can be seen that the present invention recognizes the target ticket image based on three preset optical character recognition rules respectively, obtains the corresponding structured data, ensures the recognition success rate, and the mode combining the three recognition rules can improve the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flow chart of the ticket optical character recognition method based on lottery business provided by the present invention.
[0020] Figure 2 It is a schematic diagram of the training process of the lottery ticket face recognition intelligent agent provided by the present invention.
[0021] Figure 3 It is a complete flow chart of the ticket optical character recognition method based on lottery business provided by the present invention.
[0022] Figure 4 It is a structural schematic diagram of a ticket optical character recognition device based on lottery business provided by the present invention.
[0023] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Before describing the method of the present invention in detail, the terms involved in the present invention are first explained schematically.
[0026] OCR, optical character recognition.
[0027] Binarization is a basic and important technology in image processing. It converts the image into a black and white visual effect by setting the grayscale value of the pixel points on the image to 0 or 255.
[0028] Noise removal: By setting an appropriate threshold, binarization processing can also remove noise in the image to a certain extent and improve image quality.
[0029] Image noise reduction, image noise reduction processing is a digital image processing technology, which aims to reduce or eliminate noise in the image. These noises are usually caused by factors such as image sensors, insufficient light, and shooting conditions.
[0030] Feature extraction: In image processing, binarization helps to simplify the image content and highlight the outline of the target of interest, thus facilitating subsequent feature extraction and recognition.
[0031] Image preprocessing,Before advanced processing such as image analysis, edge detection, contour extraction, binarization is often used as a preprocessing step to reduce the amount of data and increase the processing speed.
[0032] CNN, convolutional neural network, is mainly used to extract features. It is a feedforward neural network used to process grid-structured data such as images, videos, and audio. It is one of the most commonly used models in the field of deep learning, especially for computer vision tasks.
[0033] Machine learning is a science and technology about data learning. It can help machines learn patterns from existing complex data to predict future behavioral outcomes and trends.
[0034] AI, artificial intelligence.
[0035] AI generative expert system: an expert reasoning system built based on business data about the lottery industry.
[0036] Combine the following Figure 1-Figure 5 The present invention describes a ticket optical character recognition method and device based on lottery business.
[0037] Figure 1 FIG. 1 is a flow chart of a ticket optical character recognition method based on lottery business provided by the present invention, such as Figure 1 As shown, applied to a server, the method includes the following: Step 100: Receive a target ticket image sent by an identification terminal; wherein the target ticket image is obtained by obtaining an original ticket image through the identification terminal and performing cropping preprocessing.
[0038] It should be noted that the subject of the present invention is a server. The server device provided in the embodiment of the present invention adopts a high-performance processor, a large-capacity memory and a high-speed storage device to ensure stable operation under high concurrency. At the same time, it is equipped with a redundant power supply and a network interface to improve the reliability and availability of the system.
[0039] The recognition terminal in the embodiment of the present invention can be, for example, a handheld OCR recognition terminal, a portable document scanner, a smart phone, etc. The original ticket image may come from different fields and scenarios, including sports lottery store terminal machine ticketing, sports lottery store handheld terminal ticketing, Android terminal ticketing, welfare lottery store terminal ticketing, and other terminals for the lottery industry. The target ticket image can be obtained by cropping and preprocessing the recognition terminal based on the above ticket.
[0040] Furthermore, before the target ticket image is recognized based on a preset optical character recognition rule in step 200 to obtain structured data corresponding to the target ticket image, the method further includes: Performing image preprocessing on the target ticket image; The image preprocessing includes: image binarization, noise removal, feature extraction, edge detection and image sharpening.
[0041] Step 200: Recognize the target ticket image based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0042] Specifically, Figure 2 FIG. 1 is a schematic diagram of the training process of the lottery ticket recognition agent provided by the present invention. Figure 2As shown, the training process of the lottery ticket recognition agent provided by the embodiment of the present invention is explained.
[0043] The training process of the lottery ticket recognition agent includes: Receive the historical target ticket image sent by the recognition terminal, and perform image preprocessing on the historical target ticket image; wherein the historical target ticket image is obtained by obtaining the historical original ticket image through the recognition terminal and performing cropping preprocessing; Perform structural font annotation on the historical target ticket images after image preprocessing to obtain the ticket structural fonts; The neural network model is trained based on the ticket face structure font to obtain the lottery ticket face recognition intelligent agent.
[0044] Specifically, the recognition terminal captures the historical original ticket image and performs cropping preprocessing to obtain the historical target ticket image. The server performs image binarization, noise removal, feature extraction, edge detection, image sharpening, etc. on the historical target ticket image to achieve image organization and form recognition agent training sample material. By utilizing a large amount of agent training sample material, a lottery ticket recognition agent is generated.
[0045] Optionally, in addition to convolutional neural networks (CNNs) and recurrent neural networks (RNNs), the use of Transformer models, especially the Vision Transformer (ViT) variant for OCR tasks, can be explored to better capture global and local features.
[0046] Specifically, step 200 recognizes the target ticket image based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, including: Step 210: Recognize the target ticket image based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule to obtain a target recognition result.
[0047] Step 220: perform data cleaning and prediction on the target recognition result to obtain structured data corresponding to the target ticket image.
[0048] It should be noted that the first optical character recognition rule based on the lottery ticket recognition agent needs to comprehensively identify multiple fields when processing complex tickets, such as lottery game type, game name, ticket issue date, lottery draw time, lottery serial number, lottery verification code, ticket type, betting method, betting multiple, betting amount and betting number, etc. These fields usually have different formats (font style and size) and positions, and the agent needs to accurately locate them according to the ticket layout, use deep learning algorithms to pre-process the ticket image (such as grayscale, binarization, noise reduction, etc.), and then accurately identify and extract the information of each field through feature extraction and pattern matching technology. The second optical character recognition rule based on pure digital types uses the unique shape and arrangement characteristics of numbers (such as lottery serial numbers, amounts, etc.) to design a special recognition algorithm to reduce the error recognition rate and missed recognition rate. The third optical character recognition rule based on whitelist special characters defines the whitelist character set according to actual needs and sets corresponding recognition rules. Whitelist special characters refer to special characters (such as punctuation marks, specific symbols, etc.) that may appear in the ticket information but are limited in number and fixed in format.
[0049] Furthermore, after step 200 recognizes the target ticket image based on a preset optical character recognition rule and obtains structured data corresponding to the target ticket image, the method further includes: The structured data is sent to the identification terminal so that the identification terminal displays the structured data.
[0050] In one embodiment, step 200 recognizes the target ticket image based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, and further includes: Recognize the target ticket image based on preset optical character recognition rules to obtain initial structured data corresponding to the target ticket image; Anomaly detection and correction are performed on the initial structured data to obtain structured data corresponding to the target ticket image.
[0051] This embodiment adds abnormality detection to identify and process abnormal situations (such as severe contamination, folding, etc.) that occur during the recognition process, thereby avoiding the output of erroneous results.
[0052] The above is a step description of the ticket optical character recognition method based on lottery business provided by the present invention. From the description of the above steps, it can be seen that the ticket optical character recognition method based on lottery business provided by the present invention is applied to the server, by receiving the target ticket image sent by the recognition terminal; wherein the target ticket image is obtained by obtaining the original ticket image through the recognition terminal and performing cropping preprocessing; the target ticket image is recognized based on the preset optical character recognition rules to obtain the structured data corresponding to the target ticket image; wherein the optical character recognition rules include: a first optical character recognition rule based on the lottery ticket recognition agent, a second optical character recognition rule based on the pure digital type, and a third optical character recognition rule based on the whitelist special characters; the lottery ticket recognition agent is obtained by training the neural network model based on the historical original ticket image. It can be seen that the present invention recognizes the target ticket image based on the three pre-set optical character recognition rules respectively, obtains the corresponding structured data, ensures the recognition success rate, and the mode combining the three recognition rules can improve the recognition accuracy.
[0053] Figure 3 is a complete flow chart of the ticket optical character recognition method based on lottery business provided by the present invention, such as Figure 3 As shown, the complete process of the ticket optical character recognition method based on lottery business provided by the present invention is described.
[0054] 1. Use the identification terminal to obtain the original ticket image.
[0055] 2. The recognition terminal performs cropping preprocessing on the original ticket image to obtain the target ticket image, and sends the target ticket image to the server.
[0056] 3. The server performs image preprocessing on the target ticket image.
[0057] 4. The server recognizes the target ticket image after image preprocessing based on the preset first optical character recognition rule based on the lottery ticket recognition agent, the second optical character recognition rule based on the pure digital type, and the third optical character recognition rule based on the whitelist special characters to obtain the target recognition result.
[0058] 5. The server uses the AI production expert system to clean the target recognition results and structure the predictions to obtain the structured data corresponding to the target ticket image.
[0059] 6. The server sends the structured data to the recognition terminal.
[0060] 7. Identify the terminal for structured data display and information feedback.
[0061] The ticket optical character recognition method based on lottery business provided by the present invention recognizes the target ticket image based on three pre-set optical character recognition rules respectively, obtains corresponding structured data, ensures the recognition success rate, and the mode combining the three recognition rules can improve the recognition accuracy.
[0062] The ticket optical character recognition device based on lottery business provided by the present invention is described below. The ticket optical character recognition device based on lottery business described below and the ticket optical character recognition method based on lottery business described above can be referenced to each other.
[0063] Figure 4 Schematic diagram of the structure of the ticket optical character recognition device based on lottery business provided by the present invention, such as Figure 4 As shown, the ticket optical character recognition device based on lottery business provided by the present invention includes: The receiving module 401 is used to receive a target ticket image sent by the recognition terminal; wherein the target ticket image is obtained by obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; The recognition module 402 is used to recognize the target ticket image based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0064] The ticket optical character recognition device based on lottery business provided by the present invention is applied to the server, and receives the target ticket image sent by the recognition terminal; wherein the target ticket image is obtained by obtaining the original ticket image through the recognition terminal and performing cropping preprocessing; the target ticket image is recognized based on the preset optical character recognition rules to obtain the structured data corresponding to the target ticket image; wherein the optical character recognition rules include: a first optical character recognition rule based on the lottery ticket recognition agent, a second optical character recognition rule based on the pure digital type, and a third optical character recognition rule based on the whitelist special characters; the lottery ticket recognition agent is obtained by training the neural network model based on the historical original ticket image. It can be seen that the present invention recognizes the target ticket image based on the three preset optical character recognition rules respectively, obtains the corresponding structured data, ensures the recognition success rate, and the mode combining the three recognition rules can improve the recognition accuracy.
[0065] Based on the above embodiment, in this embodiment, the device further includes a preprocessing module, which is specifically used for: Before recognizing the target ticket image based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, performing image preprocessing on the target ticket image; The image preprocessing includes: image binarization, noise removal, feature extraction, edge detection and image sharpening.
[0066] Based on the above embodiment, in this embodiment, the device further includes a training module, which is specifically used for: Receive the historical target ticket image sent by the recognition terminal, and perform image preprocessing on the historical target ticket image; wherein the historical target ticket image is obtained by obtaining the historical original ticket image through the recognition terminal and performing cropping preprocessing; Perform structural font annotation on the historical target ticket images after image preprocessing to obtain the ticket structural fonts; The neural network model is trained based on the ticket face structure font to obtain the lottery ticket face recognition intelligent agent.
[0067] Based on the above embodiment, in this embodiment, the identification module 402 is specifically used for: The target ticket image is recognized based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule respectively to obtain structured data corresponding to the target ticket image.
[0068] Based on the above embodiment, in this embodiment, the identification module 402 is specifically used for: Recognize the target ticket image based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule to obtain a target recognition result; The target recognition result is cleaned and predicted to obtain structured data corresponding to the target ticket image.
[0069] Based on the above embodiment, in this embodiment, the device further includes a sending module, which is specifically used to: After the target ticket image is recognized based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image, the structured data is sent to the recognition terminal so that the recognition terminal displays the structured data.
[0070] Based on the above embodiment, in this embodiment, the device further includes a correction module, which is specifically used to: Recognize the target ticket image based on preset optical character recognition rules to obtain initial structured data corresponding to the target ticket image; Anomaly detection and correction are performed on the initial structured data to obtain structured data corresponding to the target ticket image.
[0071] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communications interface 520 and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a ticket optical character recognition method based on lottery business, which is applied to a server, and the method includes: Receive a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by: obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; Recognize the target ticket image based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0072] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0073] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the ticket optical character recognition method based on lottery business provided by the above methods, applied to a server, the method includes: Receive a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by: obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; Recognize the target ticket image based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0074] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the ticket optical character recognition method based on lottery business provided by the above methods, and is applied to a server, wherein the method comprises: Receive a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by: obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; Recognize the target ticket image based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
[0075] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A ticket optical character recognition method based on lottery business, characterized in that: Applied to a server, the method comprises: Receive a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by: obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; Recognize the target ticket image based on preset optical character recognition rules to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
2. The ticket optical character recognition method based on lottery business according to claim 1, characterized in that: Before the target ticket image is recognized based on the preset optical character recognition rules to obtain the structured data corresponding to the target ticket image, the method further includes: Performing image preprocessing on the target ticket image; The image preprocessing includes: image binarization, noise removal, feature extraction, edge detection and image sharpening.
3. The ticket optical character recognition method based on lottery business according to claim 2, characterized in that: The training process of the lottery ticket recognition agent includes: Receive the historical target ticket image sent by the recognition terminal, and perform image preprocessing on the historical target ticket image; wherein the historical target ticket image is obtained by obtaining the historical original ticket image through the recognition terminal and performing cropping preprocessing; Perform structural font annotation on the historical target ticket images after image preprocessing to obtain the ticket structural fonts; The neural network model is trained based on the ticket face structure font to obtain the lottery ticket face recognition intelligent agent.
4. The ticket optical character recognition method based on lottery business according to claim 1, characterized in that: The target ticket image is recognized based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, including: The target ticket image is recognized based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule respectively to obtain structured data corresponding to the target ticket image.
5. The ticket optical character recognition method based on lottery business according to claim 4, characterized in that: The step of respectively identifying the target ticket image based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule to obtain structured data corresponding to the target ticket image includes: Recognize the target ticket image based on the first optical character recognition rule, the second optical character recognition rule, and the third optical character recognition rule to obtain a target recognition result; The target recognition result is cleaned and predicted to obtain structured data corresponding to the target ticket image.
6. The ticket optical character recognition method based on lottery business according to claim 1, characterized in that: After the target ticket image is recognized based on the preset optical character recognition rules to obtain structured data corresponding to the target ticket image, the method further includes: The structured data is sent to the identification terminal so that the identification terminal displays the structured data.
7. The ticket optical character recognition method based on lottery business according to claim 1, characterized in that: The target ticket image is recognized based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image, including: Recognize the target ticket image based on preset optical character recognition rules to obtain initial structured data corresponding to the target ticket image; Anomaly detection and correction are performed on the initial structured data to obtain structured data corresponding to the target ticket image.
8. A ticket optical character recognition device based on lottery business, characterized in that: Applied to a server, the device comprises: A receiving module, used for receiving a target ticket image sent by a recognition terminal; wherein the target ticket image is obtained by obtaining an original ticket image through the recognition terminal and performing cropping preprocessing; A recognition module, used to recognize the target ticket image based on a preset optical character recognition rule to obtain structured data corresponding to the target ticket image; Among them, the optical character recognition rules include: a first optical character recognition rule based on a lottery ticket face recognition agent, a second optical character recognition rule based on a pure digital type, and a third optical character recognition rule based on a whitelist special character; the lottery ticket face recognition agent is obtained by training a neural network model based on historical original ticket face images.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the ticket optical character recognition method based on lottery business as described in any one of claims 1 to 7 is implemented.
10. 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, the ticket optical character recognition method based on lottery business as described in any one of claims 1 to 7 is implemented.