Image text recognition method, system and storage medium based on deep learning training

By performing binary processing on grayscale and area division of the image, combined with deep learning technology for text recognition and repair, the problems of unreasonable binary processing and insufficient repair of incomplete text in the existing technology are solved, and the image quality is improved. Accuracy and intelligence of text recognition.

CN118279923BActive Publication Date: 2024-08-23天津市天益达科技发展有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410674467.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-23
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

Existing image text recognition technology can easily cause part of the text to be unrecognizable during binary processing, and cannot effectively repair incomplete text, resulting in incorrect recognition results.

Method used

By grayscale processing the image, dividing the grayscale area for binary processing, combining PSENe text detection technology and CNN+RNN+CTC text recognition technology for text recognition, and using the text repair deep learning model to perform text recognition on unrecognizable text. repair.

Benefits of technology

It improves the accuracy and clarity of image text recognition, ensures accurate repair of incomplete text, and enhances the intelligence of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118279923B
    Figure CN118279923B
Patent Text Reader

Abstract

The present invention discloses a method, system and storage medium for image text recognition based on deep learning training, relates to the technical field of image text recognition, and comprises the following steps: establishing an image recognition sample library; graying a sample image to obtain a gray image, performing feature analysis on the gray image, and enhancing the contour of the gray image through the feature analysis to obtain a feature image; performing text detection on the feature image, locating the text area in the feature image, recognizing the located text area, and converting the text area in the image into character information; and repairing the text in the unrecognizable text area. The present invention is used to solve the problem that the existing image text recognition technology still has unreasonable binarization processing and cannot repair incomplete text, resulting in errors in the result of image text recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image text recognition, and specifically to an image text recognition method, system and storage medium based on deep learning training. Background Art

[0002] Image text recognition technology refers to a technology that extracts printed or handwritten text from an image and converts it into editable text. It uses computer vision and pattern recognition technology to automatically identify and extract text information from images by analyzing and processing images. The main goal of image text recognition technology is to achieve automated text recognition and extraction to replace the process of manual input or transcription of text in images. It can be applied to various fields, including document processing, digital file management, automated data entry, ID card recognition, bank check processing, and license plate recognition.

[0003] Existing image text recognition technologies usually perform image text recognition according to the methods of image preprocessing, text detection and text recognition. In terms of image preprocessing, simple grayscale or binarization processing is usually performed. Especially in binarization processing, ordinary binarization processing will cause some text to be unrecognizable, and existing image text recognition technologies can only recognize complete text in the image, and cannot repair incomplete text. For example, in the Chinese patent application publication number CN110826360A, OCR image preprocessing and text recognition are disclosed. During the binarization processing, this scheme only directly binarizes the grayscale image according to the existing binarization judgment standard, which is prone to the situation that some text cannot be recognized, and incomplete text cannot be repaired. The existing image text recognition technology also has the problems that the binarization processing is not reasonable enough and incomplete text cannot be repaired, resulting in the problem that the image text recognition results are prone to errors. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems in the prior art to a certain extent, by graying a sample image to obtain a gray image, performing neighborhood analysis on the gray image, dividing the gray image into different gray areas, binarizing the different gray areas to obtain a feature image, and then performing text recognition on the feature image through PSENe text detection technology and CNN+RNN+CTC text recognition technology. After the recognition is completed, the unrecognizable text in the feature image is repaired based on the recognized character information and the text repair deep learning model, so as to solve the problem that the existing image text recognition technology still has unreasonable binarization processing and cannot repair incomplete text, resulting in errors in the image text recognition results.

[0005] To achieve the above objectives, in a first aspect, the present application provides a method for image text recognition based on deep learning training, comprising the following steps:

[0006] Establish an image recognition sample library and collect sample images through big data;

[0007] Grayscale the sample image to obtain a grayscale image, perform feature analysis on the grayscale image, and perform contour enhancement on the grayscale image through feature analysis to obtain a feature image;

[0008] Perform text detection on the feature image, locate the text area in the feature image, recognize the located text area, and convert the text area in the image into character information;

[0009] Perform text repair on unrecognizable text areas.

[0010] Furthermore, the sample images are used to train a text recognition model after subsequent processing.

[0011] Further, graying the sample image to obtain a gray image, performing feature analysis on the gray image, and performing contour enhancement on the gray image through feature analysis to obtain a feature image includes the following sub-steps:

[0012] Grayscale the sample image to obtain a grayscale image;

[0013] Perform neighborhood analysis on the grayscale image and divide the grayscale image into different grayscale areas;

[0014] The grayscale area is binarized to obtain the feature image.

[0015] Furthermore, performing neighborhood analysis on the grayscale image and dividing the grayscale image into different grayscale regions includes the following sub-steps:

[0016] Obtaining an image resolution of the grayscale image, wherein the image resolution is m×n, where m and n are both positive integers;

[0017] The pixel points are numbered and named as pixel numbers, where the pixel numbers are S(m,n);

[0018] For S(m,n), the grayscale value of S(m,n) is obtained and named as the target grayscale value, and the grayscale values ​​of the eight neighborhoods of S(m,n) are obtained and named as neighborhood grayscale values, and the neighborhood grayscale values ​​are named as the first grayscale value, the second grayscale value, the third grayscale value, the fourth grayscale value, the fifth grayscale value, the sixth grayscale value, the seventh grayscale value and the eighth grayscale value from the upper left to the lower right;

[0019] The absolute values ​​of the differences between the neighborhood grayscale values ​​and the target grayscale values ​​are calculated in sequence, which are named neighborhood grayscale differences, and the neighborhood grayscale differences include a first grayscale difference, a second grayscale difference, a third grayscale difference, a fourth grayscale difference, a fifth grayscale difference, a sixth grayscale difference, a seventh grayscale difference, and an eighth grayscale difference;

[0020] Sort the neighborhood grayscale differences from small to large, represented by symbols P1 to P8;

[0021] Get the neighborhood grayscale difference corresponding to P8, mark it as the maximum grayscale difference, mark the corresponding pixel point as the directional pixel point, take the target pixel point as the starting point, search for the pixel point adjacent to the directional pixel point along the direction of the directional pixel point, and mark it as the determination pixel point;

[0022] The target pixel, the directional pixel and the determination pixel are analyzed to determine whether the target pixel is a boundary.

[0023] Furthermore, analyzing the target pixel, the directional pixel, and the determination pixel includes the following sub-steps:

[0024] Find the neighborhood grayscale value of the directional pixel point and mark it as the verification grayscale value; mark the grayscale value of the directional pixel point as the directional grayscale value;

[0025] Calculate the absolute value of the difference between the verification grayscale value and the directional grayscale value, and name it as the verification grayscale difference;

[0026] Find the pixel point corresponding to the maximum value in the verification grayscale difference and mark it as the verification pixel point;

[0027] Compare and verify whether the verification pixel is the determination pixel. If the verification pixel is the determination pixel, output the image boundary signal; if the verification pixel is not the determination pixel, output the non-boundary signal;

[0028] If an image boundary signal is output, the target pixel point is marked as a boundary pixel point; if a non-boundary signal is output, the target pixel point is marked as an image pixel point; the adjacent image pixels and boundary pixels are combined into a grayscale area.

[0029] Furthermore, binarization is performed on the grayscale area to obtain a feature image, which includes the following sub-steps:

[0030] Find the image pixels in the grayscale area and fill them with white;

[0031] Find the boundary pixels in the grayscale area, fill the boundary pixels with black, and get the feature image.

[0032] Further, performing text detection on the feature image, locating the text area in the feature image, recognizing the located text area, and converting the text area in the image into character information includes the following sub-steps:

[0033] Use PSENe text detection technology to detect text in feature images;

[0034] The text area is recognized through CNN+RNN+CTC text recognition technology to obtain character information and incomplete characters.

[0035] Furthermore, repairing the text in the unrecognizable text area includes the following sub-steps:

[0036] Select the first complete character in the character information and mark it as a sample character;

[0037] Get the grayscale area to which the sample character belongs, marked as the sample area, get the maximum value and minimum value of m in the pixel number S(m,n) of the pixel points in the sample area, named as the maximum width and minimum width respectively; get the maximum value and minimum value of n in the pixel number S(m,n) of the pixel points in the sample area, named as the maximum height and minimum height respectively;

[0038] Subtract the minimum width from the maximum width to get the font width; subtract the minimum height from the maximum height to get the font height; multiply the font width by the font height to get the font size;

[0039] Get the grayscale area to which the incomplete character belongs, mark it as the target area, get the maximum value and minimum value of m in the pixel number S(m,n) of the pixel points in the target area, and name them as the maximum target width and the minimum target width respectively; get the maximum value and minimum value of n in the pixel number S(m,n) of the pixel points in the target area, and name them as the maximum target height and the minimum target height respectively;

[0040] Subtract the minimum target width from the maximum target width to get the target width; subtract the minimum target height from the maximum target height to get the target height; multiply the target width by the target height to get the target size;

[0041] Substitute target size / font size to get target proportion;

[0042] The target proportion and target area are judged through the text inpainting deep learning model, and the inpainting result is output to obtain the character information.

[0043] In a second aspect, the present application provides a picture text recognition system based on deep learning training, including a data repository, a feature extraction module, a text recognition module and a text repair module, wherein the data repository, the feature extraction module and the text repair module are respectively connected to the text recognition module data;

[0044] The data repository is used to establish an image recognition sample library, collecting sample images through big data;

[0045] The feature extraction module is used to grayscale the sample image to obtain a grayscale image, perform feature analysis on the grayscale image, and perform contour enhancement on the grayscale image through feature analysis to obtain a feature image;

[0046] The text recognition module is used to detect text on the feature image, locate the text area in the feature image, recognize the located text area, and convert the text area in the image into character information;

[0047] The text repair module is used to repair text in unrecognizable text areas.

[0048] In a third aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are executed.

[0049] Beneficial effects of the present invention: The present invention obtains a grayscale image by graying the sample image, and analyzes whether the pixel point is a boundary based on the grayscale value of the pixel point in the grayscale image. The advantage is that the boundary point analysis can enhance the contour of the image, making the image clearer and easier to recognize, thereby improving the accuracy of image text recognition;

[0050] The present invention divides the boundary pixels and the image pixels into different grayscale areas and performs binarization on the grayscale areas. The advantage is that the grayscale areas to which the boundary pixels belong are filled with black, and the grayscale areas to which the image pixels belong are filled with white, which can more accurately divide the shapes of different parts of the image, thereby improving the effectiveness of the binarization process and the clarity of the image.

[0051] The present invention obtains the font size of the text in the image by analyzing the recognized character information, calculates the target proportion of the incomplete characters based on the font size, and repairs the incomplete characters based on the target proportion and a text repair deep learning model. The advantage is that Chinese characters are too complex, and some Chinese characters can be obtained by combining other Chinese characters. Combining the target proportion can ensure that the incomplete characters will not be repaired as components of the original characters, thereby improving the intelligence of image text recognition and the accuracy of text repair.

[0052] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 The figure is a flow chart of the steps of the method of the present invention.

[0054] Figure 2 It is the grayscale image of the present invention.

[0055] Figure 3 Schematic diagram of neighborhood grayscale values ​​of the present invention.

[0056] Figure 4 It is the characteristic image of the present invention.

[0057] Figure 5 It is a schematic diagram of the text area and incomplete characters of the present invention.

[0058] Figure 6 It is a functional block diagram of the system of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] Example 1, please refer to Figure 1 As shown, in the first aspect, the present application provides a method for image text recognition based on deep learning training, comprising the following steps:

[0061] Step S1, establishing an image recognition sample library, collecting sample images through big data; the sample images are used for training the text recognition model after subsequent processing;

[0062] In the specific implementation, the image recognition sample library is only used to store image data. The stored sample images are processed in this embodiment to obtain feature images, which are then used for deep learning sample training of PSENe text detection technology and CNN+RNN+CTC text recognition technology.

[0063] Step S2, graying the sample image to obtain a gray image, performing feature analysis on the gray image, and performing contour enhancement on the gray image through feature analysis to obtain a feature image; Step S2 includes the following sub-steps:

[0064] See also Figure 2 As shown, step S201, grayscale processing is performed on the sample image to obtain a grayscale image;

[0065] In the specific implementation, the grayscale image is Figure 2 As shown;

[0066] Step S202, performing neighborhood analysis on the grayscale image to divide the grayscale image into different grayscale areas;

[0067] Step S202 includes the following sub-steps:

[0068] Step S2021, obtaining the image resolution of the grayscale image, the image resolution is m×n, where m and n are both positive integers;

[0069] Step S2022, numbering the pixel points and naming them as pixel numbers, the pixel number is S(m,n);

[0070] See also Figure 3 As shown, in step S2023, for S(m,n), the grayscale value of S(m,n) is obtained and named as the target grayscale value, the grayscale values ​​of the eight neighborhoods of S(m,n) are obtained and named as neighborhood grayscale values, and the neighborhood grayscale values ​​are named as the first grayscale value, the second grayscale value, the third grayscale value, the fourth grayscale value, the fifth grayscale value, the sixth grayscale value, the seventh grayscale value and the eighth grayscale value from the upper left to the lower right;

[0071] In the specific implementation, the image resolution is 294×89, where m=294 and n=89. Taking S(11,24) as an example, the neighborhood grayscale value and the neighborhood grayscale difference are specifically explained. The analysis process of the remaining pixels is the same as that of S(11,24). For S(11,24), the target grayscale value is 224, and the eight neighborhoods and neighborhood grayscale values ​​are as follows: Figure 3 As shown, among the neighborhood grayscale values ​​obtained, the first grayscale value to the eighth grayscale value are 224, 224, 224, 224, 224, 82, 90 and 90 respectively;

[0072] Step S2024, sequentially calculating the absolute values ​​of the differences between the neighborhood grayscale values ​​and the target grayscale values, which are named neighborhood grayscale differences, and the neighborhood grayscale differences include a first grayscale difference, a second grayscale difference, a third grayscale difference, a fourth grayscale difference, a fifth grayscale difference, a sixth grayscale difference, a seventh grayscale difference, and an eighth grayscale difference;

[0073] Step S2025, sorting the neighborhood grayscale differences in ascending order, represented by symbols P1 to P8;

[0074] Step S2026, obtaining the neighborhood grayscale difference corresponding to P8, marking it as the maximum grayscale difference, marking the corresponding pixel point as the directional pixel point, taking the target pixel point as the starting point, searching for the pixel point adjacent to the directional pixel point along the direction of the directional pixel point, and marking it as the determination pixel point;

[0075] In a specific implementation, the first grayscale difference to the eighth grayscale difference are calculated to be 0, 0, 0, 0, 0, 142, 134 and 134 respectively, and the sorting results are 0, 0, 0, 0, 0, 134, 134 and 142 for P1 to P8. The sorting of neighborhood grayscale differences of the same size can be arbitrarily arranged. If the maximum grayscale difference has the same neighborhood grayscale difference, the neighborhood grayscale difference with the same maximum grayscale difference will be analyzed in descending order, for example, P8 and If P7 is 142, the pixel corresponding to P8 is first marked as a directional pixel. After the analysis in step S2027 is completed, if the target pixel is a boundary pixel, P7 is no longer analyzed. If the target pixel is not a boundary pixel, the pixel corresponding to P7 is marked as a directional pixel and analyzed again. The pixel corresponding to P8 is obtained as S(10,25), and S(10,25) is marked as a directional pixel. The judgment pixel is found to be S(9,26).

[0076] Step S2027, analyzing the target pixel, the directional pixel, and the determination pixel to determine whether the target pixel is a boundary;

[0077] Step S2027 includes the following sub-steps:

[0078] Step S2027.1, finding the neighborhood grayscale value of the directional pixel point and marking it as the verification grayscale value; marking the grayscale value of the directional pixel point as the directional grayscale value;

[0079] Step S2027.2, calculating the absolute value of the difference between the verification grayscale value and the directional grayscale value, which is named verification grayscale difference;

[0080] In the specific implementation, the verification grayscale values ​​obtained from the upper left to the lower right are 188, 224, 224, 0, 90, 0, 0 and 0, and the directional grayscale value is 0; the verification grayscale difference values ​​calculated are 36, 0, 0, 224, 134, 224, 224, 224;

[0081] Step S2027.3, find the pixel point corresponding to the maximum value in the verification grayscale difference, and mark it as the verification pixel point;

[0082] Step S2027.4, comparing whether the verification pixel is the determination pixel, if the verification pixel is the determination pixel, outputting an image boundary signal; if the verification pixel is not the determination pixel, outputting a non-boundary signal;

[0083] Step S2027.5: if an image boundary signal is output, the target pixel is marked as a boundary pixel; if a non-boundary signal is output, the target pixel is marked as an image pixel; adjacent image pixels and boundary pixels are combined into a grayscale area;

[0084] In the specific implementation, the maximum value of the verification grayscale difference is 224, and the corresponding verification pixels include S(9,25), S(9,26), S(10,26) and S(11,26). It is found that there is a determination pixel S(9,26) in the verification pixel, that is, the verification pixel is the determination pixel, and the image boundary signal is output; the target pixel S(11,24) is marked as a boundary pixel, and all pixels in the grayscale image are determined and analyzed;

[0085] See also Figure 4 As shown, step S203, binarization is performed on the grayscale area to obtain a feature image;

[0086] Step S203 includes the following sub-steps:

[0087] Step S2031, searching for image pixels in the grayscale area, and filling the image pixels with white;

[0088] Step S2032, searching for boundary pixel points in the grayscale area, and filling the boundary pixel points with black to obtain a feature image;

[0089] In the specific implementation, the grayscale area is binarized to obtain a feature image such as Figure 4 shown.

[0090] Step S3, performing text detection on the feature image, locating the text area in the feature image, identifying the located text area, and converting the text area in the image into character information; Step S3 includes the following sub-steps:

[0091] Step S301, performing text detection on the feature image using the PSENe text detection technology;

[0092] Step S302, performing text recognition on the text area by using CNN+RNN+CTC text recognition technology to obtain character information and incomplete characters;

[0093] In the specific implementation, both the PSENe text detection technology and the CNN+RNN+CTC text recognition technology adopt the existing technology. This embodiment only optimizes the image preprocessing technology in the image text recognition technology and the incomplete text completion technology, and does not involve the principles of text detection technology and text recognition technology. The text area is detected by the PSENe text detection technology. Figure 5 As shown in the figure, the character information recognized by CNN+RNN+CTC text recognition technology is "Tomorrow will be updated", and the incomplete characters are as follows Figure 5 shown.

[0094] Step S4, repairing the text in the unrecognizable text area; Step S4 includes the following sub-steps:

[0095] Step S401: Select the first complete character in the character information and mark it as the sample character;

[0096] Step S402: Obtain the grayscale region to which the sample character belongs, mark it as the sample region, and obtain the maximum and minimum values of m in the pixel number S(m,n) of the pixel points in the sample region, and name them the maximum width and the minimum width respectively; obtain the maximum and minimum values of n in the pixel number S(m,n) of the pixel points in the sample region, and name them the maximum height and the minimum height respectively;

[0097] Step S403: Subtract the minimum width from the maximum width to obtain the font width; subtract the minimum height from the maximum height to obtain the font height, and multiply the font width by the font height to obtain the font size;

[0098] In a specific implementation, the sample text is "明", and the obtained maximum width and minimum width are 57 and 7, and the maximum height and minimum height are 78 and 19; the calculated font width is 50, the font height is 59, and the calculated font size is 2950;

[0099] Step S404: Obtain the grayscale region to which the incomplete character belongs, mark it as the target region, and obtain the maximum and minimum values of m in the pixel number S(m,n) of the pixel points in the target region, and name them the maximum target width and the minimum target width respectively; obtain the maximum and minimum values of n in the pixel number S(m,n) of the pixel points in the target region, and name them the maximum target height and the minimum target height respectively;

[0100] Step S405: Subtract the minimum target width from the maximum target width to obtain the target width; subtract the minimum target height from the maximum target height to obtain the target height, and multiply the target width by the target height to obtain the target size;

[0101] Step S406: Divide the target size by the font size to obtain the target ratio;

[0102] In a specific implementation, the obtained maximum target width and minimum target width are 294 and 269 respectively, and the maximum target height and minimum target height are 77 and 18 respectively. By calculation, the target width is 25, the target height is 59, and the calculated target size is 1475; calculate 1475 / 2950 = 0.5;

[0103] Step S407: Use the text repair deep learning model to judge the target ratio and the target region, and output the repair result to obtain the character information;

[0104] In the specific implementation, the text repair deep learning model adopts a convolutional neural network, and repairs the incomplete text through deep learning technology and combined with the target proportion. Taking this embodiment as an example, the incomplete text in this embodiment can be identified as "female". Since the target proportion is incomplete, it is judged as an incomplete text. Female can be combined into many Chinese characters, but the proportion in different Chinese characters is also different. In this embodiment, the text repair deep learning model can directly judge it as "tomorrow will be better" in combination with semantics. Suppose the character information is "I am and good", and the sentence was originally "I am and good friends". Only "I am and female" can be identified in the image. At this time, it is impossible to analyze it through semantics, and the target proportion of "female" is 0.5. The text repair deep learning model is trained with a large number of sample images, and combined with the target proportion to make a judgment, "female" can be repaired as "good".

[0105] Example 2, please refer to Figure 6 As shown, in the second aspect, the present application provides an image text recognition system based on deep learning training, including a data repository, a feature extraction module, a text recognition module and a text repair module, wherein the data repository, the feature extraction module and the text repair module are respectively connected to the text recognition module data;

[0106] The data repository is used to establish an image recognition sample library, which collects sample images through big data; the sample images are used to train the text recognition model after subsequent processing;

[0107] The feature extraction module is used to grayscale the sample image to obtain a grayscale image, perform feature analysis on the grayscale image, and perform contour enhancement on the grayscale image through feature analysis to obtain a feature image; the feature extraction module includes a grayscale processing unit, a grayscale area division unit, and a binarization processing unit;

[0108] The grayscale processing unit is configured with a grayscale processing strategy, which includes:

[0109] Grayscale the sample image to obtain a grayscale image;

[0110] Perform neighborhood analysis on the grayscale image and divide the grayscale image into different grayscale areas;

[0111] Binarize the grayscale area to obtain a feature image;

[0112] The grayscale area division unit is configured with a grayscale area division strategy, and the grayscale area division strategy includes:

[0113] Get the image resolution of the grayscale image, the image resolution is m×n, and m and n are both positive integers;

[0114] Number the pixels and name them as pixel numbers, where the pixel numbers are S(m,n);

[0115] For S(m,n), obtain the grayscale value of S(m,n) and name it as the target grayscale value, obtain the grayscale values ​​of the eight neighborhoods of S(m,n) and name them as neighborhood grayscale values, and the neighborhood grayscale values ​​are named the first grayscale value, the second grayscale value, the third grayscale value, the fourth grayscale value, the fifth grayscale value, the sixth grayscale value, the seventh grayscale value and the eighth grayscale value from the upper left to the lower right;

[0116] The absolute values ​​of the differences between the neighborhood grayscale values ​​and the target grayscale values ​​are calculated in sequence, which are named neighborhood grayscale differences. The neighborhood grayscale differences include a first grayscale difference, a second grayscale difference, a third grayscale difference, a fourth grayscale difference, a fifth grayscale difference, a sixth grayscale difference, a seventh grayscale difference, and an eighth grayscale difference;

[0117] Sort the neighborhood grayscale differences from small to large, represented by symbols P1 to P8;

[0118] Get the neighborhood grayscale difference corresponding to P8, mark it as the maximum grayscale difference, mark the corresponding pixel point as the directional pixel point, take the target pixel point as the starting point, search for the pixel point adjacent to the directional pixel point along the direction of the directional pixel point, and mark it as the determination pixel point;

[0119] Analyze the target pixel, directional pixel, and judgment pixel to determine whether the target pixel is a boundary;

[0120] Find the neighborhood grayscale value of the directional pixel point and mark it as the verification grayscale value; mark the grayscale value of the directional pixel point as the directional grayscale value;

[0121] Calculate the absolute value of the difference between the verification grayscale value and the directional grayscale value, and name it as the verification grayscale difference;

[0122] Find the pixel point corresponding to the maximum value in the verification grayscale difference and mark it as the verification pixel point;

[0123] Compare and verify whether the verification pixel is the determination pixel. If the verification pixel is the determination pixel, output the image boundary signal; if the verification pixel is not the determination pixel, output the non-boundary signal;

[0124] If an image boundary signal is output, the target pixel is marked as a boundary pixel; if a non-boundary signal is output, the target pixel is marked as an image pixel; adjacent image pixels and boundary pixels are combined into a grayscale area;

[0125] The binarization processing unit is configured with a binarization processing strategy, which includes:

[0126] Find the image pixels in the grayscale area and fill them with white;

[0127] Find the boundary pixels in the grayscale area, fill the boundary pixels with black, and obtain the feature image;

[0128] The text recognition module is used to detect text in the feature image, locate the text area in the feature image, recognize the located text area, and convert the text area in the image into character information;

[0129] The text recognition module is configured with a text recognition strategy, which includes:

[0130] Use PSENe text detection technology to detect text in feature images;

[0131] Use CNN+RNN+CTC text recognition technology to perform text recognition on the text area to obtain character information and incomplete characters;

[0132] The text repair module is used to repair the text in the unrecognizable text area;

[0133] The text patching module is configured with a text patching strategy, which includes:

[0134] Select the first complete character in the character information and mark it as a sample character;

[0135] Get the grayscale area to which the sample character belongs, marked as the sample area, get the maximum value and minimum value of m in the pixel number S(m,n) of the pixel points in the sample area, named as the maximum width and minimum width respectively; get the maximum value and minimum value of n in the pixel number S(m,n) of the pixel points in the sample area, named as the maximum height and minimum height respectively;

[0136] Subtract the minimum width from the maximum width to get the font width; subtract the minimum height from the maximum height to get the font height; multiply the font width by the font height to get the font size;

[0137] Get the grayscale area to which the incomplete character belongs, mark it as the target area, get the maximum value and minimum value of m in the pixel number S(m,n) of the pixel points in the target area, and name them as the maximum target width and the minimum target width respectively; get the maximum value and minimum value of n in the pixel number S(m,n) of the pixel points in the target area, and name them as the maximum target height and the minimum target height respectively;

[0138] Subtract the minimum target width from the maximum target width to get the target width; subtract the minimum target height from the maximum target height to get the target height; multiply the target width by the target height to get the target size;

[0139] Substitute target size / font size to get target proportion;

[0140] The target proportion and target area are judged through the text inpainting deep learning model, and the inpainting result is output to obtain the character information.

[0141] Embodiment 3, in the third aspect, the present application provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above method are executed. Through the above technical solution, when the computer program s is executed by the processor, the method in any optional implementation of the above embodiment is executed to achieve the following functions: establish an image recognition sample library; grayscale the sample image to obtain a grayscale image, perform feature analysis on the grayscale image, and perform contour enhancement on the grayscale image through feature analysis to obtain a feature image; perform text detection on the feature image, locate the text area in the feature image, identify the located text area, and convert the text area in the image into character information; perform text repair on the unrecognizable text area.

[0142] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0143] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0144] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

Claims

1. A method for image text recognition based on deep learning training, characterized in that: The steps include: Establish an image recognition sample library and collect sample images through big data; Grayscale the sample image to obtain a grayscale image, perform feature analysis on the grayscale image, and perform contour enhancement on the grayscale image through feature analysis to obtain a feature image; Perform text detection on the feature image, locate the text area in the feature image, recognize the located text area, and convert the text area in the image into character information; Perform text repair on unrecognizable text areas; The sample images are used for training the text recognition model after subsequent processing; Graying the sample image to obtain a gray image, performing feature analysis on the gray image, and performing contour enhancement on the gray image through feature analysis to obtain a feature image includes the following sub-steps: Grayscale the sample image to obtain a grayscale image; Perform neighborhood analysis on the grayscale image and divide the grayscale image into different grayscale areas; Binarize the grayscale area to obtain a feature image; Performing neighborhood analysis on a grayscale image and dividing the grayscale image into different grayscale regions includes the following sub-steps: Obtaining an image resolution of the grayscale image, wherein the image resolution is m×n, where m and n are both positive integers; The pixel points are numbered and named as pixel numbers, where the pixel numbers are S(m,n); For S(m,n), the grayscale value of S(m,n) is obtained and named as the target grayscale value, and the grayscale values ​​of the eight neighborhoods of S(m,n) are obtained and named as neighborhood grayscale values, and the neighborhood grayscale values ​​are named as the first grayscale value, the second grayscale value, the third grayscale value, the fourth grayscale value, the fifth grayscale value, the sixth grayscale value, the seventh grayscale value and the eighth grayscale value from the upper left to the lower right; The absolute values ​​of the differences between the neighborhood grayscale values ​​and the target grayscale values ​​are calculated in sequence, which are named neighborhood grayscale differences, and the neighborhood grayscale differences include a first grayscale difference, a second grayscale difference, a third grayscale difference, a fourth grayscale difference, a fifth grayscale difference, a sixth grayscale difference, a seventh grayscale difference, and an eighth grayscale difference; Sort the neighborhood grayscale differences from small to large, represented by symbols P1 to P8; Get the neighborhood grayscale difference corresponding to P8, mark it as the maximum grayscale difference, mark the corresponding pixel point as the directional pixel point, take the target pixel point as the starting point, search for the pixel point adjacent to the directional pixel point along the direction of the directional pixel point, and mark it as the determination pixel point; Analyze the target pixel, directional pixel, and judgment pixel to determine whether the target pixel is a boundary; The analysis of target pixels, directional pixels and determination pixels includes the following sub-steps: Find the neighborhood grayscale value of the directional pixel point and mark it as the verification grayscale value; mark the grayscale value of the directional pixel point as the directional grayscale value; Calculate the absolute value of the difference between the verification grayscale value and the directional grayscale value, and name it as the verification grayscale difference; Find the pixel point corresponding to the maximum value in the verification grayscale difference and mark it as the verification pixel point; Compare and verify whether the verification pixel is the determination pixel. If the verification pixel is the determination pixel, output the image boundary signal; if the verification pixel is not the determination pixel, output the non-boundary signal; If an image boundary signal is output, the target pixel point is marked as a boundary pixel point; if a non-boundary signal is output, the target pixel point is marked as an image pixel point; the adjacent image pixels and boundary pixels are combined into a grayscale area.

2. The image text recognition method based on deep learning training according to claim 1 is characterized in that: Binarization of the grayscale area to obtain a feature image includes the following sub-steps: Find the image pixels in the grayscale area and fill them with white; Find the boundary pixels in the grayscale area, fill the boundary pixels with black, and get the feature image.

3. The image text recognition method based on deep learning training according to claim 2 is characterized in that: Performing text detection on the feature image, locating the text area in the feature image, recognizing the located text area, and converting the text area in the image into character information includes the following sub-steps: Use PSENe text detection technology to detect text in feature images; The text area is recognized through CNN+RNN+CTC text recognition technology to obtain character information and incomplete characters.

4. The image text recognition method based on deep learning training according to claim 3 is characterized in that: The text repair of the unrecognizable text area includes the following sub-steps: Select the first complete character in the character information and mark it as a sample character; Get the grayscale area to which the sample character belongs, marked as the sample area, get the maximum value and minimum value of m in the pixel number S(m,n) of the pixel points in the sample area, named as the maximum width and minimum width respectively; get the maximum value and minimum value of n in the pixel number S(m,n) of the pixel points in the sample area, named as the maximum height and minimum height respectively; Subtract the minimum width from the maximum width to get the font width; subtract the minimum height from the maximum height to get the font height; multiply the font width by the font height to get the font size; Get the grayscale area to which the incomplete character belongs, mark it as the target area, get the maximum value and minimum value of m in the pixel number S(m,n) of the pixel points in the target area, and name them as the maximum target width and the minimum target width respectively; get the maximum value and minimum value of n in the pixel number S(m,n) of the pixel points in the target area, and name them as the maximum target height and the minimum target height respectively; Subtract the minimum target width from the maximum target width to get the target width; subtract the minimum target height from the maximum target height to get the target height; multiply the target width by the target height to get the target size; Substitute target size / font size to get target proportion; The target proportion and target area are judged through the text inpainting deep learning model, and the inpainting result is output to obtain the character information.

5. A system for image text recognition based on deep learning training, a system based on the method for image text recognition based on deep learning training according to any one of claims 1 to 4, characterized in that: It includes a data repository, a feature extraction module, a text recognition module and a text repair module, wherein the data repository, the feature extraction module and the text repair module are respectively connected to the text recognition module data; The data repository is used to establish an image recognition sample library, collecting sample images through big data; The feature extraction module is used to grayscale the sample image to obtain a grayscale image, perform feature analysis on the grayscale image, and perform contour enhancement on the grayscale image through feature analysis to obtain a feature image; The text recognition module is used to detect text on the feature image, locate the text area in the feature image, recognize the located text area, and convert the text area in the image into character information; The text repair module is used to repair text in unrecognizable text areas.

6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are executed.