A financial voucher image recognition method and system
Through image processing and database comparison of financial vouchers, the problem of low efficiency in querying financial vouchers in colleges and universities is solved, fast and accurate identification and query of financial vouchers are achieved, and work efficiency is improved.
Patent Information
- Application Number
- CN202210295836.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In the process of querying financial vouchers in colleges and universities, a large number of paper vouchers need to be queried, resulting in low work efficiency and possible errors in obtaining paper vouchers.
By scanning financial vouchers, image preprocessing and segmentation are performed, text information is extracted, and entered into the database for comparison and storage to achieve rapid query and accurate identification.
It improves the efficiency of financial voucher query, avoids errors caused by manual search, and ensures the accurate identification of text areas and the correctness of query results.
Smart Images

Figure CN114782971B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a financial voucher image recognition method and system. Background Art
[0002] The financial voucher of a university is the original record of the occurrence or completion of the economic business of the school. It is a written proof that records economic business, clarifies economic responsibilities, and is compiled in a certain format to register accounting books. In the financial archives of universities, financial vouchers are usually paper vouchers, and due to the large number, long storage period, and unique binding, it is very difficult to archive, organize, search and use.
[0003] Therefore, when people check a certain financial voucher, they need to check from a large number of paper vouchers, which not only hinders people's work efficiency and increases their workload, but also the manual search may result in incorrect paper vouchers. Summary of the invention
[0004] The purpose of the present invention is to provide a financial voucher image recognition method and system, so as to improve the problem in the prior art that users need to search for financial vouchers from a large number of paper vouchers.
[0005] The embodiment of the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for identifying a financial voucher image, which comprises the following steps:
[0007] Scanning a target financial voucher to obtain an image of the financial voucher to be identified;
[0008] Pre-process the financial voucher image to be identified and determine the text area;
[0009] Obtaining a first voucher type of a target financial voucher, inputting the first voucher type into an algorithm matching model for matching, and determining a corresponding image segmentation algorithm;
[0010] According to the text area, the image segmentation algorithm is used to segment the image of the financial voucher to be identified to obtain a segmented image, which contains the text area;
[0011] Performing projection calculation on the segmented image to extract first text information in the text area;
[0012] Inputting the first text information into a preset text library for comparison to determine the second text information;
[0013] Saving the second text information and the image of the financial voucher to be identified in a database;
[0014] When responding to a user query request, the query parameters are obtained, and a match is performed in the database based on the query parameters to obtain second text information matching the query parameters, and based on the second text information, a corresponding financial voucher image to be identified is obtained.
[0015] In some embodiments of the present invention, before the step of scanning the target financial voucher to obtain the image of the financial voucher to be identified, the method further includes:
[0016] When responding to a user login request, obtaining user login information, the user login information includes user identity information and account information;
[0017] If the account information is verified to be correct, the user will be redirected to the corresponding application interface based on the user identity information.
[0018] In some embodiments of the present invention, the step of jumping to the corresponding application interface according to the user identity information includes:
[0019] If the user identity information is the first user, setting the permission parameters corresponding to each identity information in response to the first user's operation;
[0020] If the user identity information is that of a second user, the data in the database is modified in response to the second user's operation.
[0021] In some embodiments of the present invention, the step of scanning the target financial voucher to obtain the image of the financial voucher to be identified includes:
[0022] While scanning the target financial voucher, the target financial voucher is detected using a preset frame;
[0023] If the edge of the target financial document is not parallel to the edge of the preset frame, the position of the target financial document is adjusted until the edge of the target financial document is parallel to the edge of the preset frame to obtain the financial document image to be identified.
[0024] In some embodiments of the present invention, the above-mentioned step of preprocessing the financial voucher image to be recognized and determining the text area includes:
[0025] Performing image binarization processing on the financial voucher image to be identified to obtain a binary financial voucher image;
[0026] Perform edge detection on the binary financial voucher image to determine the text area.
[0027] In some embodiments of the present invention, before the step of inputting the first credential type into the algorithm matching model for matching and determining the corresponding image segmentation algorithm, the method further includes:
[0028] pre-acquire a plurality of second credential types;
[0029] An image segmentation algorithm is constructed according to any second credential type, and an algorithm matching model is established according to all second credential types and corresponding image segmentation algorithms.
[0030] In some embodiments of the present invention, the step of inputting the first text information into a preset text library for comparison to determine the second text information includes:
[0031] Extracting all first text information from the first text information;
[0032] Compare any first text information with all second texts in the preset text library one by one to obtain the second text information with the highest similarity to the first text information;
[0033] The second text information is obtained according to all the second text information.
[0034] In some embodiments of the present invention, the step of performing image segmentation processing on the image of the financial voucher to be identified by using an image segmentation algorithm according to the text area to obtain the segmented image includes:
[0035] According to the text area, the position coordinates of the text area in the financial voucher image to be identified are located;
[0036] According to the position coordinates, the image segmentation algorithm is used to perform image segmentation processing on the financial voucher image to be recognized, so as to obtain a segmented image containing the text area.
[0037] In a second aspect, an embodiment of the present application provides a financial voucher image recognition system, which includes:
[0038] A scanning module, used for scanning a target financial voucher to obtain an image of the financial voucher to be identified;
[0039] A text area determination module, used for preprocessing the financial voucher image to be identified and determining the text area;
[0040] An algorithm matching module, used for obtaining a first voucher type of the target financial voucher, inputting the first voucher type into an algorithm matching model for matching, and determining a corresponding image segmentation algorithm;
[0041] An image segmentation processing module, used for performing image segmentation processing on the image of the financial voucher to be identified according to the text area using the image segmentation algorithm to obtain a segmented image, wherein the segmented image contains the text area;
[0042] A first text information extraction module, used for performing projection calculation on the segmented image to extract first text information in the text area;
[0043] A second text information determination module, configured to input the first text information into a preset text library for comparison, and determine the second text information;
[0044] A data saving module, used for saving the second text information and the image of the financial voucher to be identified into a database;
[0045] The database query module is used to obtain the query parameters when responding to the user query request, and match the query parameters in the database to obtain the second text information matching the query parameters, and obtain the corresponding financial voucher image to be identified based on the second text information.
[0046] In some embodiments of the present invention, the financial voucher image recognition system further includes:
[0047] A login information acquisition module, used to acquire user login information when responding to a user login request, the user login information including user identity information and account information;
[0048] The interface jump module is used to jump to the corresponding application interface according to the user identity information if the account information is verified to be correct.
[0049] In some embodiments of the present invention, the interface jump module includes:
[0050] A first jump unit, configured to, if the user identity information is the first user, respond to the first user's operation to set the permission parameters corresponding to each identity information;
[0051] The second jump unit is used to modify the data in the database in response to the operation of the second user if the user identity information is that of the second user.
[0052] In some embodiments of the present invention, the scanning module includes:
[0053] A detection unit, used for detecting the target financial voucher using a preset frame while scanning the target financial voucher;
[0054] The adjusting unit is used to adjust the position of the target financial document until the edge of the target financial document is parallel to the edge of the preset frame if the edge of the target financial document is not parallel to the edge of the preset frame, so as to obtain the financial document image to be identified.
[0055] In some embodiments of the present invention, the text area determination module includes:
[0056] An image binarization processing unit is used to perform image binarization processing on the financial voucher image to be identified to obtain a binary financial voucher image;
[0057] The edge detection unit is used to perform edge detection on the binary financial voucher image and determine the text area.
[0058] In some embodiments of the present invention, the financial voucher image recognition system further includes:
[0059] A credential type acquisition module, used for pre-acquiring a plurality of second credential types;
[0060] The algorithm matching model building module is used to build an image segmentation algorithm according to any second credential type, and to build an algorithm matching model according to all second credential types and corresponding image segmentation algorithms.
[0061] In some embodiments of the present invention, the second text information determining module includes:
[0062] A first text information extraction unit, used to extract all first text information in the first text information;
[0063] A text information comparison unit, used for comparing any first text information with all second texts in a preset text library one by one, to obtain the second text information with the highest similarity to the first text information;
[0064] The second text information obtaining unit is used to obtain the second text information according to all the second text information.
[0065] In some embodiments of the present invention, the image segmentation processing module includes:
[0066] A position coordinate positioning unit, used to locate the position coordinates of the text area in the financial voucher image to be identified according to the text area;
[0067] The segmented image obtaining unit is used to perform image segmentation processing on the financial voucher image to be identified according to the position coordinates using an image segmentation algorithm to obtain a segmented image containing a text area.
[0068] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method as described in any one of the first aspects above.
[0069] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:
[0070] The present invention provides a financial voucher image recognition method and system, which comprises the following steps: scanning a target financial voucher to obtain a financial voucher image to be recognized. Preprocessing the financial voucher image to be recognized to determine a text area. Obtaining a first voucher type of the target financial voucher, inputting the first voucher type into an algorithm matching model for matching, and determining a corresponding image segmentation algorithm. According to the text area, using an image segmentation algorithm to perform image segmentation processing on the financial voucher image to be recognized, obtaining a segmented image, wherein the segmented image contains a text area. Projection calculation is performed on the segmented image to extract first text information in the text area. Inputting the first text information into a preset text library for comparison, determining second text information. The second text information and the financial voucher image to be recognized are saved in a database. When responding to a user query request, obtaining a parameter to be queried, and matching in a database according to the parameter to be queried, obtaining second text information matching the parameter to be queried, and obtaining a corresponding financial voucher image to be recognized based on the second text information. The method and system first preprocess the financial voucher image to be recognized to distinguish the text area. Then, according to the first voucher type of the target financial voucher, matching in the algorithm matching model to obtain a corresponding image segmentation algorithm. Then, the text area in the image of the financial voucher to be identified is taken as the standard, and the image segmentation algorithm corresponding to the first voucher type is used to process the image of the financial voucher to be identified, and the image containing each text area, namely the segmented image, is extracted. This ensures that the segmented image contains the text area. Then the segmented image is projected and calculated to extract the first text information. The first text information is compared with the preset text library to obtain the second text information to ensure the accuracy of the text in the recognized text area. Finally, when the user needs to query a certain financial voucher, the query parameters are input, and the second text information matching the query parameters is matched in the database, so that the corresponding image of the financial voucher to be identified can be quickly retrieved according to the second text information. Not only does it avoid the problem that the user's work efficiency is hindered by searching through a large number of paper vouchers, but the image of the financial voucher to be identified obtained by the query parameters input by the user can effectively avoid the problem of incorrect paper vouchers obtained by manual search. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0072] Figure 1 A flowchart of a financial voucher image recognition method provided by an embodiment of the present invention;
[0073] Figure 2 A structural block diagram of a financial voucher image recognition system provided by an embodiment of the present invention;
[0074] Figure 3 A structural block diagram of a scanning module provided by an embodiment of the present invention;
[0075] Figure 4 A structural block diagram of a text area determination module provided by an embodiment of the present invention;
[0076] Figure 5 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention;
[0077] Figure 6 A schematic diagram of a financial voucher provided in an embodiment of the present invention.
[0078] Icons: 100-financial voucher image recognition system; 110-scanning module; 111-detection unit; 112-adjustment unit; 120-text area determination module; 121-image binarization processing unit; 122-edge detection unit; 130-algorithm matching module; 140-image segmentation processing module; 150-first text information extraction module; 160-second text information determination module; 170-data storage module; 180-database query module; 101-memory; 102-processor; 103-communication interface. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0080] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0081] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of this application, if the terms "first", "second", etc. appear, they are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0082] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, if the terms "include", "comprise" or any other variant thereof appear, it is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, if an element defined by the sentence "comprises a..." appears, it does not exclude the presence of other identical elements in the process, method, article or equipment including the element.
[0083] In the description of the present application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, or are the orientation or position relationship in which the product of the application is usually placed when used. This is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0084] In the description of this application, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0085] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0086] Example
[0087] Please refer to Figure 1 , Figure 1 The flowchart of a financial voucher image recognition method provided by an embodiment of the present invention is shown. The present application embodiment provides a financial voucher image recognition method, which includes the following steps:
[0088] S110: Scanning a target financial voucher to obtain a financial voucher image to be identified;
[0089] Specifically, a scanner can be used to scan the target financial voucher to obtain a scanned image of the target financial voucher, that is, the financial voucher image to be identified. Figure 6 , Figure 6 The above is a schematic diagram of a financial voucher provided by an embodiment of the present invention.
[0090] S120: Preprocessing the image of the financial voucher to be recognized to determine the text area;
[0091] Specifically, firstly, the image of the financial voucher to be identified is binarized to obtain a binarized financial voucher image, so as to distinguish the non-text area from the text area. For example, the gray value of the non-text area is set to 0, and the gray value of the text area is set to 255, so that the non-text area will be pure black, and the text area will be pure white. Then, edge detection is performed on the binarized financial voucher image to determine the text area in the financial voucher image to be identified.
[0092] S130: Obtain a first voucher type of a target financial voucher, input the first voucher type into an algorithm matching model for matching, and determine a corresponding image segmentation algorithm;
[0093] The algorithm matching model includes a plurality of second voucher types and corresponding image segmentation algorithms. The first voucher type of the target financial voucher is input into the algorithm matching model for matching, and a second voucher type consistent with the first voucher type is obtained, and then a corresponding image segmentation algorithm is obtained.
[0094] S140: performing image segmentation processing on the image of the financial voucher to be recognized by using an image segmentation algorithm according to the text region to obtain a segmented image, wherein the segmented image contains the text region;
[0095] Specifically, firstly, the position coordinates of the text area in the to-be-recognized financial voucher image are determined based on the text area, and then when the to-be-recognized financial voucher image is processed using the image segmentation algorithm corresponding to the first voucher type, the image segmentation process is performed based on the position coordinates, and an image containing each text area, namely a segmented image, is extracted, thereby ensuring that the segmented image contains the text area.
[0096] S150: performing projection calculation on the segmented image to extract first text information in the text area;
[0097] The first text information at least includes one or more of numbers, letters and Chinese characters.
[0098] Specifically, the segmented image is processed using a horizontal projection method to cut out numbers, letters and Chinese characters in the text area.
[0099] S160: inputting the first text information into a preset text library for comparison to determine the second text information;
[0100] Specifically, the preset text library contains multiple second characters, all the first characters in the first text information are compared with the second characters in the preset text library, and the second text information with the highest similarity to the first text information is selected to form the second text information. Obtaining the second text information based on the first text information ensures the accuracy of recognizing the characters in the text area.
[0101] S170: Saving the second text information and the image of the financial voucher to be identified in a database;
[0102] S180: When responding to a user query request, obtain the query parameters, and match them in the database according to the query parameters to obtain second text information matching the query parameters, and obtain the corresponding financial voucher image to be identified based on the second text information.
[0103] Specifically, when a user needs to query a certain financial voucher, he or she inputs the query parameters, and obtains the second text information matching the query parameters in the database, so that the corresponding image of the financial voucher to be identified can be quickly retrieved according to the second text information. This not only avoids the problem of users having to search through a large number of paper vouchers and hindering their work efficiency, but also the image of the financial voucher to be identified obtained through the query parameters input by the user can effectively avoid the problem of incorrect paper vouchers obtained by manual search.
[0104] In some implementations of this embodiment, the method may collect a plurality of numbers, letters and Chinese characters in advance, and establish a preset character library through all the collected numbers, letters and Chinese characters.
[0105] In some implementations of this embodiment, before the step of scanning the target financial voucher to obtain the image of the financial voucher to be identified, the method further includes:
[0106] When responding to a user login request, obtaining user login information, the user login information includes user identity information and account information;
[0107] If the account information is verified to be correct, the user will be redirected to the corresponding application interface based on the user identity information.
[0108] Specifically, the user identity information and account information of any user are created in advance. When the user logs in, the user identity information and account information entered by the user are first obtained, and then the account information entered by the user is compared with the pre-created account information to verify the account information entered by the user. After the verification is correct, the user is redirected to the corresponding application interface according to the user identity information, thereby providing different application interfaces and functions for different user identities to facilitate the use of different user identities.
[0109] Exemplarily, the above user identity information may include a credential scanning administrator, a credential scanning operator, a credential scanning auditor, a financial officer, or an inquiry officer.
[0110] In some implementations of this embodiment, the step of jumping to the corresponding application interface according to the user identity information includes:
[0111] If the user identity information is the first user, setting the permission parameters corresponding to each identity information in response to the first user's operation;
[0112] If the user identity information is that of a second user, the data in the database is modified in response to the second user's operation.
[0113] Among them, the first user is a credential scanning administrator, and the second user is a credential scanning auditor.
[0114] Specifically, the credential scanning administrator can create user accounts and assign identity information and permission parameters to the user accounts. The credential scanning auditor can modify and delete the data in the database that does not match the actual financial voucher to further ensure the accuracy of the data in the database.
[0115] In addition, financial personnel can view the scanned and entered financial vouchers based on the financial voucher number, project number and other information.
[0116] In some implementations of this embodiment, the step of scanning the target financial voucher to obtain the image of the financial voucher to be identified includes:
[0117] While scanning the target financial voucher, the target financial voucher is detected using a preset frame;
[0118] If the edge of the target financial document is not parallel to the edge of the preset frame, the position of the target financial document is adjusted until the edge of the target financial document is parallel to the edge of the preset frame to obtain the image of the financial document to be identified. This achieves the purpose of skew correction of the target financial document and further ensures the accuracy of the obtained image of the financial document to be identified.
[0119] In some implementations of this embodiment, the above-mentioned step of preprocessing the financial voucher image to be identified and determining the text area includes:
[0120] Performing image binarization processing on the financial voucher image to be identified to obtain a binary financial voucher image;
[0121] Perform edge detection on the binary financial voucher image to determine the text area.
[0122] Specifically, firstly, the image of the financial voucher to be identified is binarized to obtain a binarized financial voucher image, so as to distinguish the non-text area from the text area. For example, the gray value of the non-text area is set to 0, and the gray value of the text area is set to 255, so that the non-text area will be pure black, and the text area will be pure white. Then, edge detection is performed on the binarized financial voucher image to determine the text area in the financial voucher image to be identified.
[0123] In some implementations of this embodiment, before the step of inputting the first credential type into the algorithm matching model for matching and determining the corresponding image segmentation algorithm, the method further includes:
[0124] pre-acquire a plurality of second credential types;
[0125] An image segmentation algorithm is constructed according to any second credential type, and an algorithm matching model is established according to all second credential types and corresponding image segmentation algorithms.
[0126] Specifically, multiple financial vouchers can be classified first, and financial vouchers with similar characteristics can be classified into one category to obtain multiple second voucher types. Then, a corresponding image segmentation algorithm can be constructed for each second voucher type. Thus, an algorithm matching model is established based on all second voucher types and corresponding image segmentation algorithms, ensuring that the algorithm matching model has a sufficient number of second voucher types and image segmentation algorithms, thereby ensuring the diversity of the algorithm matching model.
[0127] In some implementations of this embodiment, the step of inputting the first text information into a preset text library for comparison to determine the second text information includes:
[0128] Extracting all first text information from the first text information;
[0129] Compare any first text information with all second texts in the preset text library one by one to obtain the second text information with the highest similarity to the first text information;
[0130] The second text information is obtained according to all the second text information.
[0131] Specifically, all first characters in the first text information are compared with second characters in the preset character library, and the connectivity features and the contour features of any first character and all second characters are compared, and the second text information with the highest similarity to the first text information is selected to form the second text information. Obtaining the second text information based on the first text information ensures the accuracy of recognizing the characters in the text area.
[0132] In some implementations of this embodiment, the step of performing image segmentation processing on the image of the financial voucher to be identified by using an image segmentation algorithm according to the text area to obtain the segmented image includes:
[0133] According to the text area, the position coordinates of the text area in the financial voucher image to be identified are located;
[0134] According to the position coordinates, the image segmentation algorithm is used to perform image segmentation processing on the financial voucher image to be recognized, so as to obtain a segmented image containing the text area.
[0135] Please refer to Figure 2 , Figure 2 The figure is a structural block diagram of a financial voucher image recognition system 100 provided by an embodiment of the present invention. The present application embodiment provides a financial voucher image recognition system 100, which includes:
[0136] The scanning module 110 is used to scan the target financial voucher to obtain the financial voucher image to be identified;
[0137] A text area determination module 120, used for preprocessing the financial voucher image to be identified to determine the text area;
[0138] An algorithm matching module 130 is used to obtain a first voucher type of the target financial voucher, input the first voucher type into an algorithm matching model for matching, and determine a corresponding image segmentation algorithm;
[0139] An image segmentation processing module 140 is used to perform image segmentation processing on the image of the financial voucher to be identified according to the text area using the image segmentation algorithm to obtain a segmented image, wherein the segmented image contains the text area;
[0140] A first text information extraction module 150, configured to perform projection calculation on the segmented image to extract first text information in the text area;
[0141] A second text information determination module 160, configured to input the first text information into a preset text library for comparison to determine the second text information;
[0142] A data storage module 170, configured to store the second text information and the image of the financial voucher to be identified in a database;
[0143] The database query module 180 is used to obtain the query parameters when responding to the user query request, and match the query parameters in the database to obtain the second text information matching the query parameters, and obtain the corresponding financial voucher image to be identified based on the second text information.
[0144] In the above implementation process, the system first pre-processes the image of the financial voucher to be identified to distinguish the text area. Then, according to the first voucher type of the target financial voucher, the corresponding image segmentation algorithm is matched in the algorithm matching model. Then, based on the text area in the image of the financial voucher to be identified, the image of the financial voucher to be identified is processed using the image segmentation algorithm corresponding to the first voucher type, and the image containing each text area, namely the segmented image, is extracted. Thus, the segmented image is ensured to contain the text area. Then, the segmented image is projected and calculated to extract the first text information. The first text information is compared with the preset text library to obtain the second text information to ensure the accuracy of the text in the recognized text area. Finally, when the user needs to query a certain financial voucher, the query parameter is input, and the second text information matching the query parameter is matched in the database, so that the corresponding image of the financial voucher to be identified can be quickly retrieved according to the second text information. Not only does it avoid the problem that the user's work efficiency is hindered by searching through a large number of paper vouchers, but also the image of the financial voucher to be identified obtained by the query parameter input by the user can effectively avoid the problem of incorrect paper vouchers obtained by manual search.
[0145] In some implementations of this embodiment, the financial voucher image recognition system 100 further includes:
[0146] A login information acquisition module, used to acquire user login information when responding to a user login request, the user login information including user identity information and account information;
[0147] The interface jump module is used to jump to the corresponding application interface according to the user identity information if the account information is verified to be correct.
[0148] Specifically, the user identity information and account information of any user are created in advance. When the user logs in, the user identity information and account information entered by the user are first obtained, and then the account information entered by the user is compared with the pre-created account information to verify the account information entered by the user. After the verification is correct, the user is redirected to the corresponding application interface according to the user identity information, thereby providing different application interfaces and functions for different user identities to facilitate the use of different user identities.
[0149] In some implementations of this embodiment, the interface jump module includes:
[0150] A first jump unit, configured to, if the user identity information is the first user, respond to the first user's operation to set the permission parameters corresponding to each identity information;
[0151] The second jump unit is used to modify the data in the database in response to the operation of the second user if the user identity information is that of the second user.
[0152] Among them, the first user is a credential scanning administrator, and the second user is a credential scanning auditor.
[0153] Specifically, the credential scanning administrator can create user accounts and assign identity information and permission parameters to the user accounts. The credential scanning auditor can modify and delete the data in the database that does not match the actual financial voucher to further ensure the accuracy of the data in the database.
[0154] Please refer to Figure 3 , Figure 3 FIG. 1 is a block diagram of a scanning module 110 provided in an embodiment of the present invention. In some implementations of this embodiment, the scanning module 110 includes:
[0155] The detection unit 111 is used to detect the target financial voucher using a preset frame while scanning the target financial voucher;
[0156] The adjustment unit 112 is used to adjust the position of the target financial document until the edge of the target financial document is parallel to the edge of the preset frame if the edge of the target financial document is not parallel to the edge of the preset frame, so as to obtain the image of the financial document to be identified. In this way, the purpose of skew correction of the target financial document is achieved, and the accuracy of the obtained image of the financial document to be identified is further ensured.
[0157] Please refer to Figure 4 , Figure 4 FIG. 1 is a structural block diagram of a text area determination module 120 provided in an embodiment of the present invention. In some implementations of this embodiment, the text area determination module 120 includes:
[0158] An image binarization processing unit 121 is used to perform image binarization processing on the financial voucher image to be identified to obtain a binarized financial voucher image;
[0159] The edge detection unit 122 is used to perform edge detection on the binary financial voucher image to determine the text area.
[0160] Specifically, firstly, the image of the financial voucher to be identified is binarized to obtain a binarized financial voucher image, so as to distinguish the non-text area from the text area. For example, the gray value of the non-text area is set to 0, and the gray value of the text area is set to 255, so that the non-text area will be pure black, and the text area will be pure white. Then, edge detection is performed on the binarized financial voucher image to determine the text area in the financial voucher image to be identified.
[0161] In some implementations of this embodiment, the financial voucher image recognition system 100 further includes:
[0162] A credential type acquisition module, used for pre-acquiring a plurality of second credential types;
[0163] The algorithm matching model building module is used to build an image segmentation algorithm according to any second credential type, and to build an algorithm matching model according to all second credential types and corresponding image segmentation algorithms.
[0164] Specifically, multiple financial vouchers can be classified first, and financial vouchers with similar characteristics can be classified into one category to obtain multiple second voucher types. Then, a corresponding image segmentation algorithm can be constructed for each second voucher type. Thus, an algorithm matching model is established based on all second voucher types and corresponding image segmentation algorithms, ensuring that the algorithm matching model has a sufficient number of second voucher types and image segmentation algorithms, thereby ensuring the diversity of the algorithm matching model.
[0165] In some implementations of this embodiment, the second text information determining module 160 includes:
[0166] A first text information extraction unit, used to extract all first text information in the first text information;
[0167] A text information comparison unit, used for comparing any first text information with all second texts in a preset text library one by one, to obtain the second text information with the highest similarity to the first text information;
[0168] The second text information obtaining unit is used to obtain the second text information according to all the second text information.
[0169] Specifically, all first characters in the first text information are compared with second characters in the preset character library, and the connectivity features and the contour features of any first character and all second characters are compared, and the second text information with the highest similarity to the first text information is selected to form the second text information. Obtaining the second text information based on the first text information ensures the accuracy of recognizing the characters in the text area.
[0170] In some implementations of this embodiment, the image segmentation processing module 140 includes:
[0171] A position coordinate positioning unit, used to locate the position coordinates of the text area in the financial voucher image to be identified according to the text area;
[0172] The segmented image obtaining unit is used to perform image segmentation processing on the financial voucher image to be identified according to the position coordinates using an image segmentation algorithm to obtain a segmented image containing a text area.
[0173] Please refer to Figure 5 , Figure 5A schematic structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device includes a memory 101, a processor 102 and a communication interface 103, and the memory 101, the processor 102 and the communication interface 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, such as program instructions / modules corresponding to a financial voucher image recognition system 100 provided in an embodiment of the present application, and the processor 102 executes various functional applications and data processing by executing software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.
[0174] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0175] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0176] Understandably, Figure 5 The structure shown is for illustration only. The electronic device may also include Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown. Figure 5 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0177] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0179] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable 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 methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0180] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0181] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A method for recognizing financial voucher images, characterized in that: The steps include: Scanning a target financial voucher to obtain an image of the financial voucher to be identified; Preprocessing the financial voucher image to be identified to determine the text area; Acquire a first voucher type of the target financial voucher, input the first voucher type into an algorithm matching model for matching, and determine a corresponding image segmentation algorithm; According to the text area, using the image segmentation algorithm, the image of the financial voucher to be identified is segmented to obtain a segmented image, wherein the segmented image contains the text area; Performing projection calculation on the segmented image to extract first text information in the text area; Inputting the first text information into a preset text library for comparison to determine the second text information; Saving the second text information and the to-be-recognized financial voucher image to a database; When responding to a user query request, the query parameters are obtained, and a match is performed in the database based on the query parameters to obtain second text information matching the query parameters, and based on the second text information, a corresponding financial voucher image to be identified is obtained.
2. The financial voucher image recognition method according to claim 1, characterized in that: Before the step of scanning the target financial voucher to obtain the image of the financial voucher to be identified, the method further includes: When responding to a user login request, obtaining user login information, the user login information including user identity information and account information; If the account information is verified to be correct, the user is redirected to the corresponding application interface based on the user identity information.
3. The financial voucher image recognition method according to claim 2, characterized in that: The step of jumping to the corresponding application interface according to the user identity information includes: If the user identity information is that of the first user, setting the permission parameters corresponding to each identity information in response to the operation of the first user; If the user identity information is that of a second user, the data in the database is modified in response to the operation of the second user.
4. The financial voucher image recognition method according to claim 1, characterized in that: The step of scanning the target financial voucher to obtain the image of the financial voucher to be identified includes: While scanning the target financial voucher, the target financial voucher is detected using a preset frame; If the edge of the target financial document is not parallel to the edge of the preset frame, the position of the target financial document is adjusted until the edge of the target financial document is parallel to the edge of the preset frame to obtain the financial document image to be identified.
5. The financial voucher image recognition method according to claim 1, characterized in that: The step of preprocessing the financial voucher image to be identified and determining the text area includes: Performing image binarization processing on the financial voucher image to be identified to obtain a binary financial voucher image; Edge detection is performed on the binary financial voucher image to determine the text area.
6. The financial voucher image recognition method according to claim 1, characterized in that: Before the step of inputting the first credential type into the algorithm matching model for matching and determining the corresponding image segmentation algorithm, the method further includes: pre-acquire a plurality of second credential types; An image segmentation algorithm is constructed according to any of the second credential types, and an algorithm matching model is established according to all the second credential types and the corresponding image segmentation algorithms.
7. The financial voucher image recognition method according to claim 1, characterized in that: The step of inputting the first text information into a preset character library for comparison and determining the second text information comprises: Extracting all first text information from the first text information; Compare any of the first text information with all the second texts in the preset text library one by one to obtain the second text information with the highest similarity to the first text information; The second text information is obtained according to all the second text information.
8. The financial voucher image recognition method according to claim 1, characterized in that: According to the text area, the image segmentation algorithm is used to perform image segmentation processing on the image of the financial voucher to be identified, and the step of obtaining the segmented image includes: According to the text area, locating the position coordinates of the text area in the financial voucher image to be identified; According to the position coordinates, the image segmentation algorithm is used to perform image segmentation processing on the financial voucher image to be identified, so as to obtain a segmented image containing the text area.
9. A financial voucher image recognition system, characterized in that: include: A scanning module, used for scanning a target financial voucher to obtain an image of the financial voucher to be identified; A text area determination module, used for preprocessing the financial voucher image to be identified and determining the text area; An algorithm matching module, used for obtaining a first voucher type of the target financial voucher, inputting the first voucher type into an algorithm matching model for matching, and determining a corresponding image segmentation algorithm; An image segmentation processing module, used for performing image segmentation processing on the image of the financial voucher to be identified according to the text area using the image segmentation algorithm to obtain a segmented image, wherein the segmented image contains the text area; A first text information extraction module, used for performing projection calculation on the segmented image to extract first text information in the text area; A second text information determination module, configured to input the first text information into a preset text library for comparison, and determine the second text information; A data saving module, used for saving the second text information and the image of the financial voucher to be identified into a database; The database query module is used to obtain the query parameters when responding to the user query request, and match the query parameters in the database to obtain the second text information matching the query parameters, and obtain the corresponding financial voucher image to be identified based on the second text information.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
