A text recognition method and device, electronic equipment and storage medium

CN115761761BActive Publication Date: 2026-09-08WANGYIYOUDAO INFORMATION TECH BEIJING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211535578.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2026-09-08
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

[0004]为此,非常需要一种改进的方法,以解决现有技术中无法进行段落层级结构进行识别的问题

Benefits of technology

[0037]This method detects paragraphs in the jigsaw puzzle image to obtain the target image and its paragraph information, thus enabling the text recognition results to carry paragraph information and providing recognition results with a paragraph hierarchy structure, bringing a better user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761761B_ABST
    Figure CN115761761B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a text recognition method and device, electronic equipment and storage medium. The method comprises: performing paragraph detection on a jigsaw image to obtain at least one target image; the target image carries paragraph information, and different target images correspond to different paragraph information; performing detection line cutting on the target image to obtain a text line corresponding to the paragraph information; performing character recognition on all text lines to obtain a target character recognition result corresponding to each text line, and a set of all target character recognition results is taken as a recognition result of the jigsaw image; the target character recognition result carries paragraph information. The method performs paragraph detection on the jigsaw image to obtain the target image and the paragraph information of the target image, so that the character recognition result carries the paragraph information, and a recognition result with a paragraph hierarchical structure can be provided, thereby bringing a better experience to the user. In addition, embodiments of the present application provide a text recognition device, electronic equipment and storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of text recognition technology, and more specifically, the embodiments of the present invention relate to a text recognition method, apparatus, electronic device and storage medium. Background Technology

[0002] This section is intended to provide background or context for embodiments of the invention as set forth in the claims. The description herein is not intended to imply that it is prior art simply because it is included in this section.

[0003] As a common learning tool for contemporary students, dictionary pens simplify the process of looking up words and sentences by scanning and looking up information instantly, greatly improving learning efficiency. However, current dictionary pens cannot display the paragraph structure information of the scanned content, nor can they provide recognition results with paragraph hierarchy; they can only provide single-line or multi-line text information. Summary of the Invention

[0004] Therefore, there is a great need for an improved method to address the problem that existing technologies cannot identify paragraph hierarchical structures.

[0005] In this context, embodiments of the present invention are intended to provide a text recognition method, apparatus, electronic device, and storage medium.

[0006] In a first aspect of the present invention, a text recognition method is provided, comprising: performing paragraph detection on a jigsaw puzzle image to obtain at least one target image; wherein the target image carries paragraph information, and different target images correspond to different paragraph information;

[0007] The target image is processed by line detection and segmentation to obtain the text lines corresponding to the paragraph information;

[0008] Character recognition is performed on all the text lines to obtain the target character recognition result corresponding to each text line. The set of all the target character recognition results is used as the recognition result of the jigsaw puzzle image; the target character recognition result carries the paragraph information.

[0009] In one embodiment of the present invention, after performing character recognition on all the text lines to obtain the target character recognition result corresponding to each text line, and using the set of all the target character recognition results as the recognition result of the jigsaw puzzle image, the method further includes:

[0010] The recognition results are displayed according to the paragraph information.

[0011] In another embodiment of the present invention, segment detection is performed on the jigsaw puzzle image to obtain at least one target image, including:

[0012] Perform segment detection on the jigsaw puzzle image to obtain at least one first image;

[0013] Obtain the redundancy threshold of the first image; the redundancy threshold is used to characterize the probability that the first image contains a redundant paragraph bar, and the value of the redundancy threshold is inversely proportional to the probability of containing a redundant paragraph bar.

[0014] The first image with a redundancy threshold greater than a first preset threshold is used as the target image;

[0015] In another embodiment of the present invention, the target images are at least two, and after performing segment detection on the jigsaw puzzle image to obtain at least one target image, the method includes:

[0016] Obtain the X-axis coordinate information of each target image in the jigsaw puzzle image;

[0017] Determine that at least two target images whose intersection of X-axis coordinate information is greater than a second preset threshold belong to the same column in the X-axis direction, and obtain a column division result; the column division result is used to display the target text recognition results belonging to the same column according to the paragraph information after obtaining the target text recognition result corresponding to each text line;

[0018] In another embodiment of the present invention, character recognition is performed on all the text lines to obtain the target character recognition result corresponding to each text line. For any one of the text lines, the method includes:

[0019] Perform character recognition on the text line to obtain the first character recognition result corresponding to the text line;

[0020] Remove incomplete lines from the first character recognition result to obtain the target character recognition result corresponding to the text line;

[0021] In another embodiment of the present invention, removing incomplete lines from the first character recognition result to obtain the target character recognition result corresponding to the text line includes:

[0022] Obtain the edge rows in the first character recognition result; the edge rows are located at the edges of the first character recognition result;

[0023] If the confidence information of the edge line is less than the third preset threshold, the edge line is removed as an incomplete line to obtain the target text recognition result corresponding to the text line;

[0024] In another embodiment of the present invention, the confidence information includes character confidence and punctuation confidence;

[0025] If the confidence information of the edge line is less than a third preset threshold, the edge line is removed as an incomplete line to obtain the target text recognition result corresponding to the text line, including:

[0026] If the number of punctuation marks in the edge row is greater than the fourth preset threshold, the edge row with the character confidence score less than the third preset threshold is removed as an incomplete row to obtain the target character recognition result corresponding to the text row;

[0027] or,

[0028] If the number of punctuation marks in the edge row is less than or equal to the fourth preset threshold, the edge row with the character confidence score less than the third preset threshold and the punctuation confidence score less than the third preset threshold is removed as an incomplete row, and the target character recognition result corresponding to the text row is obtained.

[0029] In a second aspect of the present invention, a text recognition device is provided, comprising:

[0030] The first acquisition module is used to perform paragraph detection on the jigsaw puzzle image and acquire at least one target image; the target image carries paragraph information, and different target images correspond to different paragraph information.

[0031] The second acquisition module is used to detect and slice the target image to obtain the text lines corresponding to the paragraph information;

[0032] The recognition module is used to perform character recognition on all the text lines to obtain the target character recognition result corresponding to each text line, and the set of all the target character recognition results is used as the recognition result of the jigsaw puzzle image; the target character recognition result carries the paragraph information.

[0033] In a third aspect of the present invention, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.

[0034] Memory, used to store computer programs;

[0035] When a processor executes a program stored in memory, it implements the steps of the text recognition method described in any embodiment of the first aspect.

[0036] In a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the text recognition method as described in any embodiment of the first aspect.

[0037] This method detects paragraphs in the jigsaw puzzle image to obtain the target image and its paragraph information, thus enabling the text recognition results to carry paragraph information and providing recognition results with a paragraph hierarchy structure, bringing a better user experience. Attached Figure Description

[0038] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein:

[0039] Figure 1 A system architecture diagram of a text recognition method according to an embodiment of the present invention is shown schematically;

[0040] Figure 2 A schematic flowchart of a text recognition method according to an embodiment of the present invention is shown.

[0041] Figure 3 A schematic flowchart of a text recognition method according to another embodiment of the present invention is shown.

[0042] Figure 4 A schematic diagram of paragraph detection according to another embodiment of the present invention is shown;

[0043] Figure 5 A schematic diagram illustrating segmentation using a segment detection method according to another embodiment of the present invention is shown.

[0044] Figure 6 A schematic diagram illustrating the removal of redundant columns in a column processing method according to another embodiment of the present invention is shown.

[0045] Figure 7 A schematic diagram illustrating column processing carrying paragraph information according to another embodiment of the present invention is shown.

[0046] Figure 8 A schematic diagram of the structure of a text recognition device according to an embodiment of the present invention is shown.

[0047] Figure 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown.

[0048] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0049] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0050] According to embodiments of this disclosure, a text recognition method, apparatus, electronic device, and storage medium are proposed.

[0051] In this article, it is important to understand that any number of elements in the accompanying figures is for illustrative purposes and not for limitation, and any naming is for distinction only and has no limiting meaning.

[0052] The principles and spirit of this application will be explained in detail below with reference to several representative embodiments of this disclosure. Invention Overview

[0054] The present disclosure aims to provide a text recognition method, apparatus, electronic device, and storage medium to solve the problem that existing technologies cannot recognize paragraph hierarchical structures.

[0055] Currently, when users scan content using devices equipped with image acquisition mechanisms (such as cameras), such as dictionary pens, they can only obtain single or multiple lines of text information. The recognized text information cannot be displayed according to the original paragraph hierarchy of the scanned content.

[0056] To address the problems existing in the prior art, this disclosure provides a text recognition method, apparatus, electronic device, and storage medium. The method involves performing paragraph detection on a jigsaw puzzle image to obtain at least one target image; each target image carries paragraph information, with different target images corresponding to different paragraph information; the target image is then segmented to obtain text lines corresponding to the paragraph information; character recognition is performed on all text lines to obtain target character recognition results for each text line; the set of all target character recognition results serves as the recognition result for the jigsaw puzzle image; and each target character recognition result carries the paragraph information. This allows the text recognition result to carry paragraph information, providing a recognition result with a paragraph hierarchy structure and offering a better user experience.

[0057] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention will be described in detail below.

[0058] Application Scenarios Overview

[0059] First refer to Figure 1 , Figure 1The diagram shows a system architecture for a text recognition method. This system architecture includes at least an image acquisition device 101 and a data processing device 102, which establish a communication connection. Specifically, this system architecture can be a dictionary pen.

[0060] This method can be applied to the data processing device 102 in the dictionary pen. The image acquisition device 101 can be the detection head or scanning head of the dictionary pen, and the data processing device 102 can be the processor inside the dictionary pen or the processor in the cloud, without limitation.

[0061] Exemplary methods

[0062] The following is combined with Figure 1 Application scenarios, refer to Figure 2 This document describes a text recognition method according to an exemplary embodiment of the present invention. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of the invention, and the embodiments of the invention are not limited in any way. Rather, the embodiments of the invention can be applied to any applicable scenario.

[0063] This application discloses a text recognition method, such as... Figure 2 ,include:

[0064] Step 201: Perform paragraph detection on the jigsaw puzzle image to obtain at least one target image. The target image carries paragraph information, and different target images correspond to different paragraph information.

[0065] Step 202: Detect and segment the target image to obtain the text lines corresponding to the paragraph information;

[0066] Step 203: Perform character recognition on all text lines to obtain the target character recognition result for each text line. The set of all target character recognition results is used as the recognition result of the jigsaw puzzle image. The target character recognition result carries paragraph information.

[0067] In this embodiment, by performing paragraph detection on the jigsaw puzzle image, the target image and its paragraph information are obtained, enabling the text recognition result to carry paragraph information and providing a recognition result with a paragraph hierarchy structure, thus bringing a better user experience. The paragraph information represents the original paragraph hierarchy structure of the scanned content.

[0068] Of course, after providing recognition results with paragraph hierarchical structure, the recognition results can also be displayed according to paragraph information. The text recognition results can be displayed on the dictionary pen's display interface according to the original paragraph hierarchical structure of the scanned content, improving the user experience of the dictionary pen.

[0069] When performing paragraph detection, redundant images in the jigsaw puzzle image can be removed first to reduce unnecessary computation.

[0070] In one embodiment, performing paragraph detection on a jigsaw puzzle image to obtain at least one target image includes: performing paragraph detection on the jigsaw puzzle image to obtain at least one first image, obtaining a redundancy threshold for the first image, the redundancy threshold being used to characterize the probability that the first image contains a redundant paragraph column, the value of the redundancy threshold being inversely proportional to the probability of containing a redundant paragraph column, and using the first image with a redundancy threshold greater than a first preset threshold as the target image.

[0071] In this embodiment, the jigsaw puzzle image can be an image of the content to be scanned, captured by the tip of a dictionary pen. The tip of the dictionary pen can scan multiple lines of content at once. For at least one first image identified from the jigsaw puzzle image, a redundancy threshold is obtained for the first image. When the redundancy threshold is greater than a first preset threshold, it indicates that the first image is a normal image that needs to be recognized; otherwise, it indicates that the first image contains redundant paragraph bars and needs to be removed. By removing redundant paragraph bars, unnecessary calculation processes can be reduced, the recognition speed of the dictionary pen can be improved, and efficiency can be increased.

[0072] In one embodiment, there are at least two target images. After performing paragraph detection on the jigsaw puzzle image to obtain at least one target image, the method includes: obtaining the X-axis coordinate information of each target image in the jigsaw puzzle image, determining that at least two target images whose intersection of X-axis coordinate information is greater than a second preset threshold in the X-axis direction belong to the same column, and obtaining a column division result. The column division result is used to display the target text recognition results belonging to the same column according to paragraph information after obtaining the target text recognition result corresponding to each text line.

[0073] In this embodiment, when the scanned content is a newspaper or periodical containing multiple columns of text, the scanned jigsaw puzzle image can be divided into columns first, and only the target text recognition results of the same column are displayed. Specifically, to determine whether they belong to the same column, the coordinate information of the target image in the jigsaw puzzle image can be used. For example, a coordinate system of the jigsaw puzzle image can be constructed. During paragraph detection, each target image in the jigsaw puzzle image has coordinate information in this coordinate system. Since text is generally horizontally formatted, whether the target images belong to the same column can be determined by whether there is an intersection between the X-axis coordinate information of the target images. Of course, whether there is an intersection can be determined by whether the intersection of the two is greater than a second preset threshold. The specific value of the second preset threshold is not limited and can be set as needed. In addition, the target text recognition results of the same column are still displayed according to paragraph information to provide recognition results with a paragraph hierarchy structure.

[0074] When a dictionary pen scans multiple lines, the resulting jigsaw puzzle image may contain incomplete lines. These incomplete lines can be removed during text line recognition. The method includes: performing character recognition on the text line to obtain the first character recognition result corresponding to the text line; removing the incomplete lines from the first character recognition result to obtain the target character recognition result corresponding to the text line.

[0075] Generally, incomplete lines exist at the edge of the jigsaw puzzle image. Specifically, removing incomplete lines from the first character recognition result to obtain the target character recognition result corresponding to the text line includes: obtaining edge lines in the first character recognition result, where the edge lines are located at the edge of the first character recognition result; if the confidence information of the edge lines is less than a third preset threshold, the edge lines are removed as incomplete lines to obtain the target character recognition result corresponding to the text line.

[0076] In this embodiment, when each text line is recognized, each line of the first text recognition result corresponds to a confidence level. The higher the confidence level, the higher the accuracy of text recognition. A third preset threshold for the confidence level can be preset. If the confidence level is lower than the third preset threshold, it indicates that the text line is incomplete and should be removed to improve the accuracy of the text recognition result.

[0077] Specifically, the confidence information includes character confidence and punctuation confidence.

[0078] If the confidence information of the edge line is less than the third preset threshold, the edge line is removed as an incomplete line to obtain the target text recognition result corresponding to the text line, including the following two cases.

[0079] In the first scenario, if the number of punctuation marks in the edge lines exceeds the fourth preset threshold, edge lines with character confidence scores less than the third preset threshold are removed as incomplete lines, yielding the target text recognition result for the corresponding text line. In this case, if the number of punctuation marks in the edge lines is large (greater than the fourth preset threshold), to ensure more accurate edge line recognition, the punctuation confidence score can be ignored, and recognition can be performed solely based on character confidence scores. Of course, the fourth preset threshold can be set as needed without restriction.

[0080] In the second scenario, if the number of punctuation marks in the edge lines is less than or equal to the fourth preset threshold, edge lines with both character confidence scores and punctuation confidence scores less than the third preset threshold are removed as incomplete lines, resulting in the target text recognition result for the corresponding text line. In this case, when the number of punctuation marks in the edge lines is small, the determination of whether an edge line is incomplete can be based on both character confidence scores and punctuation confidence scores, thereby improving the recognition accuracy in this scenario.

[0081] The text recognition method will now be described using a specific example.

[0082] like Figure 3 First, the jigsaw puzzle algorithm is subjected to paragraph detection based on the YOLOX detection algorithm to segment the paragraph structure. If any redundant paragraph columns are accidentally scanned, they are removed. Then, text detection and line segmentation correction are performed on the image after redundancy removal to obtain text lines. Combining the information from paragraph detection and text detection, the text lines are divided into different paragraphs, and these text lines are fed into a text recognition model to obtain text recognition results. Finally, based on the confidence information provided by the recognition model and the text position information provided by the detection model, incomplete lines are removed. Finally, a complete line recognition result with paragraph hierarchy information is returned.

[0083] The following explains the specific details of some of the modules used in this method:

[0084] Paragraph detection module

[0085] The main function of this module is to detect paragraphs in the scanned puzzle for subsequent structured analysis. In deep learning methods, layout structuring methods, based on the development of object detection and segmentation methods, are mainly divided into top-down and bottom-up approaches. In the technical design of the dictionary pen in this embodiment, to balance speed and accuracy, a top-down strategy is adopted based on advanced object detection methods to design and develop a paragraph detection method for scanning scenarios, such as... Figure 4 . Figure 5 This diagram illustrates the application of the paragraph detection method to paragraph detection, demonstrating its ability to achieve accurate paragraph detection. Thanks to the strategy of decoupling the detection head and classification head, as well as advanced label matching methods, this method exhibits robust performance across various scenarios, including student textbooks, children's books, and newspapers.

[0086] Column processing module

[0087] In scenarios involving scanning multi-column text content such as newspapers, if a user mistakenly scans parts of other columns, redundant content may be identified, negatively impacting the user experience. Therefore, this application designs support for multi-column scenarios and functions to handle redundant columns.

[0088] Specifically, paragraphs whose X-axis coordinates intersect are considered to be in the same column, and these intersecting paragraphs are merged to obtain the final column structure. Redundant text columns are removed, such as... Figure 6 This makes the detection module operate more efficiently and improves the user experience. Figure 7 This is a diagram illustrating how the recognition results within the same column contain paragraph information after column processing.

[0089] Incomplete line filtering module

[0090] When performing multi-line scanning, users may accidentally scan lines with incomplete top and bottom edges of the image. This application mainly uses the following solution:

[0091] Add logic to remove punctuation when counting low-confidence characters to avoid removing complete lines with many punctuation marks. Set adaptive confidence thresholds for printed / handwritten cases to improve filtering accuracy on Chinese and English handwritten cases. Filter incomplete cases with high confidence by line height and text position.

[0092] It should be noted that the recognition effect shown in the accompanying drawings in this embodiment is for illustrative purposes only. In reality, the display interface of the dictionary pen shows the final recognition result after recognition.

[0093] Exemplary device

[0094] After introducing the method of exemplary embodiments of the present invention, the following references are made. Figure 8 Based on the same inventive concept as the above-described text recognition method embodiment, this application embodiment also provides a text recognition device, the text recognition device comprising:

[0095] The first acquisition module 801 is used to perform paragraph detection on the jigsaw puzzle image and acquire at least one target image; the target image carries paragraph information, and different target images correspond to different paragraph information.

[0096] The second acquisition module 802 is used to detect and slice the target image to obtain the text lines corresponding to the paragraph information;

[0097] The recognition module 803 is used to perform character recognition on all the text lines to obtain the target character recognition result corresponding to each text line, and the set of all the target character recognition results is used as the recognition result of the jigsaw puzzle image; the target character recognition result carries the paragraph information.

[0098] This device performs paragraph detection on the jigsaw puzzle image to obtain the target image and its paragraph information, enabling the text recognition results to carry paragraph information and providing recognition results with paragraph hierarchy structure, thus bringing a better user experience. The paragraph information represents the original paragraph hierarchy structure of the scanned content.

[0099] like Figure 9 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0100] Memory 113 is used to store computer programs;

[0101] In one embodiment, when the processor 111 executes a program stored in the memory 113, it implements a text recognition method provided in any of the foregoing method embodiments, including:

[0102] Segment detection is performed on the jigsaw puzzle image to obtain at least one target image; the target image carries segment information, and different target images correspond to different segment information.

[0103] The target image is detected and segmented to obtain the text lines corresponding to the paragraph information; character recognition is performed on all the text lines to obtain the target character recognition result corresponding to each text line, and the set of all the target character recognition results is used as the recognition result of the jigsaw puzzle image; the target character recognition result carries the paragraph information.

[0104] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0105] The communication interface is used for communication between the aforementioned terminal and other devices.

[0106] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0107] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0108] It should be noted that although several devices or sub-devices for text recognition have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more devices described above can be embodied in one device. Conversely, the features and functions of one device described above can be further divided and embodied by multiple devices.

[0109] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0110] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine that, when executed by a computer or other programmable data processing device, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0111] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce a product comprising an instruction apparatus that implements the functions / operations specified in the boxes of a flowchart and / or block diagram.

[0112] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable apparatus can provide a process for implementing the functions / operations specified in the boxes of a flowchart and / or block diagram.

[0113] The use of the verbs "including" and "contains" and their inflections in the application documents does not preclude the existence of elements or steps other than those described in the application documents. The article "a" or "one" preceding an element does not preclude the existence of multiple such elements.

[0114] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be interpreted in the broadest sense, thereby encompassing all such modifications and equivalent structures and functions.

Claims

1. A text recognition method, characterized in that, The method includes: Segment detection is performed on the jigsaw puzzle image to obtain at least one target image; the target image carries segment information, and different target images correspond to different segment information. The target image is processed by line detection and segmentation to obtain the text lines corresponding to the paragraph information; Character recognition is performed on all the text lines to obtain the target character recognition result corresponding to each text line. The set of all the target character recognition results is used as the recognition result of the jigsaw puzzle image; the target character recognition result carries the paragraph information. The method involves performing character recognition on all the text lines to obtain the target character recognition result for each text line. For any one of the text lines, the method includes: Perform character recognition on the text line to obtain the first character recognition result corresponding to the text line; Remove incomplete lines from the first character recognition result to obtain the target character recognition result corresponding to the text line; Specifically, removing incomplete lines from the first character recognition result to obtain the target character recognition result corresponding to the text line includes: Obtain the edge rows in the first character recognition result; the edge rows are located at the edges of the first character recognition result; If the confidence information of the edge line is less than the third preset threshold, the edge line is removed as an incomplete line to obtain the target text recognition result corresponding to the text line; The confidence information includes character confidence and punctuation confidence; the punctuation confidence is used to assess whether an edge line with a number of punctuation marks less than or equal to a fourth preset threshold is an incomplete line. If the confidence information of the edge line is less than a third preset threshold, the edge line is removed as an incomplete line to obtain the target text recognition result corresponding to the text line, including: If the number of punctuation marks in the edge row is greater than the fourth preset threshold, the edge row with the character confidence score less than the third preset threshold is removed as an incomplete row to obtain the target character recognition result corresponding to the text row; If the number of punctuation marks in the edge row is less than or equal to the fourth preset threshold, the edge row with the character confidence score less than the third preset threshold and the punctuation confidence score less than the third preset threshold is removed as an incomplete row, and the target character recognition result corresponding to the text row is obtained.

2. The method according to claim 1, characterized in that, After performing character recognition on all the text lines to obtain the target character recognition result corresponding to each text line, and using the set of all the target character recognition results as the recognition result of the jigsaw puzzle image, the method further includes: The recognition results are displayed according to the paragraph information.

3. The method according to claim 1, characterized in that, Perform segment detection on the jigsaw puzzle image to obtain at least one target image, including: Perform segment detection on the jigsaw puzzle image to obtain at least one first image; Obtain the redundancy threshold of the first image; the redundancy threshold is used to characterize the probability that the first image contains a redundant paragraph bar, and the value of the redundancy threshold is inversely proportional to the probability of containing a redundant paragraph bar. The first image with a redundancy threshold greater than a first preset threshold is taken as the target image.

4. The method according to claim 1, characterized in that, The target images are at least two. After performing segment detection on the jigsaw puzzle image to obtain at least one target image, the method includes: Obtain the X-axis coordinate information of each target image in the jigsaw puzzle image; In the X-axis direction, at least two target images whose intersection of X-axis coordinate information is greater than a second preset threshold belong to the same column, and a column division result is obtained. The column division result is used to display the target text recognition results belonging to the same column according to the paragraph information after obtaining the target text recognition result corresponding to each text line.

5. A text recognition device, characterized in that, The apparatus for performing the text recognition method as described in any one of claims 1-4 includes: The first acquisition module is used to perform paragraph detection on the jigsaw puzzle image and acquire at least one target image; the target image carries paragraph information, and different target images correspond to different paragraph information. The second acquisition module is used to detect and slice the target image to obtain the text lines corresponding to the paragraph information; The recognition module is used to perform character recognition on all the text lines to obtain the target character recognition result corresponding to each text line, and the set of all the target character recognition results is used as the recognition result of the jigsaw puzzle image; the target character recognition result carries the paragraph information.

6. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the text recognition method according to any one of claims 1-4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the text recognition method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Character recognition method and system and storage medium

    CN112257719A

  • OCR image character recognition and paragraph output method based on deep learning

    CN113435449A