CN111353484A - Image character recognition method, device, equipment and readable storage medium - Google Patents

Image character recognition method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN111353484A
CN111353484A CN202010134747.1A CN202010134747A CN111353484A CN 111353484 A CN111353484 A CN 111353484A CN 202010134747 A CN202010134747 A CN 202010134747A CN 111353484 A CN111353484 A CN 111353484A
Authority
CN
China
Prior art keywords
recognition
result
text
character
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010134747.1A
Other languages
Chinese (zh)
Inventor
章放
邹雨晗
杨海军
徐倩
杨强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010134747.1A priority Critical patent/CN111353484A/en
Publication of CN111353484A publication Critical patent/CN111353484A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Discrimination (AREA)

Abstract

The invention discloses an image character recognition method, an image character recognition device, image character recognition equipment and a readable storage medium, and relates to the field of financial science and technology, wherein the method comprises the following steps: acquiring a plurality of text images to be analyzed corresponding to the text images to be recognized, recognizing text areas in the text images to be analyzed through an Optical Character Recognition (OCR) algorithm, and obtaining recognition results corresponding to the text images to be analyzed; respectively determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except the recognition target result, and correspondingly obtaining a comparison result corresponding to each recognition target result; and determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as the characters in the text image to be recognized. The invention improves the accuracy of image character recognition through an OCR algorithm.

Description

Image character recognition method, device, equipment and readable storage medium
Technical Field
The invention relates to the technical field of image processing of financial technology (Fintech), in particular to an image character recognition method, device, equipment and readable storage medium.
Background
With the development of computer technology, more and more technologies are applied in the financial field, the traditional financial industry is gradually changing to financial technology (Fintech), and the image processing technology is no exception, but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technology.
At present, characters in an image are mainly recognized through an OCR (Optical Character Recognition) technology, which is a commonly used Character Recognition technology, but the current OCR technology has reached a bottleneck, accuracy is difficult to be obviously improved, the bottleneck mainly comes from the fact that the OCR technology is performed on a single picture, and even if the OCR technology is performed on a video, the OCR algorithm is performed on some frames extracted from the video, so that the OCR algorithm is performed on the single picture essentially. All bottlenecks of a single picture are caused by the fact that the amount of information contained in a single picture is limited, and no more information can be obtained from the picture without the help of other information, so that the bottleneck of the OCR algorithm cannot be broken through in the case. Therefore, the recognition accuracy of the image character is low at present.
Disclosure of Invention
The invention mainly aims to provide an image character recognition method, an image character recognition device, image character recognition equipment and a readable storage medium, and aims to solve the technical problem that the recognition accuracy of the conventional image character is low.
In order to achieve the above object, the present invention provides an image character recognition method, including the steps of:
acquiring a plurality of text images to be analyzed corresponding to the text images to be recognized, recognizing text areas in the text images to be analyzed through an Optical Character Recognition (OCR) algorithm, and obtaining recognition results corresponding to the text images to be analyzed;
respectively determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except the recognition target result, and correspondingly obtaining a comparison result corresponding to each recognition target result;
and determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as the characters in the text image to be recognized.
Preferably, the step of determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except for the recognition target result, and obtaining a comparison result corresponding to each recognition target result includes:
respectively determining each recognition result as a recognition target result, and correspondingly determining each recognition result except the recognition target result in each recognition result as a recognition result to be compared;
and calculating result similarity between the recognition target result and each recognition result to be compared, and determining a comparison result corresponding to each recognition target result according to the result similarity.
Preferably, the step of calculating a result similarity between the recognition target result and each of the recognition results to be compared includes:
calculating a first similarity between the area coordinate in the recognition target result and the corresponding area coordinate in each recognition result to be compared;
determining characters to be identified corresponding to the area coordinates in the identification target result as first characters, and determining characters to be identified corresponding to the first characters in each identification result to be compared as second characters;
calculating a second similarity between the first character and the corresponding second character;
and correspondingly calculating to obtain the result similarity between the recognition target result and each recognition result to be compared according to the first similarity and the second similarity.
Preferably, the step of calculating a second similarity between the first character and the corresponding second character comprises:
calculating the character similarity between the first character and the corresponding second character, and acquiring a first confidence coefficient corresponding to the first character and a second confidence coefficient corresponding to the second character;
and calculating a confidence average degree between the first confidence degrees and the corresponding second confidence degrees, and determining the product of the confidence average degree and the character similarity degree as a second similarity degree between the first character and the corresponding second character.
Preferably, the step of correspondingly calculating result similarities between the recognition target result and each of the recognition results to be compared according to the first similarity and the second similarity includes:
acquiring a first weight corresponding to the first similarity and acquiring a second weight corresponding to the second similarity;
calculating the product of the first similarity and the first weight to obtain a first product, and calculating the product of the second similarity and the second weight to obtain a second product;
determining the sum of the first product and the second product as a result similarity between the recognition target result and each of the recognition results to be compared.
Preferably, the step of determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as characters in the text image to be recognized includes:
if the result similarity is larger than the preset similarity, determining a text region corresponding to the result similarity as a text target region belonging to the same text region in each text image to be analyzed;
and calculating the average confidence of each character corresponding to the same position in each text target region, determining the character corresponding to the maximum average confidence as a target character, and determining the target character as the character of the corresponding position of the text image to be recognized.
Preferentially, the step of identifying the text area in each text image to be analyzed through an OCR algorithm to obtain the identification result corresponding to each text image to be analyzed includes:
recognizing area coordinates corresponding to text areas in the text images to be analyzed through an OCR algorithm, determining characters to be recognized corresponding to the text areas in the text images to be analyzed, and determining confidence degrees corresponding to the characters to be recognized;
and obtaining the recognition result of each text image to be analyzed according to the region coordinate, the confidence coefficient and the character to be recognized.
Preferentially, after the step of determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result and determining the target characters as the characters in the text image to be recognized, the method further comprises:
and sending the characters in the text image to be recognized to a terminal corresponding to the text image to be recognized, so that the terminal can output the received characters after receiving the characters in the text image to be recognized.
Further, to achieve the above object, the present invention also provides an image character recognition apparatus comprising:
the acquisition module is used for acquiring a plurality of text images to be analyzed corresponding to the text images to be identified;
the recognition module is used for recognizing the text area in each text image to be analyzed through an Optical Character Recognition (OCR) algorithm to obtain a recognition result corresponding to each text image to be analyzed;
the determining module is used for determining each recognition result as a recognition target result;
the comparison module is used for comparing the recognition target result with all recognition results except the recognition target result to correspondingly obtain a comparison result corresponding to each recognition target result;
the determining module is further configured to determine, according to the comparison result, target characters corresponding to the same target text region in each text image to be analyzed, and determine the target characters as characters in the text image to be recognized.
In addition, in order to achieve the above object, the present invention also provides an image character recognition apparatus including a memory, a processor, and an image character recognition program stored on the memory and executable on the processor, the image character recognition program, when executed by the processor, implementing the steps of the image character recognition method corresponding to the federal learning server.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an image character recognition program which, when executed by a processor, implements the steps of the image character recognition method as described above.
The method comprises the steps of obtaining a plurality of text images to be analyzed corresponding to the text images to be recognized, recognizing text areas in the text images to be analyzed through an OCR algorithm, and obtaining recognition results corresponding to the text images to be analyzed; respectively determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except the recognition target result, and correspondingly obtaining a comparison result corresponding to each recognition target result; and correspondingly determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as the characters in the text image to be recognized. The characters in the text image to be recognized are recognized by comprehensively analyzing the OCR algorithm recognition result corresponding to each text image to be analyzed, the OCR algorithm recognition result of a single image is not relied on, and the accuracy of image character recognition through the OCR algorithm is improved.
Drawings
FIG. 1 is a flow chart of a first embodiment of an image character recognition method according to the present invention;
FIG. 2 is a flow chart of a third embodiment of the image character recognition method of the present invention;
FIG. 3 is a block diagram of an image character recognition apparatus according to a preferred embodiment of the present invention;
fig. 4 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides an image character recognition method, and referring to fig. 1, fig. 1 is a flowchart illustrating a first embodiment of the image character recognition method of the invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than presented herein.
The image character recognition method is applied to a server or a terminal, and the terminal may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Personal Digital Assistant (PDA), and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like. In the respective embodiments of the image character recognition method, the execution subject is omitted for convenience of description to explain the respective embodiments. The image character recognition method comprises the following steps:
step S10, obtaining a plurality of text images to be analyzed corresponding to the text images to be recognized, recognizing text areas in the text images to be analyzed through an Optical Character Recognition (OCR) algorithm, and obtaining recognition results corresponding to the text images to be analyzed.
When character recognition in an image is required, a plurality of text images to be analyzed corresponding to the text images to be recognized are obtained, specifically, the plurality of text images to be analyzed can be obtained in the process of shooting the text images to be recognized, and can also be generated together when the text images to be recognized are sent to other terminals. The content of the text image to be analyzed and the content of the text image to be recognized are the same. For example, in the process of shooting the text image to be recognized, when the user aligns the text image to be recognized with the camera, the camera can acquire a plurality of text images to be analyzed at different positions in the process of aligning the user. In the process of acquiring a plurality of text images to be analyzed, the user is not aware that the user acquires a plurality of text images to be analyzed besides the text image to be recognized. It should be noted that the text image to be recognized may be one of the text images to be analyzed, but the text image to be analyzed may not include the text image to be recognized. In this embodiment, the number of the text images to be analyzed may be set according to specific needs, for example, 5 text images to be analyzed, 8 text images to be analyzed, or 10 text images to be analyzed may be obtained.
And after obtaining a plurality of text images to be analyzed, recognizing the text area in each text image to be analyzed through an OCR algorithm, and correspondingly obtaining a recognition result corresponding to each text image to be analyzed. It should be noted that, in this embodiment, when a text image to be analyzed is acquired, the acquired text image to be analyzed is identified by an OCR algorithm, that is, the text image to be analyzed is identified by the OCR algorithm in real time; or after all the text images to be analyzed are acquired, carrying out OCR algorithm recognition on a plurality of text images to be analyzed together. In this embodiment, the recognition result includes, but is not limited to, a text region to be recognized and region coordinates corresponding to the text region, and it can be understood that the region coordinates include four coordinates of an upper coordinate, a lower coordinate, a left coordinate, and a right coordinate corresponding to the text region, and the text region includes at least one text character, that is, the text region includes at least one text.
Further, the step of identifying the text region in each text image to be analyzed by using an OCR algorithm to obtain the identification result corresponding to each text image to be analyzed includes:
step a, recognizing area coordinates corresponding to text areas in the text images to be analyzed through an OCR algorithm, determining characters to be recognized corresponding to the text areas in the text images to be analyzed, and determining confidence degrees corresponding to the characters to be recognized.
And b, correspondingly obtaining the recognition result of each text image to be analyzed according to the region coordinate, the confidence coefficient and the character to be recognized.
Further, after a plurality of text images to be analyzed are obtained, area coordinates corresponding to each text area in each text image to be analyzed are identified through an OCR algorithm, characters to be identified corresponding to each text area in the text image to be analyzed are determined, and confidence corresponding to each character to be identified is determined. It can be understood that one text image to be analyzed corresponds to at least one text region, one text region corresponds to 4 region coordinate points, one text region corresponds to at least one character to be recognized, and each character to be recognized has a corresponding confidence. The confidence is obtained in the process of recognizing the characters through the OCR algorithm, the higher the value of the confidence is, the higher the accuracy of the recognized characters is, in this embodiment, the value of the confidence is greater than or equal to 0 and less than or equal to 1.
It should be noted that, in order to improve the accuracy of character recognition, the coordinate system in each text image to be analyzed is established in the same manner, for example, each text image to be analyzed uses the center point of the image as the origin of coordinates, or each text image to be analyzed uses the lower left corner of the image as the origin of coordinates, and the unit lengths of the coordinate systems in each text image to be analyzed are also equal.
And after obtaining the region coordinates, the confidence degrees and the characters to be recognized corresponding to the text images to be analyzed, obtaining the recognition results of the text images to be analyzed according to the region coordinates, the confidence degrees and the characters to be recognized, namely determining the region coordinates, the confidence degrees and the characters to be recognized as one part of the recognition results of the text images to be analyzed. It should be noted that, in this embodiment, each text image to be analyzed has a unique image identifier, and the identification result carries an image identifier corresponding to the text image to be analyzed, and the identification result corresponding to each text image to be analyzed can be determined by using the image identifier. Each character to be recognized and the corresponding confidence coefficient thereof have an association relationship, so that the corresponding confidence coefficient or the character to be recognized can be determined only by determining one of the character to be recognized and the confidence coefficient through the association relationship. The character to be recognized and the corresponding text area have an association relationship, so that the text area corresponding to the character to be recognized can be determined according to the association relationship between the character to be recognized and the corresponding text area.
And step S20, determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except the recognition target result, and correspondingly obtaining a comparison result corresponding to each recognition target result.
After the recognition results corresponding to the text images to be analyzed are obtained, the recognition results can be respectively determined as recognition target results according to the sequence of the obtained recognition results, namely, the recognition results are sequentially determined as recognition target results, then the recognition target results are compared with the recognition results except the recognition target results, and corresponding results corresponding to the recognition target results are correspondingly obtained. Further, in the process of comparing the recognition target result with each recognition result except the recognition target result, in order to improve the efficiency of obtaining the comparison result, only the recognition target result may be compared with other recognition results that are not compared, that is, each recognition result is compared pairwise to obtain the comparison result.
Further, the step S20 includes:
and c, respectively determining each recognition result as a recognition target result, and correspondingly determining each recognition result except the recognition target result in each recognition result as a recognition result to be compared.
And d, calculating result similarity between the recognition target result and each recognition result to be compared, and determining a comparison result corresponding to each recognition target result according to the result similarity.
Specifically, the identification results are respectively determined as identification target results, the identification results except the identification target result in the identification results are correspondingly determined as identification results to be compared, result similarity between the identification target results and the identification results to be compared is calculated, and comparison results corresponding to the identification target results are determined according to the result similarity. It should be noted that, in calculating the result similarity, the result similarity between the recognition target result and each recognition result to be compared is calculated. In the process of calculating the similarity of the results, the similarity between the recognition target result and the coordinates of the same position area in the recognition result to be compared is calculated respectively, and the similarity between the recognition target result and the character to be recognized at the same position in the recognition result to be compared is calculated.
Further, the step of calculating the result similarity between the recognition target result and each of the recognition results to be compared includes:
and d1, calculating a first similarity between the region coordinates in the recognition target result and the corresponding region coordinates in each recognition result to be compared.
Step d2, determining the character to be identified in the recognition target result corresponding to the area coordinate as a first character, and determining the character to be identified in each recognition result to be compared corresponding to the first character as a second character.
And d3, calculating a second similarity between the first character and the corresponding second character.
And d4, correspondingly calculating according to the first similarity and the second similarity to obtain the result similarity between the recognition target result and each recognition result to be compared.
Further, a first similarity between the region coordinate in the recognition target result and the corresponding region coordinate in each recognition result to be compared is calculated, it can be understood that the positions of the region coordinates corresponding to the calculated first similarity are the same, and specifically, the first similarity may be calculated by an IOU (interaction over unit). Further, the first similarity may also be obtained by a coordinate difference between the region coordinate in the recognition target result and the corresponding region coordinate in each recognition result to be compared.
Determining characters to be recognized corresponding to the region coordinates in the recognition target result as first characters, determining characters to be recognized corresponding to the first characters in the recognition results of the bands as second characters, calculating a second similarity between the first characters and the second characters, and correspondingly calculating the similarity between the recognition target result and the recognition results of the bands according to the first similarity and the second similarity. Specifically, a similarity average value between the first similarity and the second similarity may be calculated, and the similarity average value is determined as a result similarity between the recognition target result and each comparison result to be recognized.
Specifically, in the present embodiment, the second similarity between the first character and the second character may be calculated by based on the edit distance of the character string and/or the length of the character string. It can be understood that if there is one recognition target result and 9 recognition results to be compared, there are 9 first similarities and 9 second similarities, and then the average value of the similarities between the 9 first similarities and the 9 second similarities is calculated to obtain the result similarity between the recognition target result and each recognition result to be compared, that is, the result similarity is the similarity between the recognition target result and all the recognition results to be compared.
For convenience of understanding, the present embodiment illustrates that, if the recognition target result is the i-th recognition result of the text image p1 to be analyzed, it is denoted as [ c1_ i, s1_ i ]; the identification result to be compared is the j-th identification result of the text image p2 to be analyzed, and is represented as [ c2_ j, s2_ j ], wherein c1_ i and c2_ j respectively represent sets of four coordinate points of text regions on p1 and p2, s1_ i and s2_ j respectively represent characters to be identified corresponding to the text regions represented by c1_ i and c2_ j, then the similarity of [ c1_ i, s1_ i ] and [ c2_ j, s2_ j ] is calculated, and when the similarity is calculated, the similarity of c1_ i and c2_ j is calculated to obtain a first similarity; and calculating the similarity of s1_ i and s2_ j to obtain a second similarity.
Step S30, determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as characters in the text image to be recognized.
And when the comparison result is obtained, correspondingly determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as characters in the text image to be recognized so as to recognize each character in the text image to be recognized.
Further, step S30 includes:
and e, if the result similarity is greater than the preset similarity, determining the text region corresponding to the result similarity as a text target region belonging to the same text region in each text image to be analyzed.
Specifically, after the comparison result is obtained, the result similarity between the recognition target result and each recognition result to be compared is obtained, and then whether the result similarity is greater than the preset similarity is determined, where the preset similarity may be preset according to specific needs, and the preset similarity is not specifically limited in this embodiment. In this embodiment, the resulting similarity is greater than or equal to 0 and less than or equal to 1, and at this time, the preset similarity may be set to 0.6, 0.8, or 0.85, etc. And if the similarity of the result is greater than the preset similarity, determining that the text region corresponding to the similarity of the result is a text target region belonging to the same text region in each text image to be analyzed. It should be noted that each recognition result corresponds to a text region, and when the similarity of the obtained result is greater than the preset similarity, the text regions corresponding to the similarity of the calculation result are considered to represent the same text region. In the above example, when the result similarity is greater than the preset similarity, [ c1_ i, s1_ i ] and [ c2_ j, s2_ j ] are considered to represent the same text region. Further, when the similarity of the determination result is smaller than or equal to the preset similarity, it is determined that the character recognition of the corresponding text region in the text image to be analyzed fails, that is, the character recognition of the position corresponding to the text region in the text image to be recognized fails.
And f, calculating the average confidence of the characters corresponding to the same position in each text target region, determining the character corresponding to the maximum average confidence as a target character, and determining the target character as the character of the corresponding position of the text image to be recognized.
It will be appreciated that there is a corresponding text target region in each text image to be analyzed. And after the text target areas are determined, acquiring characters corresponding to the same position in each text target area. It should be noted that, since the text image to be analyzed is photographed from different angles or different positions, there may be a plurality of different characters in the same position. And when the average confidence of each character corresponding to the same position in each text target region is obtained, determining the character corresponding to the maximum average confidence as a target character, and determining the target character as the character of the corresponding position of the text image to be recognized. If a certain position corresponds to 2 characters, wherein the A character exists in 2 text images to be analyzed, and the B character exists in 3 text images to be analyzed, the average confidence of the A character in the 2 text images to be analyzed is calculated, the average confidence of the B character in the 3 text images to be analyzed is calculated, and then the two average confidences are compared, so that the character at the position corresponding to the A character in the text image to be recognized is determined. And after the characters corresponding to all positions in the text image to be recognized are obtained, combining the obtained characters together to obtain all characters in the text image to be recognized.
In the embodiment, a plurality of text images to be analyzed corresponding to the text images to be recognized are obtained, and the text regions in the text images to be analyzed are recognized through an OCR algorithm, so that the recognition results corresponding to the text images to be analyzed are obtained; respectively determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except the recognition target result, and correspondingly obtaining a comparison result corresponding to each recognition target result; and correspondingly determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as the characters in the text image to be recognized. The characters in the text image to be recognized are recognized by comprehensively analyzing the OCR algorithm recognition result corresponding to each text image to be analyzed, the OCR algorithm recognition result of a single image is not relied on, and the accuracy of image character recognition through the OCR algorithm is improved.
Further, a second embodiment of the image character recognition method of the present invention is provided. The second embodiment of the image character recognition method is different from the first embodiment of the image character recognition method in that the step d3 includes:
step d31, calculating the character similarity between the first character and the corresponding second character, and obtaining the first confidence corresponding to the first character and the second confidence corresponding to the second character.
And d32, calculating the confidence average degree between the first confidence degree and the corresponding second confidence degree, and determining the product of the confidence average degree and the character similarity degree as the second similarity degree between the first character and the corresponding second character.
After the first character and the second character are determined, calculating the character similarity between the first character and the corresponding second character, and acquiring a first confidence coefficient corresponding to the first character and a second confidence coefficient corresponding to the second character. And after the first confidence coefficient and the second confidence coefficient are obtained, calculating the confidence average degree between the first confidence coefficient and the corresponding second confidence coefficient, namely calculating the sum of the confidence coefficients between the first confidence coefficient and the corresponding second confidence coefficient, and dividing the sum of the confidence coefficients by 2 to obtain the confidence average degree. It will be appreciated that, since each character has a corresponding confidence level, and each first character has a corresponding second character, there is a corresponding second confidence level for each first confidence level.
And after the confidence average degree corresponding to each first character is obtained through calculation, calculating the product between the confidence average degree and the character similarity, and determining the product between the confidence average degree and the character similarity as the second similarity between the first character and the corresponding second character.
In the process of calculating the second similarity, the second similarity is determined according to the confidence average and the character similarity, so that the accuracy of the calculated second similarity is improved, and the recognition accuracy of the characters in the text image is improved.
Further, the step d4 includes:
and d41, obtaining a first weight corresponding to the first similarity, and obtaining a second weight corresponding to the second similarity.
And d42, calculating the product of the first similarity and the first weight to obtain a first product, and calculating the product of the second similarity and the second weight to obtain a second product.
Step d43, determining the sum of the first product and the second product as the result similarity between the recognition target result and each of the recognition results to be compared.
Further, after the first similarity and the second similarity are obtained, a first weight corresponding to the first similarity is obtained, and a second weight corresponding to the second similarity is obtained. The sum of the first weight and the second weight is equal to 1, and the corresponding magnitude of the first weight and the second weight can be set according to specific needs, and the magnitude of the first weight and the magnitude of the second weight are not particularly limited in this embodiment.
And after the first weight and the second weight are obtained, calculating the product of the first similarity and the first weight to obtain a first product, calculating the product of the second similarity and the second weight to obtain a second product, calculating the sum of the first product and the second product, and determining the sum of the first product and the second product as the result similarity between the recognition target result and each result to be compared.
According to the method and the device, the result similarity between the recognition target result and each recognition result to be compared is obtained according to the preset weight, the first similarity and the second similarity, and the problem that the character recognition accuracy in the recognition text image is low due to the fact that the influence of the first similarity and the second similarity on the result similarity is not considered in the process of directly calculating the average value between the first similarity and the second similarity to obtain the result similarity is avoided. Therefore, the result similarity between the recognition target result and each recognition result to be compared is obtained according to the preset weight, the first similarity and the second similarity, and the character recognition accuracy in the recognition text image is improved.
Further, a third embodiment of the image character recognition method of the present invention is provided.
The third embodiment of the image character recognition method differs from the first and/or second embodiment of the image character recognition method in that, with reference to fig. 2, the image character recognition method further comprises:
step S40, sending the characters in the text image to be recognized to the terminal corresponding to the text image to be recognized, so that the terminal can output the received characters after receiving the characters in the text image to be recognized.
And after the characters in the text image to be recognized are recognized, the characters in the text image to be recognized are sent to the terminal corresponding to the text image to be recognized. The terminal can be a device for sending the text image to be recognized, and can also be a device for establishing communication connection for the image character recognition device. And after the terminal receives the characters in the text image to be recognized, the terminal outputs the characters in the text image to be recognized in a display interface of the terminal, namely outputs the received characters for a terminal user to view. Further, when the character recognition in the text image to be recognized fails, a failure message is sent to the terminal corresponding to the text image to be recognized. And when the terminal receives the failure message, the terminal outputs the failure message in a display interface of the terminal so as to prompt the terminal user that the character recognition in the text image to be recognized fails according to the failure message. Wherein, the terminal can output the failure message in the forms of characters or voice.
In the embodiment, after the characters in the text image to be recognized are recognized, the recognized characters are sent to the terminal, so that the terminal can output the recognized characters in the display interface, and a terminal user can know the characters in the text image to be recognized in time.
In addition, the present invention provides an image character recognition apparatus, which includes, with reference to fig. 3:
the acquiring module 10 is configured to acquire a plurality of text images to be analyzed corresponding to the text images to be recognized;
the recognition module 20 is configured to recognize a text region in each text image to be analyzed through an optical character recognition OCR algorithm to obtain a recognition result corresponding to each text image to be analyzed;
a determining module 30, configured to determine each recognition result as a recognition target result;
a comparison module 40, configured to compare the recognition target result with each recognition result except for the recognition target result, and obtain a comparison result corresponding to each recognition target result correspondingly;
the determining module 30 is further configured to determine, according to the comparison result, target characters corresponding to the same target text region in each text image to be analyzed, and determine the target characters as characters in the text image to be recognized.
Further, the comparison module 40 includes:
the first determining unit is used for correspondingly determining each recognition result except the recognition target result in each recognition result as a recognition result to be compared;
the first calculation unit is used for correspondingly determining each recognition result except the recognition target result in each recognition result as a recognition result to be compared;
the first determining unit is further configured to determine a comparison result corresponding to each recognition target result according to the result similarity.
Further, the first calculation unit includes:
the calculating subunit is used for calculating a first similarity between the area coordinate in the recognition target result and the corresponding area coordinate in each recognition result to be compared;
a determining subunit, configured to determine, as a first character, a character to be identified in the recognition target result that corresponds to the area coordinate, and determine, as a second character, a character to be identified in each recognition result to be compared that corresponds to the first character;
the computing subunit is further configured to compute a second similarity between the first character and the corresponding second character; and correspondingly calculating to obtain the result similarity between the recognition target result and each recognition result to be compared according to the first similarity and the second similarity.
Further, the computing subunit is further configured to compute a character similarity between the first character and the corresponding second character, and obtain a first confidence degree corresponding to the first character and a second confidence degree corresponding to the second character; and calculating a confidence average degree between the first confidence degrees and the corresponding second confidence degrees, and determining the product of the confidence average degree and the character similarity degree as a second similarity degree between the first character and the corresponding second character.
Further, the calculation subunit is further configured to obtain a first weight corresponding to the first similarity, and obtain a second weight corresponding to the second similarity; calculating the product of the first similarity and the first weight to obtain a first product, and calculating the product of the second similarity and the second weight to obtain a second product; determining the sum of the first product and the second product as a result similarity between the recognition target result and each of the recognition results to be compared.
Further, the determining module 30 includes:
the second determining unit is used for determining the text region corresponding to the result similarity as a text target region belonging to the same text region in each text image to be analyzed if the result similarity is greater than the preset similarity;
the second calculation unit is used for calculating the average confidence coefficient of each character corresponding to the same position in each text target area;
the second determining unit is further configured to determine a character corresponding to the maximum average confidence as a target character, and determine the target character as a character at a position corresponding to the text image to be recognized.
Further, the identification module 20 includes:
the recognition unit is used for recognizing area coordinates corresponding to the text areas in the text images to be analyzed through an OCR algorithm;
the third determining unit is used for determining characters to be recognized corresponding to text regions in the text image to be analyzed and determining confidence degrees corresponding to the characters to be recognized;
and the processing unit is used for correspondingly obtaining the recognition result of each text image to be analyzed according to the region coordinate, the confidence coefficient and the character to be recognized.
Further, the image character recognition apparatus includes:
and the sending module is used for sending the characters in the text image to be recognized to the terminal corresponding to the text image to be recognized so that the terminal can output the received characters after receiving the characters in the text image to be recognized.
The specific implementation of the image character recognition device of the present invention is basically the same as that of the above-mentioned embodiments of the image character recognition method, and is not described herein again.
In addition, the invention also provides image character recognition equipment. As shown in fig. 4, fig. 4 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 4 is a schematic structural diagram of a hardware operating environment of the image character recognition apparatus. The image character recognition device in the embodiment of the invention can be a terminal device such as a PC, a portable computer and the like.
As shown in fig. 4, the image character recognition apparatus may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the image character recognition device shown in FIG. 4 does not constitute a limitation of the image character recognition device, and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 4, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an image character recognition program. The operating system is a program for managing and controlling hardware and software resources of the image character recognition device, and supports the operation of the image character recognition program and other software or programs.
In the image character recognition apparatus shown in fig. 4, the user interface 1003 is mainly used for connecting a terminal corresponding to a text image to be recognized, and performing data communication with the terminal corresponding to the text image to be recognized; the network interface 1004 is mainly used for the background server and performs data communication with the background server; the processor 1001 may be configured to invoke an image character recognition program stored in the memory 1005 and perform the steps of the image character recognition method as described above.
The specific implementation of the image character recognition device of the present invention is basically the same as that of the above-mentioned embodiments of the image character recognition method, and is not described herein again.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where an image character recognition program is stored, and when executed by a processor, the image character recognition program implements the steps of the image character recognition method described above.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the image character recognition method described above, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. An image character recognition method, characterized by comprising the steps of:
acquiring a plurality of text images to be analyzed corresponding to the text images to be recognized, recognizing text areas in the text images to be analyzed through an Optical Character Recognition (OCR) algorithm, and obtaining recognition results corresponding to the text images to be analyzed;
respectively determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result except the recognition target result, and correspondingly obtaining a comparison result corresponding to each recognition target result;
and determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as the characters in the text image to be recognized.
2. The image character recognition method according to claim 1, wherein the step of determining each recognition result as a recognition target result, comparing the recognition target result with each recognition result other than the recognition target result, and obtaining a comparison result corresponding to each recognition target result comprises:
respectively determining each recognition result as a recognition target result, and correspondingly determining each recognition result except the recognition target result in each recognition result as a recognition result to be compared;
and calculating result similarity between the recognition target result and each recognition result to be compared, and determining a comparison result corresponding to each recognition target result according to the result similarity.
3. The image character recognition method according to claim 2, wherein the step of calculating the result similarity between the recognition target result and each of the recognition results to be compared includes:
calculating a first similarity between the area coordinate in the recognition target result and the corresponding area coordinate in each recognition result to be compared;
determining characters to be identified corresponding to the area coordinates in the identification target result as first characters, and determining characters to be identified corresponding to the first characters in each identification result to be compared as second characters;
calculating a second similarity between the first character and the corresponding second character;
and correspondingly calculating to obtain the result similarity between the recognition target result and each recognition result to be compared according to the first similarity and the second similarity.
4. The image character recognition method of claim 3, wherein the step of calculating a second similarity between the first character and the corresponding second character comprises:
calculating the character similarity between the first character and the corresponding second character, and acquiring a first confidence coefficient corresponding to the first character and a second confidence coefficient corresponding to the second character;
and calculating a confidence average degree between the first confidence degrees and the corresponding second confidence degrees, and determining the product of the confidence average degree and the character similarity degree as a second similarity degree between the first character and the corresponding second character.
5. The image character recognition method of claim 3, wherein the step of obtaining result similarities between the recognition target result and each of the recognition results to be compared by correspondingly calculating according to the first similarity and the second similarity comprises:
acquiring a first weight corresponding to the first similarity and acquiring a second weight corresponding to the second similarity;
calculating the product of the first similarity and the first weight to obtain a first product, and calculating the product of the second similarity and the second weight to obtain a second product;
determining the sum of the first product and the second product as a result similarity between the recognition target result and each of the recognition results to be compared.
6. The image character recognition method according to claim 2, wherein the step of determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as characters in the text image to be recognized, comprises:
if the result similarity is larger than the preset similarity, determining a text region corresponding to the result similarity as a text target region belonging to the same text region in each text image to be analyzed;
and calculating the average confidence of each character corresponding to the same position in each text target region, determining the character corresponding to the maximum average confidence as a target character, and determining the target character as the character of the corresponding position of the text image to be recognized.
7. The image character recognition method of claim 1, wherein the step of recognizing the text region in each text image to be analyzed by an OCR algorithm to obtain the recognition result corresponding to each text image to be analyzed comprises:
recognizing area coordinates corresponding to text areas in the text images to be analyzed through an OCR algorithm, determining characters to be recognized corresponding to the text areas in the text images to be analyzed, and determining confidence degrees corresponding to the characters to be recognized;
and obtaining the recognition result of each text image to be analyzed according to the region coordinate, the confidence coefficient and the character to be recognized.
8. The image character recognition method according to any one of claims 1 to 7, wherein after the step of determining target characters corresponding to the same target text region in each text image to be analyzed according to the comparison result, and determining the target characters as characters in the text image to be recognized, the method further comprises:
and sending the characters in the text image to be recognized to a terminal corresponding to the text image to be recognized, so that the terminal can output the received characters after receiving the characters in the text image to be recognized.
9. An image character recognition apparatus, characterized in that the image character recognition apparatus comprises:
the acquisition module is used for acquiring a plurality of text images to be analyzed corresponding to the text images to be identified;
the recognition module is used for recognizing the text area in each text image to be analyzed through an Optical Character Recognition (OCR) algorithm to obtain a recognition result corresponding to each text image to be analyzed;
the determining module is used for determining each recognition result as a recognition target result;
the comparison module is used for comparing the recognition target result with all recognition results except the recognition target result to correspondingly obtain a comparison result corresponding to each recognition target result;
the determining module is further configured to determine, according to the comparison result, target characters corresponding to the same target text region in each text image to be analyzed, and determine the target characters as characters in the text image to be recognized.
10. An image character recognition apparatus, characterized in that the image character recognition apparatus comprises a memory, a processor and an image character recognition program stored on the memory and executable on the processor, which image character recognition program, when executed by the processor, implements the steps of the image character recognition method as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon an image character recognition program which, when executed by a processor, implements the steps of the image character recognition method according to any one of claims 1 to 8.
CN202010134747.1A 2020-02-28 2020-02-28 Image character recognition method, device, equipment and readable storage medium Pending CN111353484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010134747.1A CN111353484A (en) 2020-02-28 2020-02-28 Image character recognition method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010134747.1A CN111353484A (en) 2020-02-28 2020-02-28 Image character recognition method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN111353484A true CN111353484A (en) 2020-06-30

Family

ID=71192434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010134747.1A Pending CN111353484A (en) 2020-02-28 2020-02-28 Image character recognition method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111353484A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112069890A (en) * 2020-07-31 2020-12-11 飞诺门阵(北京)科技有限公司 Method and device for identifying medicament label and storage medium
CN112163578A (en) * 2020-09-25 2021-01-01 深兰人工智能芯片研究院(江苏)有限公司 Method and system for improving OCR recognition rate
CN114170451A (en) * 2021-12-03 2022-03-11 京东科技信息技术有限公司 Text recognition method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8718365B1 (en) * 2009-10-29 2014-05-06 Google Inc. Text recognition for textually sparse images
CN105930836A (en) * 2016-04-19 2016-09-07 北京奇艺世纪科技有限公司 Identification method and device of video text
CN106203425A (en) * 2016-07-01 2016-12-07 北京旷视科技有限公司 Character identifying method and device
US20170330049A1 (en) * 2016-05-13 2017-11-16 Abby Development Llc Optical character recognition of series of images
US20190065877A1 (en) * 2017-08-25 2019-02-28 Abbyy Development Llc Using multiple cameras to perform optical character recognition
US20190102649A1 (en) * 2017-09-29 2019-04-04 Datamax-O'neil Corporation Methods for optical character recognition (ocr)
CN110059686A (en) * 2019-04-26 2019-07-26 腾讯科技(深圳)有限公司 Character identifying method, device, equipment and readable storage medium storing program for executing
WO2019174130A1 (en) * 2018-03-14 2019-09-19 平安科技(深圳)有限公司 Bill recognition method, server, and computer readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8718365B1 (en) * 2009-10-29 2014-05-06 Google Inc. Text recognition for textually sparse images
CN105930836A (en) * 2016-04-19 2016-09-07 北京奇艺世纪科技有限公司 Identification method and device of video text
US20170330049A1 (en) * 2016-05-13 2017-11-16 Abby Development Llc Optical character recognition of series of images
CN106203425A (en) * 2016-07-01 2016-12-07 北京旷视科技有限公司 Character identifying method and device
US20190065877A1 (en) * 2017-08-25 2019-02-28 Abbyy Development Llc Using multiple cameras to perform optical character recognition
US20190102649A1 (en) * 2017-09-29 2019-04-04 Datamax-O'neil Corporation Methods for optical character recognition (ocr)
WO2019174130A1 (en) * 2018-03-14 2019-09-19 平安科技(深圳)有限公司 Bill recognition method, server, and computer readable storage medium
CN110059686A (en) * 2019-04-26 2019-07-26 腾讯科技(深圳)有限公司 Character identifying method, device, equipment and readable storage medium storing program for executing

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112069890A (en) * 2020-07-31 2020-12-11 飞诺门阵(北京)科技有限公司 Method and device for identifying medicament label and storage medium
CN112163578A (en) * 2020-09-25 2021-01-01 深兰人工智能芯片研究院(江苏)有限公司 Method and system for improving OCR recognition rate
CN114170451A (en) * 2021-12-03 2022-03-11 京东科技信息技术有限公司 Text recognition method and device

Similar Documents

Publication Publication Date Title
US11074445B2 (en) Remote sensing image recognition method and apparatus, storage medium and electronic device
CN111353484A (en) Image character recognition method, device, equipment and readable storage medium
CN112101317B (en) Page direction identification method, device, equipment and computer readable storage medium
WO2019136897A1 (en) Image processing method, apparatus, electronic device and storage medium
CN114155546B (en) Image correction method and device, electronic equipment and storage medium
CN112100431B (en) Evaluation method, device and equipment of OCR system and readable storage medium
CN111209431A (en) Video searching method, device, equipment and medium
CN110675940A (en) Pathological image labeling method and device, computer equipment and storage medium
US9208392B2 (en) Methods and apparatus for progressive pattern matching in a mobile environment
CN116543404A (en) Table semantic information extraction method, system, equipment and medium based on cell coordinate optimization
CN111553251A (en) Certificate four-corner incomplete detection method, device, equipment and storage medium
WO2022100376A1 (en) Text paragraph structure restoration method and apparatus, and device and computer storage medium
CN112381010A (en) Table structure restoration method, system, computer equipment and storage medium
US10740644B2 (en) Method and system for background removal from documents
CN111476275A (en) Target detection method based on picture recognition, server and storage medium
JP6736988B2 (en) Image retrieval system, image processing system and image retrieval program
CN114332925A (en) Method, system and device for detecting pets in elevator and computer readable storage medium
CN107992872B (en) Method for carrying out text recognition on picture and mobile terminal
CN115131693A (en) Text content identification method and device, computer equipment and storage medium
CN111090651A (en) Data source processing method, device and equipment and readable storage medium
CN111598128A (en) Control state identification and control method, device, equipment and medium of user interface
CN113255629B (en) Document processing method and device, electronic equipment and computer readable storage medium
CN114463242A (en) Image detection method, device, storage medium and device
CN110991270B (en) Text recognition method, device, electronic equipment and storage medium
CN113538291B (en) Card image inclination correction method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination