A text recognition error correction method and system

Through the pixelated recognition and multi-level analysis text recognition error correction methods, the shortcomings of the existing OCR algorithm in Chinese character recognition and error correction are solved, and higher text recognition accuracy and efficiency are achieved.

CN118968526BActive Publication Date: 2025-03-11EXCELLENCE INFORMATION TECH CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411440394.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-03-11
Estimated Expiration
2044-10-16

AI Technical Summary

Technical Problem

The existing optical character recognition (OCR) algorithm has problems with misrecognition and poor recognition and error correction effects on Chinese characters. Convolutional neural network training requires a large amount of data processing, resulting in low recognition accuracy.

Method used

A text recognition error correction method is proposed, which simplifies the recognition algorithm and improves the accuracy through pixelated recognition and multi-level analysis. The specific steps include obtaining the image to be identified, performing pixelated recognition and border extraction, performing border matching and mapping processing based on the preset library, and finally identifying and correcting through weighted scores.

Benefits of technology

Through pixelation processing and multi-level analysis, the accuracy and efficiency of text recognition are improved, the algorithm process is simplified, and the accuracy of text recognition is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968526B_ABST
    Figure CN118968526B_ABST
Patent Text Reader

Abstract

The present invention proposes a method and system for text recognition and error correction, which performs pixel recognition on an image to be recognized and extracts the border of the text to be recognized based on a pixel processing algorithm to obtain a maximum text border; performs border matching on the maximum text border based on a preset library text frame to obtain text frame data; performs mapping processing on the text frame data based on the text data corresponding to the preset library text frame to obtain a number of text data; performs weighted scoring on the several text data based on the number of characters to be recognized and the text to be recognized to obtain a number of text weighted scores, and recognizes and corrects the text to be recognized. The present invention solves the problem that the recognition and error correction algorithms in the prior art are not effective, and usually misrecognition occurs due to the complexity of the algorithm, resulting in a low accuracy rate of optical character recognition. The present invention realizes pixel recognition and multi-level analysis of text, simplifies the recognition algorithm, and improves the accuracy rate of optical character recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a text recognition error correction method and system. Background Art

[0002] Optical Character Recognition (OCR) is usually used to automatically match and identify the content in text images collected by optical devices, as well as to perform error correction tasks. However, existing OCR algorithms often have misrecognition problems, and the effect of OCR error correction algorithms is not good, especially for the recognition and error correction of Chinese characters.

[0003] At present, the existing technology also uses convolutional neural networks to train text recognition and error correction models, but this method still requires a large number of training samples, which increases the amount of data processing computation. The analysis of words is not thorough enough, resulting in poor recognition results, and usually misrecognition occurs due to the complexity of the algorithm, resulting in the problem of low optical character recognition accuracy. Summary of the invention

[0004] In order to solve the above problems, the present invention proposes a text recognition error correction method and system to achieve pixel recognition and multi-level analysis of text, simplify the recognition algorithm, and improve the accuracy of optical character recognition.

[0005] To achieve the above object, an embodiment of the present invention provides a text recognition error correction method, comprising:

[0006] Acquire an image to be recognized, perform pixel recognition on the image to be recognized, and obtain text to be recognized;

[0007] Based on a pixel processing algorithm, extract the border of the text to be recognized to obtain the maximum text border;

[0008] Based on the preset library text frame, the maximum text frame is matched to obtain text frame data;

[0009] Based on the text data corresponding to the text frame in the preset library, mapping the text frame data to obtain a plurality of text data;

[0010] Based on the number of characters to be recognized and the characters to be recognized, weighted scoring is performed on the plurality of character data to obtain a plurality of character weighted scores;

[0011] Based on the weighted scores of the plurality of characters, the characters to be recognized are recognized and error corrected.

[0012] The embodiment of the present invention proposes a method for error correction in text recognition, which obtains text to be recognized by pixelating an image, extracts text information through pixel-level data processing, and improves the accuracy of text recognition; then, the extracted data is analyzed for text borders and text contents in turn, and the multi-level data analysis ensures the accuracy of the data content, and at the same time, a simple algorithm is used to implement the data analysis and processing process, which simplifies the steps of text recognition, and further improves the accuracy of text recognition while improving the recognition efficiency; finally, the text frame and text content are mapped, and then the text is further recognized and corrected through weighted scoring, and the algorithm flow is simplified by combining shape-text mapping with weighted scoring, and at the same time, the combination of the two methods further ensures the accuracy of text recognition; therefore, pixelated recognition and multi-level analysis of text are achieved, the recognition algorithm is simplified, and the accuracy of optical character recognition is improved.

[0013] Furthermore, the step of obtaining the image to be recognized and performing pixel recognition on the image to be recognized to obtain the text to be recognized is as follows:

[0014] Reading an image to be identified, inputting the image to be identified into a pixel domain to obtain a pixelated image;

[0015] Assign a first coding value to the initial blank pixel point;

[0016] Taking the initial blank pixel point as the starting point, traversing the global pixel points, assigning a first coding value to the pixel points that meet the preset grayscale threshold interval, and assigning a second coding value to the pixel points that do not meet the preset grayscale threshold interval, to obtain a global image pixel coding value;

[0017] Based on the global image pixel coding value, all pixel points assigned with the second coding value are extracted to obtain the text to be recognized.

[0018] The embodiment of the present invention proposes a text recognition error correction method, which processes an image to the pixel level by means of coding assignment, distinguishes text information based on the grayscale threshold range, and accurately extracts the text to be recognized.

[0019] Furthermore, the pixel-based processing algorithm is used to extract the border of the text to be recognized to obtain the maximum text border, specifically:

[0020] Based on a preset comparison pixel area, Boolean subtraction is performed on the text to be recognized to obtain a number of text border pixel values;

[0021] Perform pixel traversal on the top, bottom, left and right of each character border pixel value in turn to obtain the top traversal value, bottom traversal value, left traversal value and right traversal value;

[0022] When the upper traversal value, the lower traversal value, the left traversal value and the right traversal value of the text border pixel value do not meet the preset border requirements, the text border pixel value is removed;

[0023] When one of the upper traversal value, the lower traversal value, the left traversal value and the right traversal value of the text border pixel value meets the preset border requirement, the text border pixel value is used as the maximum border pixel value;

[0024] Connect the global maximum border pixel values ​​to get the maximum text border.

[0025] The embodiment of the present invention proposes a text recognition error correction method, which accurately determines the maximum border by traversing pixels in multiple directions based on the text structure design, and implements border analysis of the text to be recognized through an accurate border determination method.

[0026] Furthermore, based on the preset library text frame shapes, a Boolean operation value is obtained by performing Boolean subtraction between each library text frame shape and the maximum text frame; wherein the operation formula of the Boolean operation value is:

[0027] ; In the formula, is the text frame of each library, B is the maximum text frame, is a Boolean operation value;

[0028] The library text frame whose Boolean operation value satisfies the preset operation condition is matched with the maximum text frame to obtain text frame data, wherein the operation formula of the text frame data is:

[0029] ;

[0030]

[0031] In the formula, For text frame data, is the corresponding text frame of each library, B is the maximum text frame, is the corresponding Boolean operation value, To preset the operation conditions, they can be set according to the needs of frame comparison.

[0032] Furthermore, the text data corresponding to the text frame in the preset library is mapped to the text frame data to obtain a number of text data, specifically:

[0033] By mapping the text data corresponding to the text frame shape in the preset library with the text frame shape data, a mapping value of the text frame shape data is obtained;

[0034] The mapping value of the text frame data is converted into a pixel format value to obtain a number of text data.

[0035] The embodiment of the present invention proposes a method for text recognition and error correction, which obtains several possible text results by mapping frame data with text data, and provides a solid data foundation for subsequent weighted scoring through text content analysis. The text results obtained by mapping the same frame data can also be used for subsequent text same-shape error correction, thereby improving data analysis efficiency and text recognition accuracy.

[0036] Furthermore, based on the number of characters to be recognized and the characters to be recognized, the plurality of character data are weightedly scored to obtain a plurality of character weighted scores, specifically:

[0037] Based on the number of characters to be recognized, by comparing the pixel values ​​of the plurality of character data with the characters to be recognized, a comparison value of each character data is obtained;

[0038] Based on the overlapping pixel positions, weighted scores are given to the comparison values ​​of each text data to obtain a number of text weighted scores.

[0039] Furthermore, based on the weighted scores of the plurality of characters, the characters to be recognized are recognized and corrected, specifically:

[0040] Sorting the weighted scores of the plurality of characters, outputting the character data corresponding to the character data with the largest weighted score, and obtaining a recognition result of the character to be recognized;

[0041] A feature analysis is performed on the recognition result of the text to be recognized, and text error correction is performed based on the feature analysis result.

[0042] Furthermore, the step of weighting and scoring the plurality of text data based on the number of characters to be recognized and the characters to be recognized to obtain a plurality of text weighted scores also includes:

[0043] When the word to be recognized is a single word, a comparison value of each word data is obtained by comparing the pixel values ​​of the plurality of word data with the word to be recognized;

[0044] Based on a preset error analysis scoring table, by obtaining the overlapped pixel point error value of each character data comparison value, the scoring level of each character is set;

[0045] Based on the scoring level of each character, each character data comparison value is weighted and scored to obtain a number of character weighted scores.

[0046] The embodiment of the present invention proposes a method for correcting errors in text recognition. Different data analysis methods are used according to the number of characters. For single-word recognition, pixel value coincidence is first used to evaluate the coincidence of characters. Then, a rating weighting method is used to divide the probability of single-word recognition evaluation, thereby providing a data basis for subsequent accurate recognition and improving the accuracy of text recognition.

[0047] Furthermore, the step of weighting and scoring the plurality of text data based on the number of characters to be recognized and the characters to be recognized to obtain a plurality of text weighted scores also includes:

[0048] When the word to be recognized is not a single word, a comparison value of each word data is obtained by comparing the pixel values ​​of the plurality of word data with the word to be recognized;

[0049] Based on a preset error analysis scoring table, by obtaining the overlapped pixel point error value of each character data comparison value, the scoring level of each character is set;

[0050] Based on the scoring level of each character, weighted scoring is performed on each character data comparison value to obtain a first weighted score;

[0051] Based on the first weighted score, phrase and part-of-speech matching is performed on each text data to obtain phrase and part-of-speech matching data corresponding to each text data;

[0052] By using a preset phrase and part-of-speech scoring table, weighted scoring is performed on the phrase and part-of-speech matching data corresponding to each text data to obtain a second weighted score;

[0053] Based on the first weighted score and the second weighted score, a plurality of word weighted scores are obtained.

[0054] The embodiment of the present invention proposes a method for correcting text recognition errors. For multi-word recognition, not only rating weighting is performed, but also phrase and part-of-speech weighting is added. The reliability of the rating weighted score is further enhanced according to the weighted score of the phrase part-of-speech, and a reference basis can be provided for text error correction, thereby further improving the accuracy of text recognition.

[0055] The embodiment of the present invention also provides a text recognition and error correction system, comprising: a pixelation module, a frame extraction module, a frame matching module, a mapping processing module, a weighted scoring module and a recognition and error correction module;

[0056] The pixelation module is used to obtain an image to be recognized, perform pixelation recognition on the image to be recognized, and obtain text to be recognized;

[0057] The frame extraction module is used to extract the frame of the text to be recognized based on a pixel processing algorithm to obtain the maximum text frame;

[0058] The frame matching module is used to perform frame matching on the maximum text frame based on the preset library text frame to obtain text frame data;

[0059] The mapping processing module is used to perform mapping processing on the text frame data based on the text data corresponding to the text frame in the preset library to obtain a plurality of text data;

[0060] The weighted scoring module is used to perform weighted scoring on the plurality of text data based on the number of characters to be recognized and the characters to be recognized, so as to obtain a plurality of weighted scores of the characters;

[0061] The recognition and error correction module is used to recognize and correct the characters to be recognized based on the weighted scores of the plurality of characters.

[0062] The embodiment of the present invention proposes a text recognition and error correction system, which performs pixelation processing on an image through a pixelation module to obtain text to be recognized, and extracts text information through pixel-level data processing, thereby improving the accuracy of text recognition; then, a text frame analysis and a text content analysis are performed on the extracted data in sequence through a frame extraction module and a frame matching module, and the multi-level data analysis ensures the accuracy of the data content. At the same time, a simple algorithm is used to implement the data analysis and processing process, which simplifies the steps of text recognition, and further improves the accuracy of text recognition while improving the recognition efficiency; finally, a mapping processing module is used to map the text frame shape and the text content, and then a weighted scoring module and a recognition and error correction module are used to further recognize and correct the text by using weighted scoring. The shape-text mapping is combined with weighted scoring to simplify the algorithm flow, and the combination of the two methods further ensures the accuracy of text recognition; therefore, pixelation recognition and multi-level analysis of text are realized, the recognition algorithm is simplified, and the accuracy of optical character recognition is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of a process flow of a text recognition error correction method provided by an embodiment of the present invention;

[0064] Figure 2 A schematic diagram of the module structure of a text recognition and error correction system provided by an embodiment of the present invention;

[0065] Figure 3 FIG1 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0066] Figure 4 FIG2 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0067] Figure 5 FIG3 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0068] Figure 6 FIG4 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0069] Figure 7FIG5 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0070] Figure 8 FIG6 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0071] Figure 9 FIG7 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0072] Figure 10 FIG8 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention;

[0073] Figure 11 FIG9 is an implementable application diagram of a text recognition error correction method provided for a certain embodiment of the present invention. DETAILED DESCRIPTION

[0074] 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.

[0075] In this embodiment, in addition to being able to process Chinese characters, corresponding conditions can also be set according to the language to be processed. A text recognition and error correction method proposed in this embodiment of the present invention can process but is not limited to Chinese and English. In this embodiment, an application scenario of recognizing and correcting Chinese characters is adopted, which will not be described in detail below.

[0076] Example 1

[0077] See also Figure 1 , Figure 1 A flowchart of a method for correcting text recognition errors provided by an embodiment of the present invention is shown below. Figure 1 As shown, the embodiment of the present invention provides a text recognition error correction method, including steps 101 to 106, each step is specifically as follows:

[0078] Step 101, obtaining an image to be recognized, performing pixel recognition on the image to be recognized, and obtaining text to be recognized;

[0079] As an example of this embodiment, read the image to be identified, input the image to be identified into the pixel domain, and obtain a pixelized image; assign a first coding value to the initial blank pixel; take the initial blank pixel as the starting point, traverse the global pixel points, assign the first coding value to the pixel points that meet the preset gray threshold interval, and assign the second coding value to the pixel points that do not meet the preset gray threshold interval, and obtain the global image pixel coding value; based on the global image pixel coding value, extract all the pixels assigned the second coding value to obtain the text to be identified. A specific implementation method is to read the image to be processed, place the image in the pixel domain, assign "0" to the blank pixel points, assign "1" to the pixel points that meet the preset gray threshold interval, and assign "0" to the pixel points that do not meet the preset gray threshold interval; finally obtain the image to be processed with full image coding, extract the pixel points coded as "1" in the image, and construct the text to be identified. In addition, if there is a large deviation of the pixel point, it can be considered that the pixel point does not belong to the text body and is eliminated.

[0080] As another example of this embodiment, in addition to using the above-mentioned pixel encoding method to obtain the text to be recognized, optionally, point cloud encoding technology can also be used to obtain the text to be recognized; a specific explanation is to read the image to be recognized, input it into the point cloud domain, assign "0" to the blank point cloud, assign "1" to the point cloud that meets the preset grayscale threshold range, and assign "0" to the point cloud that does not meet the preset grayscale threshold range; finally, the image to be processed with full image encoding is obtained, and the point cloud encoded as "1" in the image is extracted to construct the text to be recognized.

[0081] Step 102, based on a pixel processing algorithm, extracting the border of the text to be recognized to obtain the largest text border;

[0082] As an example of this embodiment, based on a preset comparison pixel area, Boolean subtraction is performed on the text to be identified to obtain several text border pixel values; each text border pixel value is traversed up, down, left and right in turn to obtain an upper traversal value, a lower traversal value, a left traversal value and a right traversal value; when the upper traversal value, the lower traversal value, the left traversal value and the right traversal value of the text border pixel value do not meet the preset border requirements, the text border pixel value is discarded; when one of the upper traversal value, the lower traversal value, the left traversal value and the right traversal value of the text border pixel value meets the preset border requirements, the text border pixel value is used as the maximum border pixel value; the global maximum border pixel values ​​are connected to obtain the maximum text border. For a specific possible implementation method, see. Figure 3 and Figure 4 , Figure 3 FIG1 is an exemplified application diagram of a text recognition error correction method provided by an embodiment of the present invention; Figure 4The second implementable application diagram of a text recognition error correction method provided by an embodiment of the present invention; as Figure 3 and Figure 4 shown, after the text to be recognized is subjected to Boolean subtraction with a preset reference pixel area, the pixel values of the text border of "申" as shown in Figure 3 are obtained. For each border pixel value, the upper, lower, left, and right pixels are traversed. During one traversal process, whenever an additional border pixel value is traversed, it is considered that the traversal value does not meet the preset requirements until all border pixel values have been traversed. After traversing each border pixel value of "申" as shown in Figure 3 , the pixel points where the border pixel values that meet the requirements are located are connected to obtain the maximum text border as shown in Figure 4 .

[0083] Step 103: Based on the preset library text box shapes, perform border matching on the maximum text border to obtain text box shape data;

[0084] As an example of this embodiment, the performing border matching on the maximum text border based on the preset library text box shapes to obtain text box shape data is specifically: based on the preset library text box shapes, perform Boolean subtraction between each library text box shape and the maximum text border to obtain a Boolean operation value; wherein, the operation formula of the Boolean operation value is:

[0085] ;

[0086] In the formula, is each library text box shape, B is the maximum text border, is the Boolean operation value;

[0087] Match the library text box shapes whose Boolean operation values meet the preset operation conditions with the maximum text border to obtain text box shape data, wherein the operation formula of the text box shape data is:

[0088] ;

[0089]

[0090] In the formula, is the text box shape data, is the corresponding each library text box shape, B is the maximum text border, is the corresponding Boolean operation value, is the preset operation condition, which can be set according to the needs of box shape comparison.

[0091] One implementable way, see Figure 5 and Figure 6 , Figure 5FIG. 3 is an applicable illustration of a character recognition and error correction method provided by an embodiment of the present invention; Figure 6 FIG. 4 is an applicable illustration of a character recognition and error correction method provided by an embodiment of the present invention; As Figure 5 and Figure 6 shown, the character to be recognized is in the form of "拨", and by obtaining its maximum bounding box as Figure 6 , after calculation based on the above formula in the preset library character box shapes, several character box shape data in the form of Figure 6 can be obtained. Specifically, reference can also be made to Figure 7 and Figure 8 . Figure 7 FIG. 5 is an applicable illustration of a character recognition and error correction method provided by an embodiment of the present invention; Figure 8 FIG. 6 is an applicable illustration of a character recognition and error correction method provided by an embodiment of the present invention; As Figure 7 and Figure 8 shown, Figure 7 the character shown is a misspelled word, and its maximum bounding box is similar to that of "拔", and it can also be included in the character box shape data.

[0092] Step 104: Based on the character data corresponding to the preset library character box shapes, perform a mapping process on the character box shape data to obtain several character data;

[0093] As an example of this embodiment, by mapping the character data corresponding to the preset library character box shapes with the character box shape data, the mapping value of the character box shape data is obtained; the mapping value of the character box shape data is converted into a pixel format value to obtain several character data. Specifically, one applicable way is to retrieve the character pairs corresponding to the library character box shapes in the form of Figure 6 to map the above character box shape data to obtain character data: 拨, 拔, 泼, 跋, and 冹, etc. Existing and mature mapping algorithms can be used to map the character content, and no specific limitation is made in this embodiment.

[0094] Step 105: Based on the number of characters to be recognized and the character to be recognized, perform a weighted scoring on the several character data to obtain several character weighted scores;

[0095] As an example of this embodiment, based on the number of characters to be recognized, by comparing the pixel values of the several character data with the character to be recognized, the comparison value of each character data is obtained; based on the overlapping pixel positions, by performing a weighted scoring on the comparison values of each character data, several character weighted scores are obtained. Specifically, one explanation is that according to the number of characters to be recognized, different scoring methods are respectively adopted, and all scores are obtained by comparing the comparison data of pixel value overlap. The larger the comparison data of pixel value overlap, the higher the score, and vice versa, the smaller.

[0096] As another example of this embodiment, when the number of characters to be recognized is a single character, by comparing the pixel values of the several text data with the text to be recognized, comparison values of each text data are obtained; based on a preset error analysis scoring table, by obtaining the coincidence pixel position error values of the comparison values of each text data, the scoring levels of each character are set; based on the scoring levels of each character, the comparison values of each text data are weighted and scored to obtain several weighted scores of the text. For a specific explanation, see Figure 5 、 Figure 6 、 Figure 7 和 Figure 8 ; Figure 5 is the third applicable application diagram of a text recognition and error correction method provided by an embodiment of the present invention; Figure 6 is the fourth applicable application diagram of a text recognition and error correction method provided by an embodiment of the present invention; Figure 7 is the fifth applicable application diagram of a text recognition and error correction method provided by an embodiment of the present invention; Figure 8 is the sixth applicable application diagram of a text recognition and error correction method provided by an embodiment of the present invention; through the processing of the above steps 101 to 104, list scoring analysis is performed on the obtained text data: "拨", "拔", "泼", "跋", "冹", etc., see Table 1:

[0097] Table 1 Single-character Error Analysis Scoring Table 1

[0098] Text data to be recognized Coincident pixel position error value Scoring level of text Text data comparison value Score Pull 1% 1 99 0.99 Pull out 12% 2 88 0.88 Splash 15% 2 85 0.85 Traverse 20% 2 80 0.80 Feng 25% 3 70 0.70 ... ... ... ... ...

[0099] As can be seen from the above table, the scoring levels of the characters in the table are set at one level for every 10% of the coincidence pixel position error value. The comparison value of the text data of the character "拨" is the largest and the weighted score is the highest, and the comparison value of the text data of the character "冹" is the smallest and the weighted score is the lowest.

[0100] As another example of this embodiment, when the number of characters to be recognized is not a single character, by comparing the pixel values of the several text data with the text to be recognized, comparison values of each text data are obtained; based on a preset error analysis scoring table, by obtaining the coincidence pixel position error values of the comparison values of each text data, the scoring levels of each character are set; based on the scoring levels of each character, the comparison values of each text data are weighted and scored to obtain a first weighted score; based on the first weighted score, phrase and part-of-speech matching are performed on each text data to obtain the phrase and part-of-speech matching data corresponding to each text data; through a preset phrase and part-of-speech scoring table, the phrase and part-of-speech matching data corresponding to each text data are weighted and scored to obtain a second weighted score; based on the first weighted score and the second weighted score, several weighted scores of the text are obtained. For a specific explanation, see Figure 9 和 Figure 10 , Figure 9Schematic diagram VII of the implementable application of a text recognition and error correction method provided by an embodiment of the present invention; Figure 10 Schematic diagram VIII of the implementable application of a text recognition and error correction method provided by an embodiment of the present invention. Figure 11 Schematic diagram IX of the implementable application of a text recognition and error correction method provided by an embodiment of the present invention. As Figure 9 and Figure 10 shown, after the text to be recognized "you qing yi jian qu li" is processed through steps 101 to 104, the Figure 9 maximum bounding box shown is obtained, and a list scoring analysis is performed on the possible text data results. Different from single-character scoring, non-single-character scoring requires not only single-character scoring but also scoring based on phrases and parts of speech. First, obtain the first weighted score for single characters and the second weighted score for non-single characters, then determine the second weighted score for each combination of single characters as non-single characters according to the first weighted score, and comprehensively score to obtain the text weighted score. Specifically, refer to Tables 2, 3, and 4: Figure 10

[0101] Table 2 Single-character error analysis scoring table II

[0102] Text data to be recognized Coincident pixel position error value Scoring level of text Text data comparison value First weighted score By 1% 1 99 0.99 Apply 10% 1 90 0.90 A 30% 3 70 0.70 Request 1% 1 99 0.99 Clear 15% 2 85 0.85 Situation 25% 3 75 0.75 One 0% 1 100 1 Piece 1% 1 99 0.99 Dwarf 15% 2 85 0.85 Unknown 30% 3 70 0.70 Go 1% 1 99 0.99 Exclusive 15% 2 85 0.85 Lose 5% 1 95 0.95 Patent 15% 2 85 0.85 And 5% 1 95 0.95 Liu 50% 5 50 0.5 ... ... ... ... ...

[0103] Table 3 Non-single-character error analysis scoring table

[0104] Phrase Part of speech Phrase analysis Part of speech usage analysis Second weighted score By request / 0 0 0 Apply Verb or noun 1 1 100 One Classifier 1 1 100 Go and Verb 1 0 0 Go and patent / 0 0 0 Patent Noun 1 1 100 ... ... ... ... ...

[0105] Table 4 Text weighted score table

[0106] Single character Phrase First weighted score Second weighted score Text weighted score By By request 0.99 0 0 Apply Apply 0.90 100 90 One One piece 1 100 100 Piece One piece 0.99 100 99 Go Go and patent 0.99 0 0 And Go and 0.95 0 0 Exclusive Patent 0.85 100 85 Benefit Patent 0.85 100 85 ... ... ... ... ...

[0107] Through the analysis of the above Tables 1, 2, and 3, it can be seen that "you qing yi jian qu li" is divided into "you qing", "yi jian", and "qu li" for phrase analysis, and the words are grouped in order of the first weighted score of each single character from high to low. Whenever the analysis score of the phrase formed by a single character is 0, the single character is changed for word grouping until all single characters cannot be changed and the word grouping is paused. At the same time, the part of speech of the phrase is also analyzed. For example, the phrase "qu he" is a verb. According to the part-of-speech application standard of "Chinese Language and Literature", this phrase should at least adopt the form of verb + noun. However, there is no subsequent text in "you qing yi jian qu li" to form more words. Therefore, the part-of-speech usage analysis of the phrase "qu he" is 0, and the second weighted score is 0; finally, according to the first weighted score and the second weighted score, the text weighted score is comprehensively obtained as shown in Table 4; in this embodiment, the specific text or phrase analysis algorithm can be obtained through training with a mature large model in the prior art. The data matching can be not limited to the Keyword-BERT network model. Other natural language processing models, as long as they can perform semantic recognition and matching, are all feasible implementation methods.

[0108] Step 106: Identify and correct the text to be recognized based on the weighted scores of the several texts.

[0109] As an example of this embodiment, sort the weighted scores of the several texts, and output the text data corresponding to the text data with the largest weighted score to obtain the recognition result of the text to be recognized; perform feature analysis on the recognition result of the text to be recognized, and perform text correction based on the feature analysis result. For a specific explanation, see Figure 5 、 Figure 7 and Table 1, Figure 5 which is the third applicable illustration of a text recognition and correction method provided by an embodiment of the present invention; Figure 7 which is the fifth applicable illustration of a text recognition and correction method provided by an embodiment of the present invention; Table 1 is the single-character error analysis scoring table one; as Figure 5 、 Figure 7 and shown in Table 1, by sorting the weighted scores of single characters "bo 99", "bo 88", "po 85", "ba 80" and "sa 70", Figure 5 the recognition result is output as "bo", and Figure 7 the recognition result of the misspelled word shown is corrected to "bo".

[0110] See Figure 9 、 Figure 11 and Table 4, Figure 9 which is the seventh applicable illustration of a text recognition and correction method provided by an embodiment of the present invention; Figure 11 which is the ninth applicable illustration of a text recognition and correction method provided by an embodiment of the present invention; Table 4 is the text weighted score table; as Figure 9 、 Figure 11 and shown in Table 4, by sorting the weighted scores of several texts, such as "application 90", "one piece 100 / 99", "patent 85", "youqing 0", "quli 0" and "quhe 0", based on the sorting result of the text weighted scores, correct "youqing yijian quli" to "application one piece patent".

[0111] The embodiment of the present invention proposes a method for error correction of text recognition, which obtains the text to be recognized by pixelating the image, extracts the text information by pixel-level data processing, and improves the accuracy of text recognition; then, the extracted data is analyzed for text frame and text content in turn, and the multi-level data analysis ensures the accuracy of the data content, and at the same time, a simple algorithm is used to implement the data analysis and processing process, which simplifies the steps of text recognition, and further improves the accuracy of text recognition while improving the recognition efficiency; finally, the text frame and text content are mapped, and then the text is further recognized and corrected by weighted scoring, and the algorithm flow is simplified by combining shape-text mapping with weighted scoring, and at the same time, the combination of the two methods further ensures the accuracy of text recognition; therefore, pixel recognition and multi-level analysis of text are realized, the recognition algorithm is simplified, and the accuracy of optical character recognition is improved; the image is processed to the pixel level by coding assignment, and the text information is distinguished based on the grayscale threshold interval, so as to accurately Extract the text to be recognized; based on the text structure design, accurately determine the maximum border through multi-directional traversal of pixel points, and realize the border analysis of the text to be recognized through accurate border determination method; obtain several possible text results through mapping frame data with text data, and provide a solid data foundation for subsequent weighted scoring through text content analysis, and the text results obtained through mapping with frame data can also be used for subsequent text homomorphic error correction, thereby improving data analysis efficiency and text recognition accuracy; adopt different data analysis methods according to different numbers of words, first use pixel value overlap to evaluate the overlap of text for single-word recognition, and then use rating weighting to divide the probability of single-word recognition evaluation, provide a data foundation for subsequent accurate recognition, and improve the accuracy of text recognition; for multi-word recognition, not only rating weighting is used, but also phrase and part-of-speech weighting is added, and the reliability of rating weighting score is further enhanced according to the weighted score of phrase part-of-speech, which can also provide a reference basis for text correction and further improve the accuracy of text recognition.

[0112] Example 2

[0113] See also Figure 2 , Figure 2 The following is a schematic diagram of the module structure of a text recognition and error correction system provided by an embodiment of the present invention. Figure 2 As shown, the embodiment of the present invention provides a text recognition and error correction system, including:

[0114] Pixelation module 201, frame extraction module 202, frame matching module 203, mapping processing module 204, weighted scoring module 205 and recognition and error correction module 206;

[0115] The pixelation module 201 is used to obtain an image to be recognized, perform pixelation recognition on the image to be recognized, and obtain text to be recognized;

[0116] The frame extraction module 202 is used to extract the frame of the text to be recognized based on a pixel processing algorithm to obtain the maximum text frame;

[0117] The frame matching module 203 is used to perform frame matching on the maximum text frame based on the preset library text frame to obtain text frame data;

[0118] The mapping processing module 204 is used to perform mapping processing on the text frame data based on the text data corresponding to the text frame in the preset library to obtain a plurality of text data;

[0119] The weighted scoring module 205 is used to perform weighted scoring on the plurality of text data based on the number of characters to be recognized and the characters to be recognized, so as to obtain a plurality of weighted scores of the characters;

[0120] The recognition and error correction module 206 is used to recognize and correct the characters to be recognized based on the weighted scores of the characters.

[0121] The embodiment of the present invention proposes a text recognition and error correction system, which performs pixelation processing on an image through a pixelation module to obtain text to be recognized, and extracts text information through pixel-level data processing, thereby improving the accuracy of text recognition; then, a text frame analysis and a text content analysis are performed on the extracted data in sequence through a frame extraction module and a frame matching module, and the multi-level data analysis ensures the accuracy of the data content. At the same time, a simple algorithm is used to implement the data analysis and processing process, which simplifies the steps of text recognition, and further improves the accuracy of text recognition while improving the recognition efficiency; finally, a mapping processing module is used to map the text frame shape and the text content, and then a weighted scoring module and a recognition and error correction module are used to further recognize and correct the text by using weighted scoring. The shape-text mapping is combined with weighted scoring to simplify the algorithm flow, and the combination of the two methods further ensures the accuracy of text recognition; therefore, pixelation recognition and multi-level analysis of text are realized, the recognition algorithm is simplified, and the accuracy of optical character recognition is improved.

[0122] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

[0123] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0124] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

Claims

1. A text recognition error correction method, characterized in that: include: Acquire an image to be recognized, perform pixel recognition on the image to be recognized, and obtain text to be recognized; Based on a pixel processing algorithm, extract the border of the text to be recognized to obtain the maximum text border; Based on the preset library text frame, the maximum text frame is matched to obtain text frame data; Based on the text data corresponding to the text frame in the preset library, mapping the text frame data to obtain a plurality of text data; Based on the number of characters to be recognized and the characters to be recognized, weighted scoring is performed on the plurality of character data to obtain a plurality of character weighted scores; Based on the weighted scores of the plurality of characters, the characters to be recognized are recognized and error corrected; The step of obtaining an image to be recognized and performing pixel recognition on the image to be recognized to obtain text to be recognized is specifically as follows: Reading an image to be identified, inputting the image to be identified into a pixel domain to obtain a pixelated image; Assign a first coding value to the initial blank pixel point; Taking the initial blank pixel point as the starting point, traversing the global pixel points, assigning a first coding value to the pixel points that meet the preset grayscale threshold interval, and assigning a second coding value to the pixel points that do not meet the preset grayscale threshold interval, to obtain a global image pixel coding value; Based on the global image pixel code value, all pixel points assigned with a second code value are extracted to obtain the text to be recognized; The pixel-based processing algorithm is used to extract the border of the text to be recognized to obtain the maximum text border, specifically: Based on a preset comparison pixel area, Boolean subtraction is performed on the text to be recognized to obtain a number of text border pixel values; Perform pixel traversal on the top, bottom, left and right of each character border pixel value in turn to obtain the top traversal value, bottom traversal value, left traversal value and right traversal value; When the upper traversal value, the lower traversal value, the left traversal value and the right traversal value of the text border pixel value do not meet the preset border requirements, the text border pixel value is removed; When one of the upper traversal value, the lower traversal value, the left traversal value and the right traversal value of the text border pixel value meets the preset border requirement, the text border pixel value is used as the maximum border pixel value; Connect the global maximum border pixel values ​​to obtain the maximum text border; Based on the preset library text frame, the maximum text frame is matched to obtain text frame data, specifically: Based on the preset library text frame, each library text frame is subjected to Boolean subtraction from the maximum text frame to obtain a Boolean operation value; wherein the operation formula of the Boolean operation value is: ; In the formula, is the text frame of each library, B is the maximum text frame, is a Boolean operation value; The library text frame whose Boolean operation value satisfies the preset operation condition is matched with the maximum text frame to obtain text frame data, wherein the operation formula of the text frame data is: ; In the formula, For text frame data, is the corresponding text frame of each library, B is the maximum text frame, is the corresponding Boolean operation value, To preset the operation conditions, they can be set according to the needs of frame comparison; The text data corresponding to the text frame in the preset library is mapped to the text frame data to obtain a number of text data, specifically: By mapping the text data corresponding to the text frame shape in the preset library with the text frame shape data, a mapping value of the text frame shape data is obtained; Convert the mapping value of the text frame data into a pixel format value to obtain a plurality of text data; Based on the number of characters to be recognized and the characters to be recognized, the plurality of character data are weightedly scored to obtain a plurality of character weighted scores, specifically: Based on the number of characters to be recognized, by comparing the pixel values ​​of the plurality of character data with the characters to be recognized, a comparison value of each character data is obtained; Based on the overlapping pixel positions, weighted scores are given to the comparison values ​​of each text data to obtain a number of text weighted scores.

2. A text recognition error correction method as claimed in claim 1, characterized in that: The identifying and correcting of the to-be-recognized characters based on the weighted scores of the plurality of characters is specifically as follows: Sorting the weighted scores of the plurality of characters, outputting the character data corresponding to the character data with the largest weighted score, and obtaining a recognition result of the character to be recognized; A feature analysis is performed on the recognition result of the text to be recognized, and text error correction is performed based on the feature analysis result.

3. A text recognition error correction method as claimed in claim 1, characterized in that: Based on the number of characters to be recognized and the characters to be recognized, the plurality of character data are weightedly scored to obtain a plurality of character weighted scores, specifically: When the word to be recognized is a single word, a comparison value of each word data is obtained by comparing the pixel values ​​of the plurality of word data with the word to be recognized; Based on a preset error analysis scoring table, by obtaining the overlapped pixel point error value of each character data comparison value, the scoring level of each character is set; Based on the scoring level of each character, each character data comparison value is weighted and scored to obtain a number of character weighted scores.

4. A text recognition error correction method as claimed in claim 1, characterized in that: Based on the number of characters to be recognized and the characters to be recognized, the plurality of character data are weightedly scored to obtain a plurality of character weighted scores, specifically: When the word to be recognized is not a single word, a comparison value of each word data is obtained by comparing the pixel values ​​of the plurality of word data with the word to be recognized; Based on a preset error analysis scoring table, by obtaining the overlapped pixel point error value of each character data comparison value, the scoring level of each character is set; Based on the scoring level of each character, weighted scoring is performed on each character data comparison value to obtain a first weighted score; Based on the first weighted score, phrase and part-of-speech matching is performed on each text data to obtain phrase and part-of-speech matching data corresponding to each text data; By using a preset phrase and part-of-speech scoring table, weighted scoring is performed on the phrase and part-of-speech matching data corresponding to each text data to obtain a second weighted score; Based on the first weighted score and the second weighted score, a plurality of word weighted scores are obtained.

5. A text recognition error correction system, the text recognition error correction system is used to implement the text recognition error correction method according to any one of claims 1 to 4, characterized in that: include: Pixelation module, border extraction module, border matching module, mapping processing module, weighted scoring module and recognition and error correction module; The pixelation module is used to obtain an image to be recognized, perform pixelation recognition on the image to be recognized, and obtain text to be recognized; The frame extraction module is used to extract the frame of the text to be recognized based on a pixel processing algorithm to obtain the maximum text frame; The frame matching module is used to perform frame matching on the maximum text frame based on the preset library text frame to obtain text frame data; The mapping processing module is used to perform mapping processing on the text frame data based on the text data corresponding to the text frame in the preset library to obtain a plurality of text data; The weighted scoring module is used to perform weighted scoring on the plurality of text data based on the number of characters to be recognized and the characters to be recognized, so as to obtain a plurality of weighted scores of the characters; The recognition and error correction module is used to recognize and correct the characters to be recognized based on the weighted scores of the plurality of characters.

Citation Information

Patent Citations

  • Picture character identification method and apparatus thereof

    CN106599940A

  • Method for improving OCR (Optical Character Recognition) character recognition accuracy of visual system

    CN115063801A