A character recognition method, device and computer readable storage medium
By identifying the image to be processed frame by frame and performing cumulative voting, the problem of insufficient accuracy in Chinese character recognition in the prior art when fuzzy or angle differences is solved, and higher recognition accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202111486818.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-12-07
AI Technical Summary
Existing Chinese character recognition algorithms cannot achieve accurate recognition when text is blurred or shooting angles are different.
By identifying the image to be processed frame by frame, and cumulative votes are performed on the same character's same recognition results, and comparing the cached recognition value set to improve the recognition accuracy.
The accuracy of character recognition and the robustness of output recognition results are improved, and the recognition results can be output frame by frame without affecting the performance of the algorithm.
Smart Images

Figure CN114419477B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a character recognition method, device and computer-readable storage medium. Background Art
[0002] At present, with the development of artificial intelligence technology, the application of image recognition technology has penetrated into our lives, such as license plate recognition and mobile phone camera recognition. At present, the accuracy of text recognition is mainly improved by improving the accuracy of text recognition algorithms. However, for the existing algorithms of Chinese characters, when the text in a picture is blurred or the shooting angle is different, it is impossible to accurately recognize the characters. Summary of the invention
[0003] The main technical problem solved by the present invention is to provide a character recognition method, device and computer-readable storage medium, which can improve the accuracy of character recognition.
[0004] To solve the above technical problems, a technical solution adopted by the present invention is: to provide a character recognition method, which includes: obtaining an image to be processed, the image to be processed includes multiple frames of continuous images; recognizing characters in the current image to obtain a current recognition value, the current image is a frame of the image to be processed that is currently undergoing character recognition; obtaining a cache recognition value set, the cache recognition value set includes a number of cache recognition values, the cache recognition value is a recognition value obtained by performing character recognition on the cache image, the cache image is an image in the image to be processed that has completed character recognition; comparing the current recognition value with the cache recognition value in the cache recognition value set, increasing the frequency of the cache recognition value that is the same as the current recognition value by one, otherwise adding the current recognition value as a new cache recognition value to the cache recognition value set.
[0005] The character recognition method further includes: obtaining the cache recognition value with the highest frequency in the cache recognition value set; using the cache recognition value with the highest frequency as the character recognition result of each frame image, and outputting the character recognition result of each frame image frame by frame.
[0006] The character recognition in the image includes: obtaining a character row of the image, where a character row is a row of characters in the image; and recognizing each character in the character row to obtain a number of character recognition values.
[0007] Among them, comparing the current recognition value with the cache recognition value in the cache recognition value set includes: obtaining the cache recognition value corresponding to the current character row of the current image in the cache recognition value; comparing the current character recognition value of the current character row with the cached character recognition value character by character to obtain the character recognition value with the highest frequency for each character.
[0008] Among them, before comparing the current character recognition value and the cached character recognition value of the current character row character by character, it includes: obtaining the confidence of the current character recognition value of the current character and the confidence of the corresponding cached character recognition value; calculating the average confidence of the current character, the average confidence is the average of the confidence of the current character recognition value and the confidence of the corresponding cached character recognition value; in response to the average confidence being less than the confidence threshold, comparing the current character recognition value of the current character with the cached character recognition value.
[0009] Among them, before comparing the current character recognition value and the cached character recognition value of the current character row character by character, it includes: obtaining the confidence of the current character recognition value of the current character and the confidence of the corresponding cached character recognition value; calculating the average confidence of the current character, the average confidence is the average of the confidence of the current character recognition value and the confidence of the corresponding cached character recognition value; in response to the average confidence being greater than or equal to the confidence threshold, not executing the step of comparing the current character recognition value and the cached character recognition value of the current character, and using the current character recognition value as the character recognition result of the current character.
[0010] Among them, comparing the current recognition value with the cached recognition value in the cached recognition value set includes the following: obtaining the character row identifier of the current character row; determining whether there is a cached recognition value for a character row with the same identifier as the current character row in the cached recognition value set; in response to the existence of a cached recognition value for a character row with the same identifier as the current character row, executing the step of comparing the current recognition value with the cached recognition value in the cached recognition value set; in response to the absence of a cached recognition value for a character row with the same identifier as the current character row, using the current recognition value as the character recognition result of the current character row.
[0011] Among them, comparing the current recognition value with the cached recognition value in the cached recognition value set includes the following steps: obtaining the character row identifier and string length of the current character row; determining whether the string length of the character row in the cached recognition value set that has the same identifier as the current character row is the same as the string length of the current character row; in response to the string lengths being the same, executing the step of comparing the current recognition value with the cached recognition value in the cached recognition value set; in response to the string lengths being different, using the current recognition value as the character recognition result of the current character row.
[0012] In order to solve the above technical problem, another technical solution adopted by the present invention is: to provide a character recognition device, the character recognition device includes a processor, and the processor is used to execute to implement the above character recognition method.
[0013] In order to solve the above technical problem, another technical solution adopted by the present invention is: providing a computer-readable storage medium, the computer-readable storage medium is used to store instructions / program data, and the instructions / program data can be executed to implement the above character recognition method.
[0014] The beneficial effects of the present invention are as follows: Different from the prior art, the present invention recognizes the processed image frame by frame and performs cumulative voting on the same recognition results of the same character. This method can be used alone as a module in a character recognition system to output the algorithm results frame by frame without affecting the algorithm performance, thereby improving the accuracy of character recognition and the robustness of the output recognition results. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flowchart of a character recognition method in an embodiment of the present application;
[0016] Figure 2 is a flow chart of another character recognition method in an embodiment of the present application;
[0017] Figure 3 It is a flowchart of a character recognition module in an embodiment of the present application;
[0018] Figure 4 It is a flowchart of another character recognition method in the implementation mode of the present application;
[0019] Figure 5 It is a flowchart of a specific character recognition method in the implementation mode of the present application;
[0020] Figure 6 is a schematic diagram of the structure of a character recognition device in an embodiment of the present application;
[0021] Figure 7 is a schematic diagram of the structure of a character recognition device in an embodiment of the present application;
[0022] Figure 8 It is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples.
[0024] The present application provides a character recognition method, which recognizes the processed image frame by frame and performs cumulative voting on the same recognition results of the same character. The method can be used alone as a module in a character recognition system to output the algorithm results frame by frame without affecting the algorithm performance, thereby improving the accuracy of character recognition and the robustness of the output recognition results.
[0025] See also Figure 1 , Figure 1 It is a flow chart of a character recognition method in the embodiment of the present application. It should be noted that if there are substantially the same results, this embodiment is not based on Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:
[0026] S110: Acquire an image to be processed.
[0027] An image to be processed including multiple continuous frames of images is obtained, and the image to be processed contains characters. The image to be processed can be obtained by camera or surveillance photography, or can be called from a storage device. The image to be processed can be multiple continuous frames of images captured from a captured video, or can be multiple continuous frames of images to be processed captured by a camera.
[0028] S130: Recognize the characters in the current image to obtain a current recognition value.
[0029] The characters in the multiple frames of images are recognized respectively, the current image is a frame of image currently undergoing character recognition in the image to be processed, and the characters are recognized to obtain the current recognition value.
[0030] S150: Obtain a cache identification value set.
[0031] The image that has completed character recognition is cached as a cache image. The recognition value obtained by character recognition of the cache image is used as a cache recognition value, and all cache recognition values are used as a cache recognition value set, wherein the cache recognition value set includes a plurality of cache recognition values. The cache recognition value may be one or more. The cache recognition values of all cached images are obtained, that is, the cache recognition value set is obtained.
[0032] S170: Compare the current identification value with the cache identification value in the cache identification value set.
[0033] When recognizing the same character, the recognition results may be the same or different. Compare the current recognition value with the cache recognition value in the cache recognition value set to determine whether the current recognition value is the same as the cache recognition value. If the current image is the first frame image for character recognition, and the cache recognition value set does not contain the cache recognition value, the current image is directly cached, and the current recognition value is used as the cache recognition value, and the frequency is increased by one. If the current image is not the first frame image for character recognition, compare the current recognition value with the cache recognition value in the cache recognition value set. If the current recognition value is the same as the cache recognition value, the frequency of the cache recognition value that is the same as the current recognition value is increased by one. Otherwise, the current recognition value is added to the cache recognition value set as a new cache recognition value, and the frequency of the new cache recognition value is increased by one.
[0034] In this implementation, by recognizing the processed image frame by frame and performing cumulative voting on the same recognition results of the same character, the method can be used alone as a module in a character recognition system to output the algorithm results frame by frame without affecting the algorithm performance, thereby improving the accuracy of character recognition and the robustness of the output recognition results.
[0035] See also Figure 2 and Figure 3 , Figure 2 is a flow chart of another character recognition method in an embodiment of the present application, Figure 3 It is a flow chart of the character recognition module in the embodiment of the present application. It should be noted that if there are substantially the same results, this embodiment does not Figure 2 The process sequence shown is limited. Figure 2 As shown, this embodiment includes:
[0036] S210: Acquire an image to be processed.
[0037] An image to be processed including multiple continuous frames of images is obtained, and the image to be processed contains characters. The image to be processed can be obtained by camera or surveillance photography, or can be called from a storage device. The image to be processed can be multiple continuous frames of images captured from a captured video, or can be multiple continuous frames of images to be processed captured by a camera.
[0038] S220: Obtain the character line of the image.
[0039] Obtain the image to be processed of the current frame, use the character row detection module to obtain the character row detection frame of the current frame image, and use the character row tracking module to obtain the character row identifier of the character row detection frame. The character row identifier can be in the form of an ID, and the same character row has the same ID.
[0040] S230: Recognize each character in the character row to obtain a number of character recognition values.
[0041] The character row recognition module is used to recognize each character in the character row detection frame to obtain a number of character recognition values.
[0042] S240: Obtain a cache identification value set.
[0043] The image that has completed character recognition is cached as a cache image. The cache recognition values of all cached images are obtained, that is, a cache recognition value set is obtained. The cache recognition value set includes a plurality of cache recognition values.
[0044] S250: Compare the current identification value with the cached identification value in the cached identification value set.
[0045] A character identification verification module is used to detect character identifications of different images. When the character identifications of two character rows are the same, it is identified that the two character rows contain the same characters and character sequences. First, it is determined whether there is a cached identification value of a character row with the same identification as the current character row in the cached identification value set. In response to the existence of a cached identification value of a character row with the same identification as the current character row, a step of comparing the current identification value with the cached identification value in the cached identification value set is performed. The character voting module is used to vote on the character recognition results to compare whether there is a cached identification value that is the same as the current identification value. If there is a cached identification value that is the same as the current identification value, the frequency of the cached identification value is increased by one. If there is no cached identification value that is the same as the current identification value, the frequency of the current identification value is set to one.
[0046] In response to the absence of a cached recognition value for a character row with the same identifier as the current character row, the current recognition value is used as a character recognition result for the current character row.
[0047] S260: Obtain the cache recognition value with the highest frequency in the cache recognition value set, use the cache recognition value with the highest frequency as the character recognition result of each frame of image, and output the character recognition result of each frame of image frame by frame.
[0048] Get the frequency of all cached recognition values in the cached recognition value set, select the cached recognition value with the highest frequency as the character recognition result of the image character row under the current recognition result, and output the character recognition result. Output a character recognition result for each frame of image recognition. If the image to be processed includes multiple consecutive frames of images, multiple frames of recognition results will be output accordingly; if the current recognition value is the same as the recognition value with a higher frequency, it is equivalent to outputting the current recognition value. If the current recognition value is different from the recognition value with a higher frequency, use the higher frequency to replace the current recognition value output.
[0049] In this implementation, the image to be processed is recognized frame by frame, and a character verification step is added to determine whether the character row identifiers of different images are the same. When the character row identifiers are different, the recognition results are directly output to reduce the impact of recognition errors on subsequent output results. When the character row identifiers are the same, it is ensured that the same character row is used for subsequent comparisons. After that, cumulative voting is performed on the same recognition results of the same character. This method can be used alone as a module in a character recognition system to output algorithm results frame by frame without affecting algorithm performance, thereby improving the accuracy of character recognition and the robustness of the output recognition results.
[0050] If the character recognition results of the character row in the image to be processed support the calculation of the confidence of a single character, the confidence of the single character in the character row is calculated before comparing the current recognition value with the cached recognition value in the cached recognition value set. Figure 4 , Figure 4It is a flowchart of another character recognition method in the embodiment of the present application. It should be noted that if there are substantially the same results, this embodiment does not Figure 4 The process sequence shown is limited. Figure 4 As shown, this embodiment includes:
[0051] S410: Acquire an image to be processed.
[0052] An image to be processed including multiple continuous frames of images is obtained, and the image to be processed contains characters. The image to be processed can be obtained by camera or surveillance photography, or can be called from a storage device. The image to be processed can be multiple continuous frames of images captured from a captured video, or can be multiple continuous frames of images to be processed captured by a camera.
[0053] S420: Recognize the characters in the current image to obtain a current recognition value.
[0054] S430: Obtain a cache identification value set.
[0055] The image that has completed character recognition is cached as a cache image. The cache recognition values of all cached images are obtained, that is, a cache recognition value set is obtained. The cache recognition value set includes a plurality of cache recognition values.
[0056] S440: Obtain the confidence of the current character recognition value of the current character and the confidence of the corresponding cached character recognition value.
[0057] Calculate the confidence of the current character recognition value of the current character row, that is, obtain the confidence of the character recognition value of each character in the character row, obtain the confidence of the cached character recognition value of each character in the cached character row, and cache the confidence of the character recognition value of the current character row.
[0058] S450: Calculate the average confidence of the current character.
[0059] The confidence of each identical character in the current image and the cached image is averaged to obtain the average confidence of each character in the current character row.
[0060] S460: In response to the average confidence being less than the confidence threshold, comparing the current character recognition value of the current character with the cached character recognition value.
[0061] In this embodiment, a confidence threshold is pre-set. If the average confidence of the current character is less than the confidence threshold, it means that the accuracy of the current character recognition result is low. Then, the current character recognition value of the current character and the cached character recognition value are compared, and the character recognition result is used to vote and select the output character recognition result.
[0062] S470: In response to the average confidence being greater than or equal to the confidence threshold, taking the current character recognition value as the character recognition result of the current character.
[0063] If the average confidence of the current character is less than or equal to the confidence threshold, it means that the accuracy of the current character recognition result is high. The current character recognition value is directly used as the character recognition result of the current character, and the character row that has not been recognized subsequently does not need to be recognized again.
[0064] In this embodiment, by recognizing the processed image frame by frame, the confidence of each character is first calculated. When the confidence is high, the recognition result is directly obtained. When the confidence is low, cumulative voting is performed on the same recognition result of the same character. This method can be used as a module in a character recognition system alone, and the algorithm results are output frame by frame without affecting the algorithm performance, thereby improving the accuracy of character recognition and the robustness of the output recognition results.
[0065] In one embodiment, the image to be processed is a plurality of continuous frames of images captured from the video to be processed. Figure 5 , Figure 5 is a flowchart of a specific character recognition method in the embodiment of the present application. It should be noted that if there are substantially the same results, this embodiment is not based on Figure 5 The process sequence shown is limited. Figure 5 As shown, this embodiment includes:
[0066] S501: Acquire an image to be processed.
[0067] The video to be processed can be obtained by a camera or surveillance camera, or can be called from a storage device, and the video to be processed is divided into multiple frames of continuous images to obtain the image to be processed.
[0068] S502: Recognize characters in the first frame image, obtain the first frame image recognition value and output it.
[0069] Get the first frame image, use the detection module to get the detection box of the character row in the first frame image, use the tracking module to get the character string length and character row identifier, i.e., character row ID, use the recognition module to recognize the characters in the first frame image to obtain the first frame image recognition value and output it. At the same time, put the first frame image recognition value into the cache recognition value set, and set the frequency of the recognition value to 1.
[0070] S503: Recognize the characters in the second frame image to obtain a second frame image recognition value.
[0071] Similarly, the second frame image is obtained, and the character string length, character row ID and second frame image recognition value are obtained respectively.
[0072] S504: Determine whether the character line of the first frame image has the same identifier as the character line of the second frame image.
[0073] If the character line of the first frame image and the character line of the second frame image have the same identifier, step S505 is performed. If the character line of the first frame image and the character line of the second frame image have different identifiers, the recognition value of the second frame image is output.
[0074] S505: Determine whether the character line of the first frame image has the same character string length as the character line of the second frame image.
[0075] If the character line of the first frame image and the character line of the second frame image have the same character string length, step S506 is performed. If the character line of the first frame image and the character line of the second frame image have different character string lengths, the second frame image recognition value is output.
[0076] S506: Determine whether the character recognition result supports single character confidence calculation.
[0077] If the character recognition result of the character row in the image to be processed supports the calculation of the confidence of a single character, the confidence of the single character in the character row is calculated first, that is, step S507 is performed; if the character recognition result of the character row in the image to be processed does not support the calculation of the confidence of a single character, step S510 is performed.
[0078] S507: Calculate the average confidence of the current character.
[0079] Calculate the confidence of the current character recognition value of the character row of the second frame image, that is, obtain the confidence of the character recognition value of each character in the character row, obtain the confidence of the cached character recognition value of each character in the character row of the first frame image, and cache the confidence of the character recognition value of the character row of the second frame image. Average the confidence of each identical character in the first frame image and the second frame image to obtain the average confidence of each character in the current character row of the second frame image.
[0080] S508: Determine whether the average confidence level is less than a confidence level threshold.
[0081] In this embodiment, a confidence threshold is preset. If the average confidence of the current character is less than the confidence threshold, it means that the accuracy of the current character recognition result is low, and step S509 is performed. If the average confidence of the current character is less than or equal to the confidence threshold, it means that the accuracy of the current character recognition result is high, and step S510 is performed.
[0082] S509: Compare the current character recognition value of the second frame image with the character recognition value of the first frame image, and output the recognition value with the highest frequency as the character recognition result of the second frame image.
[0083] Compare the current character recognition value of the second frame image with the character recognition value of the first frame image to see if the character recognition values of the two images are the same. If they are the same, increase the frequency of the recognition value by one. If they are different, set the frequency of the current recognition value of the second frame image to 1.
[0084] The recognition value with the highest frequency is used as the character recognition result of the second frame image and output, and the recognition value of the second frame image is placed in the cache recognition value set. In one embodiment, if there are two or more recognition values with the same frequency, the two or more recognition values are output. In another embodiment, if there are two or more recognition values with the same frequency and support single character confidence calculation, the recognition value with the highest confidence is selected for output.
[0085] S510: The current character recognition value is used as the character recognition result of the current character and outputted.
[0086] The current character recognition value is used as the character recognition result of the current character and is outputted, and the character row that has not been recognized subsequently does not need to be recognized again.
[0087] When acquiring the third frame image, similarly, the third frame image is acquired, and the character string length, character row ID, and third frame image recognition value are acquired respectively. It is determined whether there is a cached recognition value of a character row with the same identifier as the current character row in the cached recognition value set, or it is determined whether the character string length of the character row with the same identifier as the current character row in the cached recognition value set is the same as the character string length of the current character row. In response to the absence of a cached recognition value of a character row with the same identifier as the current character row and / or in response to different character string lengths, the current recognition value is used as the character recognition result of the current character row. In response to the presence of a cached recognition value of a character row with the same identifier as the current character row and / or in response to the same character string lengths, the average confidence of the current character is calculated, and the average confidence is the average of the confidence of the current character recognition value and the confidence of the corresponding cached character recognition value. In response to the average confidence being less than the confidence threshold, the step of comparing the current recognition value with the cached recognition value in the cached recognition value set is performed. Compare the current character recognition value of the current character row with the cached character recognition value character by character, obtain the character recognition value with the highest frequency for each character, use the cached recognition value with the highest frequency as the character recognition result of the third frame image, and output the character recognition result of the third frame image. Increase the frequency of the cached recognition value that is the same as the previous recognition value by one, otherwise add the current recognition value as the new cached recognition value to the cached recognition value set, and set the frequency to 1.
[0088] In this embodiment, the image to be processed is recognized frame by frame, and a character verification step is added to determine whether the character row identifiers and string lengths of different images are the same. When the character row identifiers and string lengths are different, the recognition results are directly output to reduce the impact of recognition errors on subsequent output results. When the character row identifiers and string lengths are the same, it is ensured that the same character row is used for subsequent comparisons. The confidence of each character is then calculated. When the confidence is high, the recognition result is directly obtained. When the confidence is low, cumulative voting is performed on the same recognition results of the same character. This method can be used alone as a module in a character recognition system to output algorithm results frame by frame without affecting algorithm performance, thereby improving the accuracy of character recognition and the robustness of the output recognition results.
[0089] See also Figure 6 , Figure 6 6 is a schematic diagram of the structure of the character recognition device in the embodiment of the present application. In this embodiment, the character recognition device includes an acquisition module 61, a recognition module 62, a buffer module 63 and a comparison module 64.
[0090] The acquisition module 61 is used to acquire the image to be processed; the recognition module 62 is used to recognize the characters in the current image and obtain the current recognition value cache module 63 for obtaining the cache recognition value set; the comparison module 64 is used to compare the current recognition value with the cache recognition value in the cache recognition value set, and increase the frequency of the cache recognition value that is the same as the current recognition value by one, otherwise the current recognition value is added to the cache recognition value set as a new cache recognition value. The character recognition device is used to recognize the image to be processed frame by frame, and cumulatively vote for the same recognition results of the same character. The method can be used as a module in a character recognition system alone, outputting the algorithm results frame by frame, without affecting the algorithm performance, and improving the accuracy of character recognition and the robustness of the output recognition results.
[0091] See also Figure 7 , Figure 7 71 is a schematic diagram of the structure of a character recognition device in an embodiment of the present application. In this embodiment, the character recognition device 71 includes a processor 72 .
[0092] The processor 72 may also be referred to as a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip having signal processing capabilities. The processor 72 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 72 may also be any conventional processor, etc.
[0093] The character recognition device 71 may further include a memory (not shown in the figure) for storing instructions and data required for the processor 72 to run.
[0094] The processor 72 is used to execute instructions to implement the method provided by any embodiment of the character recognition method of the present application and any non-conflicting combination.
[0095] See also Figure 8 , Figure 8 It is a schematic diagram of the structure of the computer-readable storage medium in the embodiment of the present application. The computer-readable storage medium 81 of the embodiment of the present application stores instructions / program data 82, and when the instructions / program data 82 are executed, the method provided by any embodiment of the character recognition method of the present application and any non-conflicting combination is implemented. Among them, the instructions / program data 82 can form a program file and be stored in the above-mentioned storage medium 81 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of each embodiment method of the present application. The aforementioned storage medium 81 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, and a tablet.
[0096] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0098] The above description is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A character recognition method, characterized in that: The method comprises: Acquire an image to be processed, wherein the image to be processed includes a plurality of continuous frames of images; Recognize characters in a current image to obtain a current recognition value, wherein the current image is a frame of an image in which character recognition is currently being performed in the image to be processed; Acquire a cache recognition value set, wherein the cache recognition value set includes a plurality of cache recognition values, wherein the cache recognition value is a recognition value obtained by performing character recognition on a cache image, wherein the cache image is an image in the image to be processed for which character recognition has been completed; Compare the current identification value with the cache identification values in the cache identification value set, increase the frequency of the cache identification value that is the same as the current identification value by one, otherwise add the current identification value as a new cache identification value to the cache identification value set; The step of recognizing characters in the current image includes: Obtain a character row of the current image, where the character row is a row of characters in the current image; Recognize each character in the character row to obtain a number of character recognition values; The comparing the current identification value with the cache identification value in the cache identification value set includes: Obtaining a cache identification value corresponding to a current character row of the current image from the cache identification values; The current character recognition value of the current character row is compared with the cached character recognition value character by character to obtain the character recognition value with the highest frequency for each character.
2. The character recognition method according to claim 1, characterized in that: The method further comprises: Obtaining the cache identification value with the highest frequency in the cache identification value set; The cache recognition value with the highest frequency is used as the character recognition result of each frame of image, and the character recognition result of each frame of image is output frame by frame.
3. The character recognition method according to claim 1, characterized in that: The step of comparing the current character recognition value of the current character row with the cached character recognition value character by character includes: Obtain the confidence of the current character recognition value of the current character and the confidence of the corresponding cached character recognition value; Calculating an average confidence of the current character, the average confidence being an average of the confidence of the current character recognition value and the confidence of the corresponding cached character recognition value; In response to the average confidence being less than a confidence threshold, a current character recognition value of the current character is compared with a cached character recognition value.
4. The character recognition method according to claim 1, characterized in that: The step of comparing the current character recognition value of the current character row with the cached character recognition value character by character includes: Obtain the confidence of the current character recognition value of the current character and the confidence of the corresponding cached character recognition value; Calculating an average confidence of the current character, the average confidence being an average of the confidence of the current character recognition value and the confidence of the corresponding cached character recognition value; In response to the average confidence being greater than or equal to the confidence threshold, the step of comparing the current character recognition value of the current character with the cached character recognition value is not performed, and the current character recognition value is used as the character recognition result of the current character.
5. The character recognition method according to claim 1, characterized in that: The comparing the current identification value with the cache identification value in the cache identification value set includes the following: Get the character row identifier of the current character row; Determine whether there is a cached identification value of a character row with the same identifier as the current character row in the cached identification value set; In response to the presence of a cached identification value of a character row having the same identifier as the current character row, performing the step of comparing the current identification value with the cached identification values in the cached identification value set; In response to the absence of a cached recognition value of a character row with the same identifier as the current character row, the current recognition value is used as a character recognition result of the current character row.
6. The character recognition method according to claim 1, characterized in that: The comparing the current identification value with the cache identification value in the cache identification value set includes the following: Get the character line identifier and string length of the current character line; Determine whether the character string length of the character row having the same identifier as the current character row in the cache identification value set is the same as the character string length of the current character row; In response to the character strings being of the same length, performing the step of comparing the current identification value with the cache identification value in the cache identification value set; In response to the different lengths of the character strings, the current recognition value is used as a character recognition result of the current character row.
7. A character recognition device, characterized in that: It comprises a processor, wherein the processor is used to execute instructions to implement the character recognition method as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store instructions / program data, and the instructions / program data can be executed to implement the character recognition method as described in any one of claims 1-6.
Citation Information
Patent Citations
Character recognition method and system based on template character library
CN104992152A
Character recognition device and character recognition method
JP2010026805A