Character recognition method and character recognition apparatus
Through deep learning technology, overlapping character lines in scanned documents are located and segmented, which solves the recognition difficulties caused by noise interference and small characters, and achieves improved character recognition accuracy.
Patent Information
- Application Number
- CN201910983086.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-16
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2039-10-16
AI Technical Summary
Existing optical character recognition technology is difficult to accurately recognize characters when there is noise interference in the scanned document or the document characters are small.
Deep learning technology is used to locate character rows, cut overlapping character rows and perform image processing for segmentation and relocation. Combined with binarization processing and pixel number curve analysis, accurate recognition of overlapping character rows is achieved.
Even in the presence of noise or when the characters in the document are small, accurate character recognition can be performed, thus improving recognition accuracy.
Smart Images

Figure CN112668372B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a character recognition method and a character recognition device. Background Art
[0002] Deep learning-based optical character recognition technology has garnered widespread attention due to its practical application in real life. Currently, optical character recognition technology is primarily used for character recognition in scanned documents. This technology achieves relatively high accuracy for character recognition in general scanned documents. However, when scanned documents contain noise such as watermarks and postmarks, or when the characters are small, accurate character recognition may be ineffective. Summary of the Invention
[0003] Problems to be solved by the invention
[0004] To address the technical problem that accurate character recognition cannot be performed due to noise interference in the image to be recognized or small characters in the document, the present invention provides a character recognition method and a character recognition device.
[0005] Technical means to solve the problem
[0006] The character recognition method of the present invention includes: a character row positioning step, reading an image containing characters to be recognized, and positioning each character row composed of the characters to be recognized based on deep learning; a target image cutting step, when there are overlapping character rows with overlapping positions in the character rows, cutting out the image portion containing the overlapping character rows as a target image; an overlapping character row segmentation step, performing image processing on the target image so that each row in the overlapping character rows is segmented and repositioned; and a character recognition step, performing character recognition on the character rows that have completed positioning.
[0007] The character recognition device of the present invention includes: a character row positioning unit, which reads an image containing characters to be recognized and positions each character row composed of the characters to be recognized based on deep learning; a target image cutting unit, which cuts out the image portion containing the overlapping character rows as a target image when there are overlapping character rows with overlapping positions in the character rows; an overlapping character row segmentation unit, which performs image processing on the target image so that each row in the overlapping character rows is segmented and repositioned; and a character recognition unit, which performs character recognition on the character rows that have completed positioning.
[0008] Effects of the Invention
[0009] According to the character recognition method and the character recognition device of the present invention, character recognition can be performed accurately even if there is noise interference in the image to be recognized or the document characters are small. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a flowchart showing the character recognition method described in Example 1.
[0011] Figure 2 (a) to (c) are schematic diagrams illustrating examples of character recognition according to the present invention.
[0012] Figure 3 (a) to (d) are schematic diagrams showing examples of segmentation of overlapping character lines according to the present invention.
[0013] Figure 4 : is a flowchart showing the overlapping character line segmentation process.
[0014] Figure 5 This is a flowchart showing the character recognition method described in Example 2.
[0015] Figure 6 This is a flowchart showing the character recognition method described in Example 3.
[0016] Figure 7 This is a diagram showing the structure of the character recognition device of the present invention. DETAILED DESCRIPTION
[0017] Below, refer to the attached Figures 1 to 6 , the specific implementation of the character recognition method of the present invention is described.
[0018] Example 1
[0019] Figure 1 This is a flowchart showing the character recognition method described in Example 1. Figure 2 (a) to (c) are schematic diagrams illustrating examples of character recognition according to the present invention. Figure 3 (a) to (d) are schematic diagrams showing examples of segmentation of overlapping character lines according to the present invention.
[0020] like Figure 1 As shown, in step S1, an image containing characters to be recognized is read, and each character row consisting of the characters to be recognized is located based on deep learning. Figure 2 (a) shows an example of an image to be recognized, which contains three lines, wherein a watermark exists between the upper two lines. Figure 2 (b) shows an example of positioning each character line. In the positioning process, each character to be recognized is first positioned, and then each character line composed of the characters to be recognized is positioned.
[0021] In step S2, it is determined whether there are overlapping character rows in each character row. Figure 2As shown in (b), due to the influence of the watermark, the boundaries of the two upper lines overlap, and the upper two lines are overlapping character lines. The method for determining overlapping character lines can adopt existing technology.
[0022] If the judgment result of step S2 is "yes", the process proceeds to step S3 to cut out the image portion containing the overlapping character rows as the target image. Figure 3 (a) shows an example of the target image. If the judgment result of step S2 is "No", the process proceeds to step S5.
[0023] In step S4, Figure 3 The target image shown in (a) is subjected to image processing so that the overlapping character rows are separated and repositioned. Figure 3 (d) shows an example of the repositioned character line. Thus, the three character lines of the original image to be recognized are all positioned. Figure 2 (c) shows an example of each character row after positioning is completed.
[0024] In step S5, character recognition is performed on each character row that has been positioned.
[0025] Next, the manner of performing image processing on the target image in step S4 will be described in detail. Figure 4 : is a flowchart showing the overlapping character line segmentation process.
[0026] In step S41, Figure 3 The target image shown in (a) is binarized to remove the grayscale in the image and obtain Figure 3 (b) shows the image after binarization processing.
[0027] In step S42, Figure 3 The binarized image shown in (b) is scanned line by line to generate a pixel number curve representing the number of pixels in each scanning line. Figure 3 (c) shows the correspondence between the image after binarization processing and the pixel number curve, where the vertical axis of the pixel number curve represents each scanning line and the horizontal axis represents the number of black pixels in each scanning line.
[0028] In step S43, the overlapping character lines are split and repositioned according to the position of the extreme value (the minimum value in this embodiment) of the pixel number curve in a specific area, and the resulting Figure 3 (d) shows the character row after repositioning.
[0029] The specific area here is set according to the average line height value of each character line in the target image. For example, in the range of the lower edge line height of the target image plus 0.5 line height to the lower edge line height plus 1.5 line height, of course, the coefficient multiplied by the line height is not limited to 0.5 and 1.5, and other appropriate values can be used. After determining the extreme value of the pixel number curve in the specific area, the determined extreme value is used as the lower edge line, and a new feature area is continuously set to determine the extreme value of the pixel number curve. In this way, all extreme values of the pixel number curve are determined until the feature area exceeds the upper edge line of the target image.
[0030] The purpose of setting the specific area is to improve the accuracy of segmenting and positioning overlapping character lines. The average line height of each character line is calculated for the overlapping character lines after segmenting the target image. The average line height can be calculated using existing technology.
[0031] By adopting the character recognition method of the present invention, even when there is noise interference in the image to be recognized or the document characters are small, each character row can be accurately positioned, thereby improving the accuracy of character recognition.
[0032] Example 2
[0033] Compared with the character recognition method described in Example 1, this embodiment adds a step of re-positioning the overlapping character rows in the target image based on deep learning.
[0034] Figure 5 : is a flowchart showing the character recognition method described in Example 2. Figure 5 As shown, after step S3, the process proceeds to step S6 to perform deep learning-based positioning again.
[0035] The target image is a partial image in the image to be recognized. When the target image is positioned again based on deep learning, the target image can be enlarged, so that each character row can be further accurately positioned, thereby improving the accuracy of character recognition.
[0036] Example 3
[0037] Compared with the character recognition method described in Example 1, this embodiment omits step S2 , that is, this embodiment does not determine whether there are overlapping character rows with overlapping positions in each character row.
[0038] When the user is familiar with scanning documents, he or she can generally know in advance which area of the image to be recognized will have overlapping character rows. In this case, step S2 in embodiment 1 can be omitted.
[0039] Figure 63 is a flowchart illustrating the character recognition method described in Example 3. In step S3, the image portion containing overlapping character lines is cut out as a target image, wherein the image portion containing overlapping character lines is an image portion at a predetermined designated position.
[0040] With this structure, when performing character recognition on familiar scanned documents, the computational load in the character recognition process can be reduced, each character row can be accurately positioned more quickly, and the accuracy of character recognition can be improved.
[0041] (Other embodiments)
[0042] While the present invention has been described above through the embodiments, the description and drawings constituting part of this disclosure should not be construed as limiting the present invention. Various alternative embodiments, examples, and operational techniques will be readily apparent to those skilled in the art based on this disclosure.
[0043] Below, refer to the attached Figure 7 , the character recognition device of the present invention is described. Figure 7 This is a diagram showing the structure of the character recognition device of the present invention.
[0044] The character recognition device 1 of the present invention includes a character row positioning unit 11, which reads an image containing characters to be recognized and locates each character row composed of characters to be recognized based on deep learning; a target image cutting unit 13, which cuts out the image portion containing overlapping character rows as a target image when there are overlapping character rows with overlapping positions in each character row; an overlapping character row segmentation unit 14, which performs image processing on the target image so that each row in the overlapping character rows is segmented and repositioned; and a character recognition unit, which performs character recognition on each character row that has completed positioning.
[0045] The character recognition device 1 of the present invention may further include an overlapping character line determination unit 12 (not shown) for determining whether or not there are overlapping character lines in each character line.
[0046] The overlapping character row segmentation unit 14 binarizes the target image and scans the binarized image row by row to generate a pixel number curve representing the number of pixels in each scan row. According to the position of the extreme value of the pixel number curve in a specific area, each row in the overlapping character row is segmented and repositioned. The specific area is set according to the average row height value of each character row in the target image.
[0047] Before the overlapping character line segmentation unit 14 performs image processing on the target image, the character line positioning unit 11 again performs deep learning-based positioning on the overlapping character lines in the target image.
[0048] The target image can also be a portion of an image at a specified location.
[0049] Since the various functional modules of the character recognition device 1 of the present invention are similar to the above Figure 1 The steps of the embodiment of the character recognition method correspond to those of the embodiment of the invention, so they will not be repeated here.
Claims
1. A character recognition method, characterized in that: include: a character row positioning step of reading an image containing characters to be recognized and positioning each character row consisting of the characters to be recognized based on deep learning; a target image cutting step, in the case where there are overlapping character lines in the character lines, cutting out the image portion including the overlapping character lines as the target image; an overlapping character row segmentation step, performing image processing on the target image so that each row of the overlapping character rows is segmented and repositioned; as well as The character recognition step is to perform character recognition on each character row that has completed positioning. In the overlapping character line segmentation step, the target image is binarized and the binarized image is scanned line by line to generate a pixel number curve representing the number of pixels in each scan line. Based on the position of the extreme value of the pixel number curve in a specific area, each line in the overlapping character line is segmented and repositioned. The specific area is set according to an average line height value of each character line in the target image.
2. The character recognition method according to claim 1, wherein: The method further includes an overlapping character row judging step of judging whether the overlapping character row exists in the character rows.
3. The character recognition method according to claim 1, wherein: Before the overlapping character row segmentation step, the overlapping character rows in the target image are positioned again based on deep learning.
4. The character recognition method according to claim 1, wherein: The target image is an image portion at a specified position.
5. A character recognition device, characterized in that: include: a character row positioning unit that reads an image containing characters to be recognized and positions each character row consisting of the characters to be recognized based on deep learning; a target image cutting unit for cutting out, when there are overlapping character lines in the character lines, an image portion including the overlapping character lines as a target image; an overlapping character row segmentation unit, which performs image processing on the target image so as to segment and reposition each of the overlapping character rows; as well as a character recognition unit that performs character recognition on each of the character rows that have completed positioning, The overlapping character line segmentation unit binarizes the target image and scans the binarized image line by line to generate a pixel number curve representing the number of pixels in each scan line. Based on the position of the extreme value of the pixel number curve in a specific area, each line in the overlapping character line is segmented and repositioned. The specific area is set according to an average line height value of each character line in the target image.
6. The character recognition device according to claim 5, wherein: The system further includes an overlapping character row determining unit for determining whether the overlapping character row exists in the character rows.
7. The character recognition device according to claim 5, wherein: Before the overlapping character line segmentation unit performs image processing on the target image, the overlapping character lines in the target image are positioned again based on deep learning.
8. The character recognition device according to claim 5, wherein The target image is an image portion at a specified position.
Citation Information
Patent Citations
Driving license recognition method and device
CN106874901A
Electric power SCADA alarm interface character segmentation and processing method thereof
CN112700458A
Character recognizing device
JP1994337959A