Invoice recognition method and system based on image segmentation
Through image acquisition components' tilt angle and sensitivity adjustment, as well as data training frequency adjustment, combined with image segmentation technology, the problem of invoice recognition accuracy under the influence of light source intensity is solved, and the efficiency and effectiveness of invoice recognition are improved.
Patent Information
- Application Number
- CN202311171722.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-09-11
AI Technical Summary
In the prior art, excessive light intensity of the light source causes the accuracy of invoice identification to decrease, making it difficult to effectively identify invoice information.
Through the image acquisition component's tilt angle adjustment, sensitivity adjustment and data training frequency adjustment, combined with image segmentation technology, the clarity and information integrity of the invoice image are improved, and effective identification of invoices is achieved.
It improves the efficiency and effectiveness of invoice recognition, reduces the impact of light intensity on the recognition results, enhances the sensitivity of the image acquisition component and the frequency of the data training system, and thus improves the identification accuracy of invoice information.
Smart Images

Figure CN117252886B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of invoice information recognition, and in particular to an invoice recognition method and system based on image segmentation. Background Art
[0002] With the development of science and technology, commercial invoices are mainly machine-printed at present. The traditional invoice statistics work is to proofread and review each invoice manually, which is not only inefficient but also affected by human factors. In the existing technology, computers are used to identify invoice numbers and invoice codes, and optical character recognition is used to obtain character recognition information of the target area, which greatly reduces the tasks of invoice statistics and review.
[0003] Chinese Patent Publication No.: CN114694162A discloses an invoice image recognition method and system based on image processing, including: obtaining a difference image containing only machine-printed content; according to the gradient histogram of edge pixel points in the difference image; selecting an edge pixel point in a preset gradient direction as a corner point, and simultaneously screening to obtain the first corner point; obtaining a character area, the character area being the minimum circumscribed rectangle of a complete machine-printed character string; using the structural parameters between the first corner points to screen the first corner points around each character in all character areas to obtain the structural corner points of all characters in the character area; according to the coordinates of the structural corner points belonging to each character in the character area, the characters are segmented and recognized. It can be seen that the invoice image recognition method and system based on image processing have the following problems: the accuracy of invoice recognition is reduced due to the excessive light intensity of the light source. Summary of the invention
[0004] To this end, the present invention provides an invoice recognition method and system based on image segmentation, so as to overcome the problem in the prior art that the accuracy of invoice recognition is reduced due to the excessive illumination intensity of the light source.
[0005] To achieve the above-mentioned purpose, the present invention provides an invoice recognition method based on image segmentation, comprising: step S1, using an image acquisition component to acquire an invoice image, and a central control module converting the invoice image into a black and white invoice image; step S2, the central control module controls a grayscale scanning component connected to the image acquisition component to detect the grayscale value of the invoice image and calculate the grayscale value difference between the invoice image and the standard image to determine the validity of the acquired invoice image; step S3, when it is determined that the validity of image acquisition is lower than an allowable range, the central control module adjusts the inclination angle of the image acquisition component to a corresponding angle, or, according to the noise area ratio of the invoice image, performs a secondary determination on the clarity of the invoice image; step S4, after the secondary determination that the clarity of the invoice image is lower than the allowable range, the central control module adjusts the sensitivity of the image acquisition component to a corresponding value, or, according to the edge missing area of the invoice image, adjusts the training frequency of the data training system to a corresponding frequency; step S5, when the adjustment of the training frequency of the data training system is completed, the central control module adjusts the single block segmentation area of the invoice image to a corresponding area according to the extraction time of the invoice image information.
[0006] Furthermore, the central control module determines whether the validity of image acquisition is within the allowable range according to the difference in grayscale values between the invoice image and the standard image using three determination methods, wherein:
[0007] The first determination method is that the central control module determines that the validity of image acquisition is within an allowable range under a preset first difference amount condition;
[0008] The second determination method is that the central control module determines that the validity of image acquisition is lower than the allowable range under the preset second difference amount condition, and adjusts the tilt angle of the image acquisition component to the corresponding angle by calculating the difference between the gray value difference amount between the invoice image and the standard image and the preset first difference amount;
[0009] The third determination method is that the central control module determines that the validity of image acquisition is lower than the allowable range under the preset third difference amount condition, preliminarily determines that the clarity of the invoice image is lower than the allowable range, and performs a secondary determination on whether the clarity of the invoice image is lower than the allowable range based on the noise area ratio of the invoice image;
[0010] Among them, the preset first difference amount condition is that the grayscale value difference between the invoice image and the standard image is less than or equal to the preset first difference amount; the preset second difference amount condition is that the grayscale value difference between the invoice image and the standard image is greater than the preset first difference amount and less than or equal to the preset second difference amount; the preset third difference amount condition is that the grayscale value difference between the invoice image and the standard image is greater than the preset second difference amount, and the preset first difference amount is less than the preset second difference amount.
[0011] Furthermore, the central control module determines two adjustment methods for the tilt angle of the image acquisition component according to the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference under the preset second difference condition, wherein:
[0012] The first angle adjustment method is that the central control module uses a preset first angle adjustment coefficient to adjust the tilt angle of the image acquisition component to a first angle under a preset first difference value condition;
[0013] The second angle adjustment method is that the central control module uses a preset second angle adjustment coefficient to adjust the tilt angle of the image acquisition component to a second angle under a preset second difference value condition;
[0014] Among them, the preset first difference difference condition is that the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is less than or equal to the preset difference difference; the preset second difference difference condition is that the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is greater than the preset difference difference; the preset first angle adjustment coefficient is less than the preset second angle adjustment coefficient.
[0015] Furthermore, the central control module determines whether the clarity of the invoice image is within the allowable range according to the noise area ratio of the invoice image under the preset third difference amount condition using three secondary determination methods, wherein:
[0016] The first secondary determination method is that the central control module determines that the clarity of the invoice image is within an allowable range under a preset first area ratio condition;
[0017] The second secondary determination method is that the central control module determines that the clarity of the invoice image is lower than the allowable range under the preset second area ratio condition, and adjusts the sensitivity of the image acquisition component to the corresponding value by calculating the difference between the noise area ratio of the invoice image and the preset first area ratio;
[0018] The third secondary determination method is that the central control module determines that the clarity of the invoice image is lower than the allowable range under the preset third area condition, preliminarily determines that the integrity of the invoice information is lower than the allowable range, and performs a secondary determination on the integrity of the invoice information based on the missing area of the edge of the invoice image;
[0019] Among them, the preset first area ratio condition is that the noise area ratio of the invoice image is less than or equal to the preset first area ratio; the preset second area ratio condition is that the noise area ratio of the invoice image is greater than the preset first area ratio and less than or equal to the preset second area ratio; the preset third area ratio condition is that the noise area ratio of the invoice image is greater than the preset second area ratio, and the preset first area ratio is less than the preset second area ratio.
[0020] Furthermore, the central control module determines two adjustment methods for the sensitivity of the image acquisition component according to the difference between the noise area ratio of the invoice image and the preset first area ratio under the preset second area ratio condition, wherein:
[0021] The first sensitivity adjustment method is that the central control module uses a preset first sensitivity adjustment coefficient to adjust the sensitivity of the image acquisition component to a first value under a preset first area ratio difference condition;
[0022] The second sensitivity adjustment method is that the central control module uses a preset second sensitivity adjustment coefficient to adjust the sensitivity of the image acquisition component to a second value under a preset second area ratio difference condition;
[0023] Among them, the preset first area ratio difference condition is that the difference between the noise area ratio of the invoice image and the preset first area ratio is less than or equal to the preset area ratio difference; the preset second area ratio difference condition is that the difference between the noise area ratio of the invoice image and the preset first area ratio is greater than the preset area ratio difference, and the preset first sensitivity adjustment coefficient is less than the preset second sensitivity adjustment coefficient.
[0024] Furthermore, the central control module uses two secondary determination methods to determine whether the integrity of the invoice information is within an allowable range according to the missing area of the invoice image edge under a preset third area condition, wherein:
[0025] The first secondary integrity determination method is that the central control module determines that the integrity of the invoice information is within an allowable range under a preset first area condition;
[0026] The second secondary integrity determination method is that the central control module determines that the integrity of the invoice information is lower than the allowable range under the preset second area condition, and adjusts the training frequency of the data training system to the corresponding frequency by calculating the difference between the missing area of the invoice image edge and the preset area;
[0027] The preset first area condition is that the missing area of the edge of the invoice image is less than or equal to the preset area; the preset second area condition is that the missing area of the edge of the invoice image is greater than the preset area.
[0028] Furthermore, the central control module determines two adjustment methods for the training frequency of the data training system according to the difference between the edge missing area of the invoice image and the preset area under the preset second area condition, wherein:
[0029] The first frequency adjustment method is that the central control module adjusts the training frequency to the first frequency using a preset first frequency adjustment coefficient under a preset first area difference condition;
[0030] The second frequency adjustment method is that the central control module adjusts the training frequency to the second frequency using a preset second frequency adjustment coefficient under a preset second area difference condition;
[0031] Among them, the preset first area difference condition is that the difference between the missing area of the edge of the invoice image and the preset area is less than or equal to the preset area difference; the preset second area difference condition is that the difference between the missing area of the edge of the invoice image and the preset area is greater than the preset area difference, and the preset first frequency adjustment coefficient is less than the preset second frequency adjustment coefficient.
[0032] Furthermore, the central control module determines whether the image segmentation validity is within the allowable range according to the extraction time of the invoice image information in two determination methods, wherein:
[0033] The first validity determination method is that the central control module determines that the validity of the image segmentation is within an allowable range under a preset first time condition;
[0034] The second validity determination method is that the central control module determines that the image segmentation validity is lower than the allowable range under the preset second time condition, and adjusts the single block segmentation area of the invoice image to the corresponding area by calculating the difference between the extraction time of the invoice image information and the preset time;
[0035] The preset first time condition is that the time for extracting the invoice image information is less than or equal to the preset time; the preset second time condition is that the time for extracting the invoice image information is greater than the preset time.
[0036] Furthermore, the central control module determines two adjustment methods for the single block segmentation area of the invoice image according to the difference between the extraction time of the invoice image information and the preset time under the preset second time condition, wherein:
[0037] The first segmentation area adjustment method is that the central control module uses a preset second area adjustment coefficient to adjust the single segmentation area of the invoice image to the first area under a preset first time difference condition;
[0038] The second segmentation area adjustment method is that the central control module uses a preset first area adjustment coefficient to adjust the single segmentation area of the invoice image to a second area under a preset second time difference condition;
[0039] Among them, the preset first time difference condition is that the difference between the extraction time of the invoice image information and the preset time is less than or equal to the preset time difference; the preset second time difference condition is that the difference between the extraction time of the invoice image information and the preset time is greater than the preset time difference, and the preset first area adjustment coefficient is less than the preset second area adjustment coefficient.
[0040] The present invention also provides an invoice recognition system based on the invoice recognition method of image segmentation, comprising:
[0041] An information acquisition module, used to acquire primary invoice feature data and invoice information, wherein the invoice information includes the invoice image acquired by the image acquisition component; the primary invoice feature data includes the grayscale value of the invoice image acquired by the grayscale scanning component, the noise area of the invoice image, the overall area of the invoice image, and the edge missing area of the invoice image;
[0042] A data processing module connected to the data acquisition module, used to calculate the primary invoice feature data to output secondary invoice feature parameters, wherein the secondary invoice feature parameters include the gray value difference between the invoice image and the standard image, the noise area ratio of the invoice image, and the extraction time of the invoice image information;
[0043] The central control module is connected to the data acquisition module and the data processing module respectively, and is used to adjust the inclination angle of the image acquisition component to a corresponding angle when the validity of the image acquisition is determined to be lower than the allowable range according to the difference in grayscale values between the invoice image and the standard image, or to adjust the sensitivity of the image acquisition component to a corresponding value according to the proportion of the noise area of the invoice image.
[0044] and, adjusting the training frequency of the data training system to a corresponding frequency according to the missing area of the edge of the invoice image;
[0045] And, the single-block segmentation area of the invoice image is adjusted to a corresponding area according to the difference between the extraction time of the invoice image information and the preset time.
[0046] Compared with the prior art, the beneficial effect of the present invention lies in that, by setting steps S1-S5, the central control module acquires the invoice image and performs image segmentation and recognition on the invoice image to achieve effective recognition of the invoice. After acquiring the difference between the grayscale value of the invoice image and the standard image, the central control module determines the validity of image acquisition, and reduces the influence of the illumination angle problem on the validity of image acquisition by adjusting the inclination angle of the image acquisition component. Adjusting the inclination angle of the image acquisition component helps to reduce the grayscale value of the invoice image. After acquiring the noise area ratio of the invoice image, the clarity of the invoice image is secondary determined, and the sensitivity of the image acquisition component is adjusted according to the noise area ratio of the invoice image. The clarity of the picture is improved by increasing the sensitivity of the image acquisition component of the recognition system, or the integrity of the acquired image invoice information is determined according to the edge missing area of the invoice image and the training frequency is adjusted. The edge missing area of the invoice image is reduced and the completeness of the information is improved by increasing the training frequency, thereby improving the recognition efficiency and the effectiveness of the invoice.
[0047] Furthermore, the method of the present invention sets a preset first difference condition, a preset second difference condition and a preset third difference condition, and the central control module determines the effectiveness of image acquisition. The difference in grayscale value between the invoice image and the standard image reflects the influence of light on the invoice image acquisition. By setting a preset first difference condition, a preset second difference condition, a preset first angle adjustment coefficient and a preset second angle adjustment coefficient, the central control module adjusts the inclination angle of the image acquisition component. By adjusting the inclination angle, the influence of light intensity on the invoice image acquisition is effectively avoided, thereby further improving the recognition efficiency and effectiveness of the invoice.
[0048] Furthermore, the method of the present invention sets a preset first area condition, a preset second area condition and a preset third area condition, and the central control module performs a secondary determination on the clarity of the invoice image according to the noise area ratio of the invoice image, and adjusts the sensitivity of the image acquisition component by setting a preset first area difference condition, a preset second area difference condition, a preset first sensitivity adjustment coefficient and a preset second sensitivity adjustment coefficient, so as to increase the smoothness of the picture and thereby improve the clarity of the invoice image by increasing the sensitivity of the image acquisition component, thereby further improving the recognition efficiency and effectiveness of the invoice.
[0049] Furthermore, the method of the present invention sets a preset first area condition and a preset second area condition, and the central control module determines the integrity of the invoice information. After the image is segmented, the image information is missing due to image acquisition reasons, and the effectiveness of invoice recognition is reduced. By setting a preset first area difference condition, a preset second area difference condition, a preset first frequency adjustment coefficient, and a preset second frequency adjustment coefficient, the central control module adjusts the training frequency of the data training system, and increases the training frequency to improve the integrity of the image, thereby further improving the recognition efficiency and effectiveness of the invoice.
[0050] Furthermore, the method of the present invention determines the effectiveness of image segmentation by setting a preset first time condition and a preset second time condition, and by setting a preset first time difference condition, a preset second time difference condition, a preset first area adjustment coefficient, and a preset second area adjustment coefficient, the central control module adjusts the single-block segmentation area of the invoice image, thereby increasing the speed of image information analysis by reducing the single-block segmentation area of the invoice image, and further improving the recognition efficiency and effectiveness of the invoice. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is an overall flow chart of the invoice recognition method based on image segmentation according to an embodiment of the present invention;
[0052] Figure 2The overall structural block diagram of the invoice recognition system based on image segmentation according to an embodiment of the present invention;
[0053] Figure 3 It is a specific structural block diagram of the data acquisition module of the invoice recognition system based on image segmentation according to an embodiment of the present invention;
[0054] Figure 4 The present invention is a block diagram of the connection structure between the data acquisition module and the central control module of the invoice recognition system based on image segmentation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0056] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0057] See also Figure 1 , Figure 2 , Figure 3 as well as Figure 4 As shown, they are respectively an overall flow chart of an invoice recognition method based on image segmentation according to an embodiment of the present invention, an overall structural block diagram of an invoice recognition system based on image segmentation, a specific structural block diagram of a data acquisition module, and a connection structural block diagram of a data acquisition module connected to a central control module; an invoice recognition method based on image segmentation according to the present invention comprises:
[0058] Step S1, using an image acquisition component to acquire an invoice image, and the central control module converts the invoice image into a black and white invoice image;
[0059] Step S2, the central control module controls the grayscale scanning component connected to the image acquisition component to detect the grayscale value of the invoice image and calculate the grayscale value difference between the invoice image and the standard image to determine the validity of the acquired invoice image;
[0060] Step S3, when it is determined that the validity of the image acquisition is lower than the allowable range, the central control module adjusts the tilt angle of the image acquisition component to a corresponding angle, or performs a secondary determination on the clarity of the invoice image according to the noise area ratio of the invoice image;
[0061] Step S4, after secondarily determining that the clarity of the invoice image is lower than the allowable range, the central control module adjusts the sensitivity of the image acquisition component to a corresponding value, or adjusts the training frequency of the data training system to a corresponding frequency according to the missing area of the invoice image edge;
[0062] Step S5, when the training frequency of the data training system is adjusted, the central control module adjusts the single block segmentation area of the invoice image to a corresponding area according to the extraction time of the invoice image information.
[0063] Specifically, the grayscale value difference between the invoice image and the standard image is the difference between the grayscale value of the invoice image and the grayscale value of the standard invoice image.
[0064] Specifically, the image acquisition component includes a base, a support rod connected to the base for supporting the image acquisition component, a rotating shaft arranged on the support rod for adjusting the inclination angle of the image acquisition component, and a camera connected to the rotating shaft for acquiring the invoice image.
[0065] Specifically, the invoice image information includes the company name, tax identification number and company address.
[0066] The method of the present invention sets steps S1-S5, wherein the central control module acquires the invoice image and performs image segmentation and recognition on the invoice image to achieve effective recognition of the invoice. After acquiring the difference between the grayscale value of the invoice image and the standard image, the central control module determines the validity of the image acquisition, and reduces the influence of the illumination angle problem on the validity of the image acquisition by adjusting the inclination angle of the image acquisition component. Adjusting the inclination angle of the image acquisition component helps to reduce the grayscale value of the invoice image. After acquiring the noise area ratio of the invoice image, the clarity of the invoice image is secondarily determined, and the sensitivity of the image acquisition component is adjusted according to the noise area ratio of the invoice image. The clarity of the picture is improved by increasing the sensitivity of the image acquisition component of the recognition system, or the integrity of the invoice information of the acquired image is determined according to the missing area of the invoice image edge and the training frequency is adjusted. The missing area of the invoice image edge is reduced and the completeness of the information is improved by increasing the training frequency, thereby improving the recognition efficiency and the effectiveness of the invoice.
[0067] Please continue reading Figure 1 As shown, the central control module determines whether the validity of image acquisition is within the allowable range according to the difference in grayscale values between the invoice image and the standard image using three determination methods, wherein:
[0068] The first determination method is that the central control module determines that the validity of image acquisition is within an allowable range under a preset first difference amount condition;
[0069] The second determination method is that the central control module determines that the validity of image acquisition is lower than the allowable range under the preset second difference amount condition, and adjusts the tilt angle of the image acquisition component to the corresponding angle by calculating the difference between the gray value difference amount between the invoice image and the standard image and the preset first difference amount;
[0070] The third determination method is that the central control module determines that the validity of image acquisition is lower than the allowable range under the preset third difference amount condition, preliminarily determines that the clarity of the invoice image is lower than the allowable range, and performs a secondary determination on whether the clarity of the invoice image is lower than the allowable range based on the noise area ratio of the invoice image;
[0071] Among them, the preset first difference amount condition is that the grayscale value difference between the invoice image and the standard image is less than or equal to the preset first difference amount; the preset second difference amount condition is that the grayscale value difference between the invoice image and the standard image is greater than the preset first difference amount and less than or equal to the preset second difference amount; the preset third difference amount condition is that the grayscale value difference between the invoice image and the standard image is greater than the preset second difference amount, and the preset first difference amount is less than the preset second difference amount.
[0072] Specifically, the grayscale value difference between the invoice image and the standard image is recorded as P, the preset first difference is recorded as P1, the preset second difference is recorded as P2, and the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is recorded as △P, and △P=P-P1 is set.
[0073] Please continue reading Figure 1 As shown, the central control module determines two adjustment methods for the tilt angle of the image acquisition component according to the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference under the preset second difference condition, wherein:
[0074] The first angle adjustment method is that the central control module uses a preset first angle adjustment coefficient to adjust the tilt angle of the image acquisition component to a first angle under a preset first difference value condition;
[0075] The second angle adjustment method is that the central control module uses a preset second angle adjustment coefficient to adjust the tilt angle of the image acquisition component to a second angle under a preset second difference value condition;
[0076] Among them, the preset first difference difference condition is that the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is less than or equal to the preset difference difference; the preset second difference difference condition is that the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is greater than the preset difference difference; the preset first angle adjustment coefficient is less than the preset second angle adjustment coefficient.
[0077] Specifically, the preset difference value is recorded as △P0, the preset first angle adjustment coefficient is recorded as α1, and the preset second angle adjustment coefficient is recorded as α2, wherein 1<α1<α2, the inclination angle of the image acquisition component is recorded as A, and the inclination angle of the image acquisition component after adjustment is recorded as A', and A'=A×αi is set, wherein αi is the preset i-th angle adjustment coefficient, i=1, 2.
[0078] The method of the present invention sets a preset first difference condition, a preset second difference condition and a preset third difference condition, and the central control module determines the effectiveness of image acquisition. The gray value difference between the invoice image and the standard image reflects the influence of light on the invoice image acquisition. By setting a preset first difference condition, a preset second difference condition, a preset first angle adjustment coefficient and a preset second angle adjustment coefficient, the central control module adjusts the inclination angle of the image acquisition component. By adjusting the inclination angle, the influence of light intensity on the invoice image acquisition is effectively avoided, thereby further improving the recognition efficiency and effectiveness of the invoice.
[0079] Please continue reading Figure 1 As shown, the central control module determines whether the clarity of the invoice image is within the allowable range according to the noise area ratio of the invoice image under the preset third difference amount condition. Among them,
[0080] The first secondary determination method is that the central control module determines that the clarity of the invoice image is within an allowable range under a preset first area ratio condition;
[0081] The second secondary determination method is that the central control module determines that the clarity of the invoice image is lower than the allowable range under the preset second area ratio condition, and adjusts the sensitivity of the image acquisition component to the corresponding value by calculating the difference between the noise area ratio of the invoice image and the preset first area ratio;
[0082] The third secondary determination method is that the central control module determines that the clarity of the invoice image is lower than the allowable range under the preset third area condition, preliminarily determines that the integrity of the invoice information is lower than the allowable range, and performs a secondary determination on the integrity of the invoice information based on the missing area of the edge of the invoice image;
[0083] Among them, the preset first area ratio condition is that the noise area ratio of the invoice image is less than or equal to the preset first area ratio; the preset second area ratio condition is that the noise area ratio of the invoice image is greater than the preset first area ratio and less than or equal to the preset second area ratio; the preset third area ratio condition is that the noise area ratio of the invoice image is greater than the preset second area ratio, and the preset first area ratio is less than the preset second area ratio.
[0084] Specifically, the noise area ratio of the invoice image is recorded as C, the preset first area is recorded as C1, the preset second area is recorded as C2, the difference between the noise area ratio of the invoice image and the preset first area is recorded as △C, and △C is set to be C-C1.
[0085] Please continue reading Figure 1 As shown, the central control module determines two adjustment methods for the sensitivity of the image acquisition component according to the difference between the noise area ratio of the invoice image and the preset first area ratio under the preset second area ratio condition, wherein:
[0086] The first sensitivity adjustment method is that the central control module uses a preset first sensitivity adjustment coefficient to adjust the sensitivity of the image acquisition component to a first value under a preset first area ratio difference condition;
[0087] The second sensitivity adjustment method is that the central control module uses a preset second sensitivity adjustment coefficient to adjust the sensitivity of the image acquisition component to a second value under a preset second area ratio difference condition;
[0088] Among them, the preset first area ratio difference condition is that the difference between the noise area ratio of the invoice image and the preset first area ratio is less than or equal to the preset area ratio difference; the preset second area ratio difference condition is that the difference between the noise area ratio of the invoice image and the preset first area ratio is greater than the preset area ratio difference, and the preset first sensitivity adjustment coefficient is less than the preset second sensitivity adjustment coefficient.
[0089] Specifically, the preset area difference is recorded as △C0, the preset first sensitivity adjustment coefficient is recorded as β1, and the preset second sensitivity adjustment coefficient is recorded as β2, wherein 0<β1<β2<1, the sensitivity of the image acquisition component is recorded as R, and the sensitivity of the adjusted image acquisition component is recorded as R', and R'=R×(1-βj), wherein βj is the preset j-th sensitivity adjustment coefficient, j=1,2.
[0090] The method of the present invention sets a preset first area condition, a preset second area condition and a preset third area condition. The central control module performs a secondary determination on the clarity of the invoice image according to the noise area ratio of the invoice image. The central control module adjusts the sensitivity of the image acquisition component by setting a preset first area difference condition, a preset second area difference condition, a preset first sensitivity adjustment coefficient and a preset second sensitivity adjustment coefficient. By increasing the sensitivity of the image acquisition component, the smoothness of the picture is increased, thereby improving the clarity of the invoice image, and further improving the recognition efficiency and effectiveness of the invoice.
[0091] Please continue reading Figure 1As shown, the central control module determines whether the integrity of the invoice information is within the allowable range according to the missing area of the edge of the invoice image under the preset third area condition.
[0092] The first secondary integrity determination method is that the central control module determines that the integrity of the invoice information is within an allowable range under a preset first area condition;
[0093] The second secondary integrity determination method is that the central control module determines that the integrity of the invoice information is lower than the allowable range under the preset second area condition, and adjusts the training frequency of the data training system to the corresponding frequency by calculating the difference between the missing area of the invoice image edge and the preset area;
[0094] The preset first area condition is that the missing area of the edge of the invoice image is less than or equal to the preset area; the preset second area condition is that the missing area of the edge of the invoice image is greater than the preset area.
[0095] Specifically, the missing area of the invoice image edge is recorded as M, the preset area is recorded as M0, the difference between the missing area of the invoice image edge and the preset area is recorded as △M, and △M=M-M0 is set.
[0096] Please continue reading Figure 1 As shown, the central control module determines two adjustment methods for the training frequency of the data training system according to the difference between the edge missing area of the invoice image and the preset area under the preset second area condition, wherein:
[0097] The first frequency adjustment method is that the central control module adjusts the training frequency to the first frequency using a preset first frequency adjustment coefficient under a preset first area difference condition;
[0098] The second frequency adjustment method is that the central control module adjusts the training frequency to the second frequency using a preset second frequency adjustment coefficient under a preset second area difference condition;
[0099] Among them, the preset first area difference condition is that the difference between the missing area of the edge of the invoice image and the preset area is less than or equal to the preset area difference; the preset second area difference condition is that the difference between the missing area of the edge of the invoice image and the preset area is greater than the preset area difference, and the preset first frequency adjustment coefficient is less than the preset second frequency adjustment coefficient.
[0100] Specifically, the preset area difference is recorded as △M0, the preset first frequency adjustment coefficient is recorded as δ1, and the preset second frequency adjustment coefficient is recorded as δ2, wherein 0<δ1<δ2<1, the training frequency is recorded as H, and the adjusted training frequency is recorded as H', and H'=H×(1+δg), δg is the preset gth frequency adjustment coefficient, g=1,2.
[0101] The method described in the present invention sets a preset first area condition and a preset second area condition, and the central control module determines the integrity of the invoice information. After the image is segmented, the image information is missing due to image acquisition reasons, and the effectiveness of invoice recognition is reduced. By setting a preset first area difference condition, a preset second area difference condition, a preset first frequency adjustment coefficient, and a preset second frequency adjustment coefficient, the central control module adjusts the training frequency of the data training system, and increases the training frequency to improve the integrity of the image, thereby further improving the recognition efficiency and effectiveness of the invoice.
[0102] Please continue reading Figure 1 As shown, the central control module determines whether the image segmentation validity is within the allowable range according to the extraction time of the invoice image information of the invoice valid information in two determination methods, wherein:
[0103] The first validity determination method is that the central control module determines that the validity of the image segmentation is within an allowable range under a preset first time condition;
[0104] The second validity determination method is that the central control module determines that the image segmentation validity is lower than the allowable range under the preset second time condition, and adjusts the single block segmentation area of the invoice image to the corresponding area by calculating the difference between the extraction time of the invoice image information and the preset time;
[0105] The preset first time condition is that the time for extracting the invoice image information is less than or equal to the preset time; the preset second time condition is that the time for extracting the invoice image information is greater than the preset time.
[0106] Specifically, the extraction time of the invoice image information of valid information is recorded as T, the preset time is recorded as T0, the difference between the extraction time of the invoice image information and the preset time is recorded as ΔT, and ΔT=T-T0 is set.
[0107] Please continue reading Figure 1 As shown, the central control module determines two adjustment methods for the single block segmentation area of the invoice image according to the difference between the extraction time of the invoice image information and the preset time under the preset second time condition, wherein:
[0108] The first segmentation area adjustment method is that the central control module uses a preset second area adjustment coefficient to adjust the single segmentation area of the invoice image to the first area under a preset first time difference condition;
[0109] The second segmentation area adjustment method is that the central control module uses a preset first area adjustment coefficient to adjust the single segmentation area of the invoice image to a second area under a preset second time difference condition;
[0110] Among them, the preset first time difference condition is that the difference between the extraction time of the invoice image information and the preset time is less than or equal to the preset time difference; the preset second time difference condition is that the difference between the extraction time of the invoice image information and the preset time is greater than the preset time difference, and the preset first area adjustment coefficient is less than the preset second area adjustment coefficient.
[0111] Specifically, the preset time difference is recorded as △T0, the preset first area adjustment coefficient is recorded as ζ1, the preset second area adjustment coefficient is recorded as ζ2, 0<ζ1<ζ2<1, the single block segmentation area of the invoice image is recorded as S, and the single block segmentation area of the adjusted invoice image is recorded as S', and S'=S×ζk is set, wherein ζk is the preset kth area adjustment coefficient, k=1,2.
[0112] The method of the present invention determines the validity of image segmentation by setting a preset first time condition and a preset second time condition, and by setting a preset first time difference condition, a preset second time difference condition, a preset first area adjustment coefficient, and a preset second area adjustment coefficient. The central control module adjusts the single-block segmentation area of the invoice image, thereby increasing the speed of image information analysis by reducing the single-block segmentation area of the invoice image, and further improving the recognition efficiency and effectiveness of the invoice.
[0113] Please continue reading Figure 2 As shown, an invoice recognition system based on image segmentation includes:
[0114] An information acquisition module, used to acquire primary invoice feature data and invoice information, wherein the invoice information includes the invoice image acquired by the image acquisition component; the primary invoice feature data includes the grayscale value of the invoice image acquired by the grayscale scanning component, the noise area of the invoice image, the overall area of the invoice image, and the edge missing area of the invoice image;
[0115] A data processing module connected to the data acquisition module, used to calculate the primary invoice feature data to output secondary invoice feature parameters, wherein the secondary invoice feature parameters include the gray value difference between the invoice image and the standard image, the noise area ratio of the invoice image, and the extraction time of the invoice image information;
[0116] The central control module is connected to the data acquisition module and the data processing module respectively, and is used to adjust the inclination angle of the image acquisition component to a corresponding angle when the validity of the image acquisition is determined to be lower than the allowable range according to the difference in grayscale values between the invoice image and the standard image, or to adjust the sensitivity of the image acquisition component to a corresponding value according to the proportion of the noise area of the invoice image.
[0117] and, adjusting the training frequency of the data training system to a corresponding frequency according to the missing area of the edge of the invoice image;
[0118] And, the single-block segmentation area of the invoice image is adjusted to a corresponding area according to the difference between the extraction time of the invoice image information and the preset time.
[0119] Example 1
[0120] In this embodiment 1, the preset area difference is recorded as △M0, the preset first frequency adjustment coefficient is recorded as δ1, the preset second frequency adjustment coefficient is recorded as δ2, and the training frequency is recorded as H, wherein △M0=3cm 2 , δ1=0.2, δ2=0.3, H=75HZ,
[0121] In this embodiment, ΔM=0.7 cm 2 The central control module determines that △M≤△M0 and uses δ1 to adjust the training frequency. The adjusted training frequency is recorded as H'=75HZ×(1+0.2)=90HZ.
[0122] In this embodiment 1, after obtaining ΔM, the central control module determines that δ1 needs to be used to adjust the training frequency. By increasing the training frequency, the degree of missing edges of the invoice image is reduced, thereby improving the recognition efficiency and effectiveness of the invoice.
[0123] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An invoice recognition method based on image segmentation, It is characterized in that include: Step S1, using an image acquisition component to acquire an invoice image, and the central control module converts the invoice image into a black and white invoice image; Step S2, the central control module controls the grayscale scanning component connected to the image acquisition component to detect the grayscale value of the invoice image and calculate the grayscale value difference between the invoice image and the standard image to determine the validity of the acquired invoice image; Step S3, when it is determined that the validity of the image acquisition is lower than the allowable range, the central control module adjusts the tilt angle of the image acquisition component to a corresponding angle, or performs a secondary determination on the clarity of the invoice image according to the noise area ratio of the invoice image; Step S4, after secondarily determining that the clarity of the invoice image is lower than the allowable range, the central control module adjusts the sensitivity of the image acquisition component to a corresponding value, or adjusts the training frequency of the data training system to a corresponding frequency according to the missing area of the invoice image edge; Step S5, when the training frequency of the data training system is adjusted, the central control module adjusts the single block segmentation area of the invoice image to the corresponding area according to the extraction time of the invoice image information; The central control module determines whether the validity of image acquisition is within the allowable range according to the difference in grayscale values between the invoice image and the standard image. The first determination method is that the central control module determines that the validity of image acquisition is within an allowable range under a preset first difference amount condition; The second determination method is that the central control module determines that the validity of image acquisition is lower than the allowable range under the preset second difference amount condition, and adjusts the tilt angle of the image acquisition component to the corresponding angle by calculating the difference between the gray value difference amount between the invoice image and the standard image and the preset first difference amount; The third determination method is that the central control module determines that the validity of image acquisition is lower than the allowable range under the preset third difference amount condition, preliminarily determines that the clarity of the invoice image is lower than the allowable range, and performs a secondary determination on whether the clarity of the invoice image is lower than the allowable range based on the noise area ratio of the invoice image; The preset first difference amount condition is that the gray value difference amount between the invoice image and the standard image is less than or equal to the preset first difference amount; the preset second difference amount condition is that the gray value difference amount between the invoice image and the standard image is greater than the preset first difference amount and less than or equal to the preset second difference amount; the preset third difference amount condition is that the gray value difference amount between the invoice image and the standard image is greater than the preset second difference amount, and the preset first difference amount is less than the preset second difference amount; The central control module determines whether the clarity of the invoice image is within the allowable range according to the noise area ratio of the invoice image under the preset third difference amount condition, wherein: The first secondary determination method is that the central control module determines that the clarity of the invoice image is within an allowable range under a preset first area ratio condition; The second secondary determination method is that the central control module determines that the clarity of the invoice image is lower than the allowable range under the preset second area ratio condition, and adjusts the sensitivity of the image acquisition component to the corresponding value by calculating the difference between the noise area ratio of the invoice image and the preset first area ratio; The third secondary determination method is that the central control module determines that the clarity of the invoice image is lower than the allowable range under the preset third area condition, preliminarily determines that the integrity of the invoice information is lower than the allowable range, and performs a secondary determination on the integrity of the invoice information based on the missing area of the edge of the invoice image; Among them, the preset first area ratio condition is that the noise area ratio of the invoice image is less than or equal to the preset first area ratio; the preset second area ratio condition is that the noise area ratio of the invoice image is greater than the preset first area ratio and less than or equal to the preset second area ratio; the preset third area ratio condition is that the noise area ratio of the invoice image is greater than the preset second area ratio, and the preset first area ratio is less than the preset second area ratio.
2. According to the invoice recognition method based on image segmentation according to claim 1, It is characterized in that The central control module determines two adjustment methods for the tilt angle of the image acquisition component according to the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference under the preset second difference condition, wherein: The first angle adjustment method is that the central control module uses a preset first angle adjustment coefficient to adjust the tilt angle of the image acquisition component to a first angle under a preset first difference value condition; The second angle adjustment method is that the central control module uses a preset second angle adjustment coefficient to adjust the tilt angle of the image acquisition component to a second angle under a preset second difference value condition; Among them, the preset first difference difference condition is that the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is less than or equal to the preset difference difference; the preset second difference difference condition is that the difference between the grayscale value difference between the invoice image and the standard image and the preset first difference is greater than the preset difference difference; the preset first angle adjustment coefficient is less than the preset second angle adjustment coefficient.
3. The invoice recognition method based on image segmentation according to claim 1, It is characterized in that The central control module determines two adjustment methods for the sensitivity of the image acquisition component according to the difference between the noise area ratio of the invoice image and the preset first area ratio under the preset second area ratio condition, wherein: The first sensitivity adjustment method is that the central control module uses a preset first sensitivity adjustment coefficient to adjust the sensitivity of the image acquisition component to a first value under a preset first area ratio difference condition; The second sensitivity adjustment method is that the central control module uses a preset second sensitivity adjustment coefficient to adjust the sensitivity of the image acquisition component to a second value under a preset second area ratio difference condition; Among them, the preset first area ratio difference condition is that the difference between the noise area ratio of the invoice image and the preset first area ratio is less than or equal to the preset area ratio difference; the preset second area ratio difference condition is that the difference between the noise area ratio of the invoice image and the preset first area ratio is greater than the preset area ratio difference, and the preset first sensitivity adjustment coefficient is less than the preset second sensitivity adjustment coefficient.
4. The invoice recognition method based on image segmentation according to claim 1, It is characterized in that The central control module determines whether the integrity of the invoice information is within the allowable range according to the missing area of the edge of the invoice image under the preset third area ratio condition. The first secondary integrity determination method is that the central control module determines that the integrity of the invoice information is within an allowable range under a preset first area condition; The second secondary integrity determination method is that the central control module determines that the integrity of the invoice information is lower than the allowable range under the preset second area condition, and adjusts the training frequency of the data training system to the corresponding frequency by calculating the difference between the missing area of the invoice image edge and the preset area; The preset first area condition is that the missing area of the edge of the invoice image is less than or equal to the preset area; the preset second area condition is that the missing area of the edge of the invoice image is greater than the preset area.
5. The invoice recognition method based on image segmentation according to claim 4, It is characterized in that The central control module determines two adjustment methods for the training frequency of the data training system according to the difference between the edge missing area of the invoice image and the preset area under the preset second area condition, wherein: The first frequency adjustment method is that the central control module adjusts the training frequency to the first frequency using a preset first frequency adjustment coefficient under a preset first area difference condition; The second frequency adjustment method is that the central control module adjusts the training frequency to the second frequency using a preset second frequency adjustment coefficient under a preset second area difference condition; Among them, the preset first area difference condition is that the difference between the missing area of the edge of the invoice image and the preset area is less than or equal to the preset area difference; the preset second area difference condition is that the difference between the missing area of the edge of the invoice image and the preset area is greater than the preset area difference, and the preset first frequency adjustment coefficient is less than the preset second frequency adjustment coefficient.
6. The invoice recognition method based on image segmentation according to claim 5, It is characterized in that The central control module determines whether the image segmentation validity is within the allowable range according to the extraction time of the invoice image information in two determination methods, wherein: The first validity determination method is that the central control module determines that the validity of the image segmentation is within an allowable range under a preset first time condition; The second validity determination method is that the central control module determines that the image segmentation validity is lower than the allowable range under the preset second time condition, and adjusts the single block segmentation area of the invoice image to the corresponding area by calculating the difference between the extraction time of the invoice image information and the preset time; The preset first time condition is that the time for extracting the invoice image information is less than or equal to the preset time; the preset second time condition is that the time for extracting the invoice image information is greater than the preset time.
7. The invoice recognition method based on image segmentation according to claim 6, It is characterized in that The central control module determines two adjustment methods for the single block segmentation area of the invoice image according to the difference between the extraction time of the invoice image information and the preset time under the preset second time condition, wherein: The first segmentation area adjustment method is that the central control module uses a preset second area adjustment coefficient to adjust the single segmentation area of the invoice image to the first area under a preset first time difference condition; The second segmentation area adjustment method is that the central control module uses a preset first area adjustment coefficient to adjust the single segmentation area of the invoice image to a second area under a preset second time difference condition; Among them, the preset first time difference condition is that the difference between the extraction time of the invoice image information and the preset time is less than or equal to the preset time difference; the preset second time difference condition is that the difference between the extraction time of the invoice image information and the preset time is greater than the preset time difference, and the preset first area adjustment coefficient is less than the preset second area adjustment coefficient.
8. An invoice recognition system using the invoice recognition method based on image segmentation according to any one of claims 1 to 7, It is characterized in that include: An information acquisition module, used to acquire primary invoice feature data and invoice information, wherein the invoice information includes the invoice image acquired by the image acquisition component; The first-level feature data of the invoice includes the grayscale value of the invoice image acquired by the grayscale scanning component, the noise area of the invoice image, the overall area of the invoice image, and the edge missing area of the invoice image; A data processing module connected to the information acquisition module, used to calculate the primary invoice feature data to output secondary invoice feature parameters, wherein the secondary invoice feature parameters include the gray value difference between the invoice image and the standard image, the noise area ratio of the invoice image, and the extraction time of the invoice image information; The central control module is connected to the information acquisition module and the data processing module respectively, and is used to adjust the inclination angle of the image acquisition component to a corresponding angle when the effectiveness of image acquisition is determined to be lower than the allowable range according to the difference in grayscale values between the invoice image and the standard image, or to adjust the sensitivity of the image acquisition component to a corresponding value according to the proportion of the noise area of the invoice image. and, adjusting the training frequency of the data training system to a corresponding frequency according to the missing area of the edge of the invoice image; And, the single-block segmentation area of the invoice image is adjusted to a corresponding area according to the difference between the extraction time of the invoice image information and the preset time.
