A payment bill management method, device, equipment and storage medium
By performing image recognition and correction angle processing on the payment bill image, the difficulty of identification caused by the inclination angle of the payment bill in offline collection business is solved, and the work efficiency of financial personnel is improved.
Patent Information
- Application Number
- CN202111307002.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-11-05
AI Technical Summary
In the existing offline collection business, the tilt angle of payment of bills increases the difficulty of identifying financial personnel, spending a lot of time to review, and reducing work efficiency.
By entering the payment bill image into the image recognition model, Hough transforms and corrects the angle calculation, adjusts the area to be identified to be corrected, reducing the workload of financial personnel and improving verification efficiency.
It effectively reduces the workload of financial personnel, improves the efficiency of financial verification and login, and simplifies the process of identifying bills.
Smart Images

Figure CN114120323B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial management, and in particular, to a management method, device, equipment and storage medium for payment bills. Background Art
[0002] Offline acquiring business refers to the non-cash payment collection and settlement services provided by acquiring institutions to offline merchants after consumers complete payment through POS machines by swiping cards or scanning codes. In the existing offline acquiring business, merchants need to provide payment bills such as WeChat, Alipay, and bank transfer to acquiring institutions. The payment bills can be taken pictures or screenshots.
[0003] The payment bill contains content to be identified that needs to be confirmed by the financial staff, such as the payment amount, company name, transaction time, and order number. When the payment bill is a photograph, the payment bill may be tilted due to different shooting angles. Due to the tilt of the payment bill, it may increase the difficulty for the financial staff to identify the content to be identified in the payment bill. When the financial staff subsequently check the payment bill, it may take a lot of time to review it, which increases the workload and reduces work efficiency.
[0004] Therefore, there is an urgent need for a bill payment management method that can reduce the workload of financial personnel and improve their work efficiency. Summary of the invention
[0005] The purpose of the embodiments of this document is to provide a payment bill management method, device, equipment and storage medium to reduce the workload of financial personnel and improve their work efficiency.
[0006] To achieve the above objectives, on the one hand, an embodiment of this invention provides a method for managing payment bills, including:
[0007] Input the payment bill image into the image recognition model to obtain the to-be-recognized area corresponding to the payment bill, wherein the to-be-recognized area includes the to-be-recognized field in the payment bill;
[0008] After preprocessing the area to be recognized, Hough transform is performed to obtain the straight line segments of the characters in the field to be recognized in the area to be recognized;
[0009] Calculating a correction angle according to the angle between the straight line segment and the horizontal direction;
[0010] The area to be identified is adjusted according to the correction angle to obtain an area to be identified with a correct shape.
[0011] Preferably, the step of performing Hough transform on the area to be identified after preprocessing to obtain the straight line segments of the characters in the field to be identified in the area to be identified further comprises:
[0012] The fields to be identified in the identification area are sequentially subjected to grayscale processing, denoising processing, differential calculation and binarization processing;
[0013] Dividing the area to be recognized into a plurality of sub-areas according to the characters of the field to be recognized, wherein each sub-area contains a complete character;
[0014] Perform Hough transform on each sub-region to obtain a straight line segment corresponding to the character in the sub-region.
[0015] Preferably, dividing the area to be identified into a plurality of sub-areas according to the characters of the field to be identified further comprises:
[0016] Obtaining vertical blank intervals in the area to be identified, and averaging the widths of all vertical blank intervals;
[0017] Traversing all vertical blank intervals in the area to be identified, if the width of the vertical blank interval is greater than or equal to the average value, dividing the area adjacent to the corresponding vertical blank interval into different sub-areas;
[0018] If the width of the vertical blank space is smaller than the average value, the area adjacent to the corresponding vertical blank space is divided into a sub-area.
[0019] Preferably, the step of calculating the correction angle according to the angle between the straight line segment and the horizontal direction further comprises:
[0020] Calculate the average of the angles between all straight line segments and the horizontal direction in each sub-region to obtain the straight line segment angle of the corresponding sub-region;
[0021] According to the angle of the straight line segment of the corresponding sub-region, the initial correction angle of the corresponding sub-region is calculated;
[0022] The initial correction angle of each sub-region is corrected to obtain the correction angle of the corresponding sub-region.
[0023] Preferably, the step of correcting the initial correction angle of each sub-region to obtain the correction angle of the corresponding sub-region further comprises:
[0024] According to the initial correction angle of each sub-area, the average value of the initial correction angles of all sub-areas is calculated;
[0025] The absolute value corresponding to the average value of the initial correction angles is used as the correction angle of each sub-area.
[0026] Preferably, adjusting the area to be identified according to the correction angle further comprises:
[0027] According to the correction angle of each sub-region, the original height and the original width of the corresponding sub-region, the correction width of the corresponding sub-region is calculated;
[0028] determining a set height as a correction height for each sub-area;
[0029] The corresponding sub-area is adjusted according to the correction width and the correction height.
[0030] Preferably, the step of calculating the corrected width of each sub-region according to the corrected angle of each sub-region and the original height and original width of the corresponding sub-region further comprises:
[0031] The correction width of the corresponding sub-area is calculated by the following formula:
[0032] newWidth=width×cosD+height×cos(90°-D);
[0033] Among them, newWidth is the corrected width of the corresponding sub-region, width is the original width of the corresponding sub-region, height is the original height of the corresponding sub-region, and D is the correction angle of the corresponding sub-region.
[0034] On the other hand, an embodiment of the present invention provides a payment bill management device, the device comprising:
[0035] The module for determining the area to be identified is used to input the payment bill image into the image recognition model to obtain the area to be identified corresponding to the payment bill, wherein the area to be identified includes the field to be identified in the payment bill;
[0036] Straight line segment determination module: After preprocessing the area to be identified, Hough transform is performed to obtain the straight line segments of the characters in the field to be identified in the area to be identified;
[0037] Correction angle determination module: calculates the correction angle according to the angle between the straight line segment and the horizontal direction;
[0038] Adjustment module: adjusts the area to be identified according to the correction angle to obtain an area to be identified with a correct shape.
[0039] On the other hand, the embodiments of the present invention further provide a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of any one of the above methods are executed.
[0040] On the other hand, the embodiments of the present invention further provide a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions according to any one of the methods described above.
[0041] It can be seen from the technical solution provided in the above embodiments of this article that after the embodiments of this article perform tilt correction on the extracted area to be identified, a morphologically correct area to be identified can be obtained, that is, there is no tilt in the area to be identified, and subsequent identification is convenient, thereby reducing the workload of financial personnel and improving the efficiency of financial personnel in financial verification and login.
[0042] In order to make the above and other purposes, features and advantages of this article more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of this article or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of this article. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A schematic diagram of a process of managing a payment bill provided in an embodiment of this invention is shown;
[0045] Figure 2 A schematic flow chart of a method for determining a straight line segment of a character provided in an embodiment of the present invention is shown;
[0046] Figure 3 A schematic diagram of a process for dividing sub-areas provided in an embodiment of this invention is shown;
[0047] Figure 4 A schematic diagram of a flow chart for calculating a correction angle provided in an embodiment of the present invention is shown;
[0048] Figure 5 A schematic diagram of a process for obtaining a correction angle of a sub-region provided in an embodiment of this invention is shown;
[0049] Figure 6 A schematic diagram of a process for adjusting a region to be identified provided in an embodiment of the present invention is shown;
[0050] Figure 7 A schematic diagram of the module structure of a payment bill management device provided in an embodiment of this invention is shown;
[0051] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of this invention is shown.
[0052] Description of the accompanying symbols:
[0053] 100. A module for determining an area to be identified;
[0054] 200, straight line segment determination module;
[0055] 300. Correction angle determination module;
[0056] 400, adjustment module;
[0057] 802. Computer equipment;
[0058] 804, processor;
[0059] 806. Memory;
[0060] 808, driving mechanism;
[0061] 810, input / output module;
[0062] 812. Input device;
[0063] 814. Output device;
[0064] 816. Presentation equipment;
[0065] 818. Graphical user interface;
[0066] 820, network interface;
[0067] 822, communication link;
[0068] 824. Communication bus. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of this article to clearly and completely describe the technical solutions in the embodiments of this article. Obviously, the described embodiments are only part of the embodiments of this article, not all of the embodiments. Based on the embodiments of this article, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this article.
[0070] The payment bill contains content to be identified that needs to be confirmed by the financial staff, such as the payment amount, company name, transaction time, and order number. When the payment bill is a photograph, the payment bill may be tilted due to different shooting angles. Due to the tilt of the payment bill, it may increase the difficulty for the financial staff to identify the content to be identified in the payment bill. When the financial staff subsequently check the payment bill, it may take a lot of time to review it, which increases the workload and reduces work efficiency.
[0071] In order to solve the above problems, the embodiments of this document provide a method for managing payment bills. Figure 1This is a schematic diagram of the steps of a method for managing a payment bill provided in an embodiment of this invention. This specification provides method operation steps as described in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only order of execution. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.
[0072] Reference Figure 1 , a method for managing bill payments, comprising:
[0073] S101: Inputting a payment bill image into an image recognition model to obtain a to-be-recognized area corresponding to the payment bill, wherein the to-be-recognized area includes a to-be-recognized field in the payment bill;
[0074] S102: performing Hough transform after preprocessing the area to be recognized, and obtaining straight line segments of characters in the field to be recognized in the area to be recognized;
[0075] S103: Calculating a correction angle according to the angle between the straight line segment and the horizontal direction;
[0076] S104: adjusting the region to be identified according to the correction angle to obtain a region to be identified with a correct shape.
[0077] Among them, the payment bill is the WeChat, Alipay, bank transfer and other bills obtained after the offline merchant collects or settles non-cash payments. Most payment bills are in the form of pictures. In order to adjust the tilt angle of the payment bill, the payment bill picture is first input into the image recognition model to extract the area to be recognized. The image recognition model can be composed of a Resnet-V2 image recognition model, an inception-V4 image recognition model, an inception-Resnet-V2 image recognition model and a nasnet image recognition model, or it can be one or more of any of the above image recognition models. Of course, the image recognition model can also be trained and constructed through other neural network models.
[0078] For payment bills, the key contents include payment amount, company name, transaction time and order number. These key contents are what financial personnel need to confirm when conducting financial verification and logging in the future, that is, the fields to be identified. The area where the fields to be identified are located is the area to be identified.
[0079] For any type of payment bill in WeChat, Alipay and bank transfer, it has a fixed image recognition model. For WeChat, in the WeChat payment bill, the locations of the fields such as payment amount, company name, transaction time and order number are all determined. After the payment bill picture is input into the corresponding image recognition model, the image recognition model will extract the area to be identified corresponding to the payment bill picture, and the area to be identified includes the fields to be identified (payment amount, company name, transaction time or order number), and the extracted area to be identified exists in the form of a picture. It can be concluded that there are four areas to be identified in this article, and the four areas to be identified correspond to the fields where the payment amount, company name, transaction time or order number are located. Since there is no substantial difference between the four areas to be identified, in the description of the embodiments of this article, any of the areas to be identified is described as an example.
[0080] Since the four areas to be identified are located at different positions in the payment bill, the tilt angles may be different for any two areas to be identified. Therefore, performing tilt calculation and correction for each area to be identified separately will result in higher correction accuracy and better correction effect.
[0081] After the extracted area to be identified is tilted, a correct-shaped area to be identified can be obtained, that is, the area to be identified is not tilted, which facilitates subsequent identification, thereby reducing the workload of financial personnel and improving the efficiency of financial personnel in financial verification and entry.
[0082] Reference Figure 2 In the embodiment of this article, the Hough transform is performed on the area to be recognized after preprocessing to obtain the straight line segments of the characters in the field to be recognized in the area to be recognized further includes:
[0083] S201: performing grayscale processing, denoising processing, difference calculation and binarization processing on the field to be identified in the identification area in sequence;
[0084] S202: Divide the area to be recognized into a plurality of sub-areas according to the characters of the field to be recognized, wherein each sub-area contains a complete character;
[0085] S203: Performing Hough transform on each sub-region to obtain a straight line segment corresponding to the character in the sub-region.
[0086] Specifically, when grayscale processing is performed, the average value of the three components R, G, and B of each pixel in the to-be-identified field of the to-be-identified area is calculated, and then the average value is assigned to the three components of the corresponding pixel to generate a grayscale image.
[0087] When performing denoising, traverse all the pixels of the grayscale image, take each pixel as the central pixel, calculate the grayscale average of all the pixels within the set area with the central pixel as the center, assign the grayscale average to the corresponding central pixel, and generate a denoised image. The grayscale average of the central pixel is calculated as follows: Since the values of the three components R, G, and B of any pixel in the set area are equal, it is only necessary to calculate the average of any component R, G, and B of all the pixels in the set area, and the average is the grayscale average. Assign the grayscale average to the corresponding central pixel, that is, assign the grayscale average to the three components R, G, and B of the corresponding central pixel respectively. The set area can be a 4×4 area.
[0088] When performing differential calculation, the variance value between each pixel in the denoised image and multiple adjacent pixels is calculated to obtain a differential image. Specifically, the average grayscale value of multiple pixels adjacent to the selected pixel is first calculated, and then the grayscale value of the selected pixel minus the sum of the squares of the average grayscale value is calculated and divided by the total number of pixels.
[0089] When performing binarization processing, the average grayscale value of all pixels in the differential image is calculated, and the grayscale values corresponding to the pixels whose grayscale values in the differential image are less than the average value are set to 0 (black), and the grayscale values corresponding to the pixels whose grayscale values in the differential image are greater than or equal to the average value are set to 255 (white), thereby generating a binarized image.
[0090] Furthermore, the area to be recognized may be divided into several sub-areas, each of which contains only one complete character to be recognized. Hough transform is performed on each sub-area to obtain a straight line segment corresponding to the character in the sub-area.
[0091] In order to further ensure the accuracy and correction effect of the tilt correction, the area to be recognized is divided according to characters to form sub-areas, and the tilt correction is performed on a sub-area basis.
[0092] Of course, if it is not necessary to perform tilt correction in sub-region units, the step of dividing the area to be recognized into several sub-regions can be omitted, and the area to be recognized can be directly subjected to Hough transform to obtain straight line segments corresponding to the characters in the area to be recognized.
[0093] Reference Figure 3 In the embodiment of this article, dividing the area to be identified into a plurality of sub-areas according to the characters of the field to be identified further includes:
[0094] S301: Obtain vertical blank intervals in the area to be identified, and average the widths of all vertical blank intervals;
[0095] S302: traversing all vertical blank intervals in the area to be identified, and if the width of the vertical blank interval is greater than or equal to the average value, dividing the area adjacent to the corresponding vertical blank interval into different sub-areas;
[0096] S303: If the width of the vertical blank space is smaller than the average value, dividing the area adjacent to the corresponding vertical blank space into a sub-area.
[0097] The height of the vertical blank space is greater than its width. When identifying the vertical blank space, all blank spaces are identified first, and then the blank spaces whose height is greater than their width are extracted. These blank spaces are the vertical blank spaces, and the vertical blank spaces may be in a vertical or inclined state.
[0098] Since there is a vertical blank space between every two characters, and there may also be blank spaces inside the characters themselves, for example, the circle enclosed by the upper half of the character "9" is a blank space, but the blank space is circular, and its width and height are consistent with its vertical blank space, so the blank space in the corresponding character "9" will not be obtained.
[0099] Furthermore, the vertical blank space may include the space between two characters, and may also include the space within the character itself. Generally speaking, however, the width of the space between two characters is a certain size, so it is necessary to average the widths of all vertical blank spaces, and then determine the size relationship between the width of each vertical blank space and the average value. If it is greater than or equal to the average value, it means that the vertical blank space is the space between two characters, and the vertical blank space can divide the two adjacent areas on the left and right into different sub-areas, and each sub-area contains a complete character. If it is less than the average value, it means that the vertical blank space is the space within the character itself, and the two adjacent areas on the left and right of the vertical blank space are a sub-area, and the sub-area contains a complete character.
[0100] Of course, if the tilt correction is performed directly in units of the area to be identified, the above steps S301 to S303 do not need to be performed.
[0101] Reference Figure 4 In the embodiment of this article, the calculation of the correction angle according to the angle between the straight line segment and the horizontal direction further includes:
[0102] S401: Calculate the average of the angles between all straight line segments in each sub-region and the horizontal direction to obtain the straight line segment angle of the corresponding sub-region;
[0103] S402: Calculate an initial correction angle of the corresponding sub-region according to the straight line segment angle of the corresponding sub-region;
[0104] S403: Correcting the initial correction angle of each sub-region to obtain a correction angle of the corresponding sub-region.
[0105] In steps S401 to S403, a sub-region is used as the basic unit of calculation. If a region to be identified is used as the basic unit of calculation, the sub-region in the above steps S401 to S403 can be replaced by the region to be identified. Regardless of whether it is a sub-region or a region to be identified, the calculation method between the two is consistent.
[0106] Reference Figure 5 Furthermore, the correction of the initial correction angle of each sub-region to obtain the correction angle of the corresponding sub-region further includes:
[0107] S501: Calculating an average value of the initial correction angles of all sub-regions according to the initial correction angle of each sub-region;
[0108] S502: Taking the absolute value corresponding to the average value of the initial correction angles as the correction angle of each sub-area.
[0109] In steps S501 to S502, a sub-region is used as the basic unit for correction. If a region to be identified is used as the basic unit for correction, the sub-region in the above steps S401 to S403 can be replaced with the region to be identified. Regardless of whether it is a sub-region or a region to be identified, the correction method between the two is consistent.
[0110] The initial correction angle of each sub-region may have calculation errors. Therefore, in order to improve the accuracy of tilt correction, the absolute value of the average value of the initial correction angles of all sub-regions can be used as the correction angle of each sub-region.
[0111] Reference Figure 6 In the embodiment of this article, adjusting the area to be identified according to the correction angle further includes:
[0112] S601: Calculate the corrected width of each sub-region according to the corrected angle of each sub-region, the original height and the original width of the corresponding sub-region;
[0113] S602: Determine the set height as the correction height of each sub-area;
[0114] S603: Adjust the corresponding sub-area according to the correction width and the correction height.
[0115] Furthermore, the calculating the corrected width of the corresponding sub-region according to the corrected angle of each sub-region and the original height and original width of the corresponding sub-region further includes:
[0116] The correction width of the corresponding sub-area is calculated by the following formula:
[0117] newWidth=width×cosD+height×cos(90°-D);
[0118] Among them, newWidth is the corrected width of the corresponding sub-region, width is the original width of the corresponding sub-region, height is the original height of the corresponding sub-region, and D is the correction angle of the corresponding sub-region.
[0119] In steps S501 to S502, a sub-region is used as the basic unit of adjustment. If a region to be identified is used as the basic unit of adjustment, the sub-region in the above steps S401 to S403 can be replaced with the region to be identified. Regardless of whether it is a sub-region or a region to be identified, the adjustment method between the two is consistent.
[0120] The original height of the sub-area is the height before the tilt correction, and the original width is the width before the tilt correction. The set height can be set according to the actual situation of the sub-area. In principle, the set height should be greater than or equal to the original height.
[0121] When performing tilt correction, only the width of the sub-area needs to be corrected, and the height of the sub-area is determined to be a pre-set height, without the need to perform calculations and corrections in both the width and height directions. Such steps, on the one hand, can improve the efficiency of calculation and correction, and the calculation efficiency of only calculating one value is higher than that of calculating the correction width and the correction height. On the other hand, if correction calculations are performed in both directions, there may be certain errors in the correction calculations in both directions, which may cause the sub-area after calculation and correction to tilt or distort in the opposite direction. Only performing correction calculations in one direction can better ensure the correctness of the sub-area after correction.
[0122] After the unidentified area or sub-area of the payment bill is corrected, the corrected image can be identified through text recognition technology, and the text in the image can be extracted to form editable text. These editable texts can be reviewed and modified by the acquiring personnel. After review and modification, the acquiring personnel will save them in the background server and display them in the form of pictures to the financial personnel for review.
[0123] When showing the financial staff in the form of a picture, this part of the picture can be shown to the financial staff at the same time as the payment bill, and the picture floats above the corresponding area to be identified in the payment bill. For example, if the picture content is the payment amount after tilt correction, the picture is located above the location of the payment amount in the payment bill and does not cover the payment amount in the payment bill. This makes it convenient for financial staff to check the content in the picture, and when necessary, they can also compare it with the payment amount in the payment bill. The picture can be enlarged to facilitate the identification of financial staff, and the picture can also be dragged and moved and manually zoomed in and out.
[0124] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0125] Based on the above-mentioned method for managing a payment bill, an embodiment of this article also provides a management device for payment bills. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this article and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this article is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this article can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware of predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0126] Specifically, Figure 7 This is a schematic diagram of the module structure of an embodiment of a payment bill management device provided in the embodiment of this article, referring to Figure 7 As shown, a payment bill management device provided in an embodiment of the present invention includes: a to-be-identified area determination module 100, a straight line segment determination module 200, a correction angle determination module 300, and an adjustment module 400.
[0127] The module 100 for determining the area to be identified: inputting the payment bill picture into the image recognition model to obtain the area to be identified corresponding to the payment bill, wherein the area to be identified includes the field to be identified in the payment bill;
[0128] Straight line segment determination module 200: performing Hough transform on the to-be-recognized area after preprocessing, and obtaining straight line segments of characters in the to-be-recognized field of the to-be-recognized area;
[0129] Correction angle determination module 300: calculates the correction angle according to the angle between the straight line segment and the horizontal direction;
[0130] Adjustment module 400: adjusts the to-be-recognized area according to the correction angle to obtain a to-be-recognized area with a correct shape.
[0131] Reference Figure 8 As shown, based on the above-mentioned method for managing a payment bill, a computer device 802 is also provided in one embodiment of the present invention, wherein the above-mentioned method is run on the computer device 802. The computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs) or graphics processing units (GPUs), and each processing unit may implement one or more hardware threads. The computer device 802 may also include any memory 806, which is used to store any kind of information such as code, settings, data, etc. In a specific embodiment, a computer program on the memory 806 and executable on the processor 804, when the computer program is executed by the processor 804, can execute instructions according to the above-mentioned method. Non-limitingly, for example, the memory 806 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 802. In one embodiment, when the processor 804 executes the associated instructions stored in any memory or combination of memories, the computer device 802 can perform any operation of the associated instructions. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0132] The computer device 802 may also include an input / output module 810 (I / O) for receiving various inputs (via input devices 812) and for providing various outputs (via output devices 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, the input / output module 810 (I / O), input device 812, and output device 814 may not be included, and the computer device 802 may be used as a computer device in a network. The computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.
[0133] The communication link 822 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0134] Corresponds to Figure 1-Figure 6 The method in this article also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0135] The embodiment of the present invention also provides a computer readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 6 The method shown.
[0136] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0137] It should also be understood that in the embodiments of this article, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0138] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0140] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.
[0142] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or 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 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 method described in each embodiment of this article. 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 and other media that can store program codes.
[0144] Specific embodiments are used in this article to illustrate the principles and implementation methods of this article. The description of the above embodiments is only used to help understand the methods and core ideas of this article. At the same time, for general technicians in this field, according to the ideas of this article, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on this article.
Claims
1. A method for managing payment bills, characterized in that: include: Input the payment bill image into the image recognition model to obtain the to-be-recognized area corresponding to the payment bill, wherein the to-be-recognized area includes the to-be-recognized field in the payment bill; The fields to be identified in the identification area are sequentially subjected to grayscale processing, denoising processing, differential calculation and binarization processing; Dividing the area to be recognized into a plurality of sub-areas according to the characters of the field to be recognized, wherein each sub-area contains a complete character; Performing Hough transform on each sub-region to obtain a straight line segment corresponding to the character in the sub-region; Calculate the average of the angles between all straight line segments and the horizontal direction in each sub-region to obtain the straight line segment angle of the corresponding sub-region; According to the angle of the straight line segment of the corresponding sub-region, the initial correction angle of the corresponding sub-region is calculated; According to the initial correction angle of each sub-area, the average value of the initial correction angles of all sub-areas is calculated; The absolute value corresponding to the average value of the initial correction angles is used as the correction angle of each sub-area; According to the correction angle of each sub-region, the original height and the original width of the corresponding sub-region, the correction width of the corresponding sub-region is calculated; determining a set height as a correction height for each sub-area; adjusting the corresponding sub-area according to the correction width and the correction height; The correction width of the corresponding sub-area is calculated by the following formula: ; in, newWidth is the corrected width of the corresponding sub-region, width is the original width of the corresponding sub-region, height is the original height of the corresponding sub-region, D is the correction angle of the corresponding sub-area.
2. The method for managing payment bills according to claim 1, characterized in that: The step of dividing the area to be identified into a plurality of sub-areas according to the characters of the field to be identified further comprises: Obtaining vertical blank intervals in the area to be identified, and averaging the widths of all vertical blank intervals; Traversing all vertical blank intervals in the area to be identified, if the width of the vertical blank interval is greater than or equal to the average value, dividing the area adjacent to the corresponding vertical blank interval into different sub-areas; If the width of the vertical blank space is smaller than the average value, the area adjacent to the corresponding vertical blank space is divided into a sub-area.
3. A payment bill management device, characterized in that: The device comprises: The module for determining the area to be identified is used to input the payment bill image into the image recognition model to obtain the area to be identified corresponding to the payment bill, wherein the area to be identified includes the field to be identified in the payment bill; Straight line segment determination module: grayscale processing, denoising processing, differential calculation and binarization processing are performed on the to-be-recognized field in the to-be-recognized area in sequence; the to-be-recognized area is divided into several sub-areas according to the characters of the to-be-recognized field, wherein each sub-area contains a complete character; Hough transform is performed on each sub-area to obtain the straight line segment of the character corresponding to the sub-area; Correction angle determination module: calculate the average value of the angles between all straight line segments and the horizontal direction in each sub-region to obtain the straight line segment angle of the corresponding sub-region; calculate the initial correction angle of the corresponding sub-region according to the straight line segment angle of the corresponding sub-region; calculate the average value of the initial correction angles of all sub-regions according to the initial correction angle of each sub-region; and use the absolute value corresponding to the average value of the initial correction angle as the correction angle of each sub-region; Adjustment module: calculate the correction width of the corresponding sub-region according to the correction angle of each sub-region, the original height and the original width of the corresponding sub-region; determine the set height as the correction height of each sub-region; adjust the corresponding sub-region according to the correction width and the correction height; The correction width of the corresponding sub-area is calculated by the following formula: ; in, newWidth is the corrected width of the corresponding sub-region, width is the original width of the corresponding sub-region, height is the original height of the corresponding sub-region, D is the correction angle of the corresponding sub-area.
4. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1-2.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes the instructions of the method according to any one of claims 1-2.
Citation Information
Patent Citations
Format automatic analysis and judgment method based on document image
CN107798355A
Text image correction method and device, storage medium and equipment
CN108681729A
Text image rotation correction method and system
CN109993161A
Digital meter image recognition method and device, electronic device and storage medium
CN110443220A
Character image correction method and device, storage medium and electronic equipment
CN111832558A
