OCR (Optical Character Recognition) data detection and identification method, device and equipment, medium and product

By obtaining the maximum stable extreme value region and constructing a graph model for binarization processing, combined with tree structure model scoring and false positive/false negative processing, the character sequence is optimized, solving the problem of high false positive and false negative rates in OCR detection and recognition under complex backgrounds, and improving the accuracy and robustness of recognition.

CN121963215APending Publication Date: 2026-05-01CHINA MOBILE GRP GUANGDONG CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE GRP GUANGDONG CO LTD
Filing Date
2025-12-29
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing OCR detection and recognition solutions have high false detection and false negative rates in complex backgrounds and low-quality images, making it difficult to balance recognition accuracy and robustness.

Method used

By obtaining the maximum stable extreme value region of the original image, a graph model is constructed for binarization processing. A tree structure model is then used to score candidate text regions and handle false positives and false negatives. Finally, the character sequence is optimized based on a preset index word list.

Benefits of technology

It improves the accuracy and robustness of text recognition in complex backgrounds, avoids background interference and segmentation errors, and achieves integrated collaboration between detection and recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121963215A_ABST
    Figure CN121963215A_ABST
Patent Text Reader

Abstract

The invention relates to an OCR data detection and recognition method and device, equipment, a medium and a product, and the method comprises the steps: obtaining a maximum stable extremal region of an original image, and determining a binary text image of the original image based on the maximum stable extremal region; processing the binarized text image through a tree structure model to obtain an initial detection result; the initial detection result comprises a candidate character area and a scoring result corresponding to the candidate character area; carrying out false detection removal and missing detection retrieval processing on the candidate character region in the initial detection result based on the scoring result to obtain an optimized text region set; and performing character recognition on the optimized text region set to obtain a recognized character sequence, and optimizing the character sequence based on a preset index word list to obtain a target recognition result. The character information can be efficiently and accurately extracted and recognized from the complex background image, false detection and missing detection are effectively reduced, and the robustness of the whole recognition process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

A method, apparatus, equipment, medium, and product for detecting and recognizing OCR data. Technical Field

[0001] This disclosure relates to the field of OCR recognition technology, and in particular to a method, apparatus, equipment, medium and product for detecting and recognizing OCR data. Background Technology

[0002] With the acceleration of informatization, personal information is increasingly exposed during document circulation, increasing the risk of information leakage. Accurate and efficient automatic identification of sensitive information such as handwritten signatures has become a key requirement for strengthening information protection, and Optical Character Recognition (OCR) technology is particularly important in this field.

[0003] In related technologies, existing OCR detection and recognition solutions often suffer from high false detection and false negative rates when faced with complex backgrounds, low-quality images, or diverse handwriting styles. Furthermore, background interference can lead to insufficient recognition reliability, making it difficult to balance recognition accuracy and robustness in real-world scenarios. Therefore, achieving high robustness and high accuracy in text recognition under complex application scenarios has become a pressing issue in this field. Summary of the Invention

[0004] This disclosure provides a method, apparatus, equipment, medium, and product for detecting and recognizing OCR data.

[0005] According to a first aspect of this disclosure, a method for detecting and recognizing OCR data is provided. The method includes: obtaining the maximum stable extreme value region of an original image, and determining a binarized text image of the original image based on the maximum stable extreme value region; processing the binarized text image using a tree structure model to obtain an initial detection result; the initial detection result includes candidate text regions and corresponding scoring results for the candidate text regions; performing false detection removal and false negative recovery processing on the candidate text regions in the initial detection result based on the scoring results to obtain an optimized text region set; performing character recognition on the optimized text region set to obtain a recognized character sequence, and optimizing the character sequence based on a preset index word list to obtain a target recognition result.

[0006] Further, determining the binarized text image of the original image based on the maximum stable extreme value region includes: using the maximum stable extreme value region as a node of the original image, and constructing a graph model based on the nodes; solving for the optimal segmentation of the original image by minimizing the loss function associated with the graph model to obtain the binarized text image; wherein the loss function includes a univariate loss function term and a binary loss function term, the univariate loss function term being determined based on the classification probability of the node, and the binary loss function term being determined based on the feature similarity between adjacent nodes.

[0007] Further, the step of processing the binarized text image using a tree structure model to obtain an initial detection result includes: performing extreme region detection on the binarized text image to obtain multiple regions to be processed; filtering out regions whose size does not conform to a preset size range from the multiple regions to be processed to obtain multiple candidate text regions; scoring each candidate text region using the tree structure model to obtain a score result for each candidate text region; and determining the candidate text regions and the score results as the initial detection result.

[0008] Further, the step of performing false detection removal and false negative detection recovery processing on candidate text regions in the initial detection results based on the scoring results to obtain an optimized text region set includes: performing a false detection judgment operation on each candidate text region based on the scoring results to obtain an intermediate region set; wherein, the false detection judgment operation is used to remove false detection regions in the candidate text regions; performing false negative detection recovery processing on the intermediate region set based on the scoring results to obtain recovered regions; and merging the recovered regions with the intermediate region set to obtain the optimized text region set.

[0009] Further, the step of performing a false detection judgment operation on each candidate text region based on the scoring result to obtain an intermediate region set includes: applying at least one false detection judgment condition to the candidate text region based on the scoring result, removing candidate text regions that do not meet the false detection judgment condition as false detection regions, and obtaining the intermediate region set.

[0010] Furthermore, the false detection judgment condition includes at least one of the following: the highest score result of the candidate text region is lower than a first threshold, or the average score result of the candidate text region is lower than a second threshold, or the proportion of the candidate text region belonging to a preset interference structure exceeds a predetermined proportion, and the average score result of the candidate text region is lower than a third threshold.

[0011] Further, the step of performing a missed detection recovery process on the intermediate region set based on the scoring results to obtain the recovered region includes: expanding the regions in the intermediate region set in at least one direction to obtain multiple expanded regions; detecting the multiple expanded regions using the tree structure model to obtain the expanded region scoring results corresponding to the multiple expanded regions; and determining the expanded regions whose expanded region scoring results exceed a fourth threshold as the recovered regions.

[0012] Further, the optimization of the character sequence based on a preset index term to obtain the target recognition result includes: constructing a sentence-level graph model based on candidate strings in the preset index term; wherein, the characters in the candidate strings serve as nodes of the sentence-level graph model, and the spatial positional relationship of adjacent characters in the candidate strings in the image serves as edges connecting the corresponding nodes; determining the optimal character sequence from the character sequence as the target recognition result by minimizing the sentence-level loss function associated with the sentence-level graph model; wherein, the sentence-level loss function integrates the character recognition confidence and the constraints defined by the spatial positional relationship.

[0013] According to a second aspect of this disclosure, an OCR data detection and recognition device is provided. The device includes: a detection module, configured to acquire the maximum stable extreme value region of an original image and determine a binarized text image of the original image based on the maximum stable extreme value region; a first processing module, configured to process the binarized text image using a tree structure model to obtain an initial detection result; the initial detection result includes candidate text regions and corresponding scoring results for the candidate text regions; a second processing module, configured to perform false detection removal and false negative detection recovery processing on the candidate text regions in the initial detection result based on the scoring results to obtain an optimized text region set; and a recognition module, configured to perform character recognition on the optimized text region set to obtain a recognized character sequence, and optimize the character sequence based on a preset index word list to obtain a target recognition result.

[0014] According to a third aspect of this disclosure, an electronic device is provided. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described above.

[0015] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the methods described above.

[0016] According to a fifth aspect of this disclosure, a computer program product is provided. The computer program product includes a computer program that, when executed by a processor, implements the methods described above in this disclosure.

[0017] This disclosure provides an OCR data detection and recognition method, apparatus, device, medium, and product. In this embodiment, firstly, the maximum stable extreme value region of the original image is obtained, and a binarized text image of the original image is determined based on the maximum stable extreme value region. Then, the binarized text image is processed using a tree structure model to obtain an initial detection result. The initial detection result includes candidate text regions and their corresponding score results. Afterward, based on the score results, false detection removal and missed detection recovery processing are performed on the candidate text regions in the initial detection result to obtain an optimized text region set. Finally, character recognition is performed on the optimized text region set to obtain a recognized character sequence, and the character sequence is optimized based on a preset index word list to obtain the target recognition result.

[0018] As described above, this embodiment of the present disclosure obtains the maximum stable extreme value region of the original image and determines the binarized text image of the original image based on the maximum stable extreme value region, thereby effectively suppressing the complex background of the original image in the preprocessing stage and avoiding the loss of key features due to background interference or inverse grayscale processing. This embodiment of the present disclosure processes the binarized text image through a tree structure model to obtain an initial detection result containing candidate text regions and their scoring results, realizing the fusion and mutual promotion of detection and recognition. Then, based on the scoring results, false detection removal and missed detection recovery processing can be performed on candidate text regions to obtain an optimized text region set, avoiding recognition chain errors caused by segmentation errors and overcoming the defects of traditional methods that rely on segmentation algorithms. Finally, this embodiment of the present disclosure performs character recognition on the optimized text region set and optimizes the character sequence based on a preset index word list to obtain the target recognition result, realizing the integrated collaboration of detection and recognition, and improving the accuracy and robustness of text recognition in complex backgrounds. Attached Figure Description

[0019] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0020] Figure 1 is a flowchart of an OCR data detection and recognition method provided in an exemplary embodiment of the present disclosure; Figure 2 is a flowchart of another exemplary embodiment of the present disclosure of an OCR data detection and recognition method; Figure 3 is a flowchart of another exemplary embodiment of the present disclosure of an OCR data detection and recognition method; Figure 4 is a flowchart of another exemplary embodiment of the present disclosure of an OCR data detection and recognition method; Figure 5 is a flowchart of another exemplary embodiment of the present disclosure of an OCR data detection and recognition method; Figure 6 is a schematic block diagram of the functional modules of an OCR data detection and recognition device provided in an exemplary embodiment of the present disclosure; Figure 7 is a structural block diagram of an electronic device provided in an exemplary embodiment of the present disclosure; Figure 8 is a structural block diagram of a computer system provided in an exemplary embodiment of the present disclosure; Figure 9 is a structural block diagram of a computer program product provided in an exemplary embodiment of the present disclosure. Detailed Implementation

[0021] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0022] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0023] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0024] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that, unless explicitly stated in the context, they should be understood as "one or more". The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0025] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0026] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0027] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understood that the above notification and user authorization process is merely illustrative and does not constitute a limitation on the implementation of this disclosure; other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0028] In one embodiment, as shown in Figure 1, an OCR data detection and recognition method is provided, including the following steps: Step 101, obtaining the maximum stable extreme value region of the original image, and determining the binarized text image of the original image based on the maximum stable extreme value region.

[0029] Here, the executing entity can obtain the maximum stable extremum region of the original image and determine the binarized text image of the original image based on the maximum stable extremum region. The maximum stable extremum region (MSER) ​​refers to the connected pixel region whose shape and area remain relatively stable under continuous grayscale threshold changes when the input original image is scanned.

[0030] In one possible embodiment, as shown in Figure 2, determining the binarized text image of the original image based on the maximum stable extremum region includes the following steps: Step 1011, using the maximum stable extremum region as a node of the original image, and constructing a graph model based on the node.

[0031] Here, after obtaining the maximum stable extremum region of the original image, the executing entity can use the maximum stable extremum region as a node of the original image and construct a graph model based on the node.

[0032] In one possible embodiment, the executing entity detects white-background-black-text MSERs and black-background-white-text MSERs in the original image, respectively, and treats each detected MSER as a node to be classified. Based on these nodes, an undirected graph model G=(V,E) is constructed. Specifically, the undirected graph model G=(V,E) consists of nodes V and undirected edges E, where each edge E connects two adjacent nodes. Assuming each detected MSER is a node in the undirected graph, for any two nodes, corresponding to MSER regions i and j, if they simultaneously satisfy the following four constraint formulas, they are determined to be adjacent and connected by an undirected edge. The specific constraint formulas are: Distance constraint: Color constraints: Width ratio constraint: Height ratio constraint: .

[0033] Among them, dist ( () is the distance between the center locations of the two MSERs. is the distance between the average colors of two MSERs, w and h are the width and height of the bounding rectangle of the region, and each node is connected to its neighboring nodes through edges. In addition, two virtual terminal nodes are introduced in the undirected graph model G=(V,E): a foreground (text) terminal and a background (non-text) terminal. Each MSER node in G=(V,E) is connected to these two terminal nodes.

[0034] It should be noted that the above four constraint formulas and their specific parameters are merely illustrative examples of one specific implementation for determining whether two nodes are adjacent. In practical applications, the rules for determining whether two nodes are adjacent are not limited to these. For example, constraints can be added, reduced, or replaced, the form of the formula or the value of the parameters can be adjusted, and these parameters can be adaptively determined according to image characteristics or application scenarios.

[0035] Step 1012: Solve for the optimal segmentation of the original image by minimizing the loss function associated with the graph model to obtain the binarized text image.

[0036] Here, after constructing the graph model, the executing entity can solve for the optimal segmentation of the original image by minimizing the loss function associated with the graph model, thereby obtaining a binary text image. The loss function includes a univariate loss function term and a binary loss function term. The univariate loss function term is determined based on the classification probability of the nodes, while the binary loss function term is determined based on the feature similarity between adjacent nodes.

[0037] In one possible embodiment, the executing agent solves for the optimal segmentation of the original image by minimizing the loss function associated with the graph model, thereby obtaining a binarized text image. Specifically, the executing agent assigns a segmentation label "1" to text regions, representing the foreground, and a label "0" to non-text regions, representing the background. Let V be the set of all nodes in the graph, and N be the number of neighboring points. The set, L= It is a binary vector, where The elements p in V are labeled, with "1" for foreground and "0" for background. The loss function E(L) for each segment L is defined as follows:

[0038]

[0039] in, For indicator functions, when The value is 1 when the condition is met, and 0 otherwise. γ is used to balance the univariate loss term. With binary loss items The weight parameters.

[0040] In one possible embodiment, the univariate loss function term Based on the probability determination of node p being classified as foreground or background, specifically, the executing entity calculates the probability that node p belongs to the text region by extracting and analyzing multiple discriminative features of the MSER region corresponding to node p. These features include: regularity features, stroke width consistency features, and duty cycle features.

[0041] For regularity features, the following two features are used to quantify the shape regularity of the region:

[0042]

[0043] in, It is the number of skeleton pixels in the region. It is the number of outline pixels in the region. It refers to the area of ​​the region. Because text regions have relatively regular shapes, their number of outline points is greater compared to non-text regions. Smaller, therefore and Both are relatively large.

[0044] For the stroke width consistency feature, since most data has a consistent stroke width, while the extreme regions of non-text have varying stroke widths, the stroke width feature can be used to remove non-text regions with arbitrary stroke widths. The following two features are used to reflect the consistency of text stroke widths:

[0045]

[0046] in, It is the number of paired edge points with opposite gradient directions in the image. It is Canny in the image The number of pixels at the edge. It is the average stroke width of the extreme regions in the image. If the extreme region is the smaller of the image width and height, and if the number of paired edge points in this extreme region is small, or if the average stroke width is large or small, then this extreme region is very likely a non-text region.

[0047] For duty cycle features, since the proportion of character stroke pixels in an image is relatively moderate, duty cycle can be used to remove non-text regions that occupy a large or small proportion of the image. Its definition is as follows:

[0048] in, This is the number of pixels per stroke, representing this proportion of the text area. Generally moderate.

[0049] The executing entity can perform a comprehensive evaluation based on these feature values, such as by using a pre-trained classifier or setting threshold rules, to obtain a probability estimate Pr that node p belongs to a text region. p (text), and then the univariate loss term is defined as: (1)= log(Pr p (text)), (0)= log(1-Pr p (text)), that is, the higher the probability that a node belongs to text, the more likely it is to be marked as foreground (text). The smaller the loss (=1), the more likely it is to be labeled as background ( The greater the loss (=0), the greater the loss.

[0050] In one possible embodiment, the binary loss function term This is used to penalize neighboring nodes p and q by assigning them different labels; its penalty weight is... The penalty is determined by the feature similarity between two nodes: the more similar the features, the greater the penalty for assigning different labels. Specifically, Defined as:

[0051]

[0052]

[0053] in, It is the Euclidean distance between the color features of two adjacent nodes or regions. It is the Euclidean distance between the geometric features of two adjacent nodes or regions, color p and color q These represent the (R, G, B) color features of nodes p and q, respectively, while H and W refer to the width and height of the region, respectively. Setting it to 0.5 means that when two adjacent regions have similar color and geometric features, assigning them different labels results in a greater loss, and vice versa.

[0054] In one possible embodiment, the energy function for image segmentation is:

[0055] In the energy function expression, p and q represent the pixel positions, N represents a certain adjacency relationship, L represents the label, D represents the classification information of the label, and V is the pixel inconsistency function that satisfies a certain adjacency relationship. For likelihood terms, For the prior energy term, the optimal binarization segmentation result This is obtained by solving for the minimum value of the loss function: The minimization problem is solved using a graph cut algorithm. The specific process includes: First, the executing agent extends the undirected graph model G into a flow network, introducing a source node s (corresponding to a foreground terminal) and a sink node t (corresponding to a background terminal); then, the executing agent calculates the univariate loss for each node p. (1) and (0) is transformed into the capacity of the edges from the source node s to node p and from node p to the sink node t; finally, the executing entity assigns binary loss weights to each pair of adjacent nodes. Converting this to the capacity of the undirected edges connecting nodes p and q, and calculating the maximum flow or minimum cut of the flow network, we can obtain the label assignment scheme that minimizes the global energy E(L). All marked as Lp Nodes with a value of 1 form the foreground region, while the rest form the background, thus generating a high-quality binarized text image.

[0056] It should be noted that the above feature selection, probability estimation method, similarity measurement formula and parameters are only examples. Those skilled in the art can adjust or replace these implementation details according to actual application scenarios. As long as the core is to achieve image segmentation by minimizing the loss function that integrates node classification confidence and neighborhood smoothness constraints, they are all within the protection scope of this application.

[0057] In one possible embodiment, after obtaining the binarized text image, the executing entity can perform filtering processing on the binarized text image. Specifically, the executing entity uses an adaptive median filtering method to suppress noise in the binarized text image, so as to better preserve the edge details and structural integrity of the text strokes while removing possible scattered noise or small holes. This specifically includes the following processing mechanism: the executing entity abbreviates the grayscale value of the pixel at (m, n) as... Then the pseudo-two-word bit representation of this window is:

[0058] The executing entity performs transformation operations on each element in the above window:

[0059] The executing entity measures each element in the above window and takes the probability of obtaining it. for:

[0060]

[0061] The median filtering algorithm used by the executing entity is as follows: {If For 3×3 black and white areas with no noise pollution All elements are 0, y(m,n) = f(m,n); elseif (f(m,n) = max or (f(m,n)=min) y(m,n) = Median )elsey(m,n)=f(m,n)endifendif}where, Indicates 3 A square window filled with "0"s indicates that It is a 3-axis graph centered at (m, n). The all-"1" square window, Median represents the median operation. Through the above adaptive filtering process, the execution subject can effectively filter out isolated noise points in the binary image while avoiding excessive smoothing of the edges of the character strokes. This provides a cleaner and more faithful input image for subsequent accurate detection and recognition steps. It should be noted that the above filtering method, probability model and parameters are only examples. In actual implementation, other filtering techniques with similar edge-preserving and noise reduction effects can be used, and no restrictions are imposed here.

[0062] In this embodiment, firstly, the executing entity uses the region of maximum stable extremum as the node of the original image and constructs a graph model based on the node; then, the executing entity solves for the optimal segmentation of the original image by minimizing the loss function associated with the graph model to obtain a binarized text image; wherein, the loss function includes a univariate loss function term and a binary loss function term, the univariate loss function term is determined based on the classification probability of the node, and the binary loss function term is determined based on the feature similarity between adjacent nodes.

[0063] As described above, this embodiment constructs a graph model using the maximum stable extreme value region of the original image as nodes, and solves for the optimal segmentation by minimizing the loss function that fuses univariate and binary losses, thereby obtaining a binarized text image. In this embodiment, the univariate loss evaluates the probability of a node being a text region based on multi-feature analysis of the MSER region, thus accurately distinguishing the foreground from the background. The binary loss applies smoothing constraints based on the similarity of color and geometric features between adjacent nodes, ensuring that connected regions belonging to the same text or structure are not mis-segmented. This embodiment effectively avoids the feature loss or mispropagation problems caused by relying on a single segmentation algorithm or preprocessing step in the prior art, and achieves robust extraction of text regions in complex backgrounds, providing a high-quality, high-fidelity input foundation for subsequent integrated detection and recognition.

[0064] Step 102: Process the binary text image using a tree structure model to obtain the initial detection results.

[0065] Here, after determining the binarized text image, the executing entity can process the binarized text image through a tree structure model to obtain the initial detection result, which includes candidate text regions and the corresponding score results of the candidate text regions.

[0066] In one possible embodiment, as shown in Figure 3, the binary text image is processed by a tree structure model to obtain the initial detection result, including the following steps: Step 1021, extreme region detection is performed on the binary text image to obtain multiple regions to be processed.

[0067] Here, after determining the binarized text image, the executing entity can perform extreme region detection on the binarized text image to obtain multiple regions to be processed.

[0068] In one possible embodiment, after determining the binarized text image, the executing entity performs maximum stable extremum region detection on the image. Specifically, given that the binarized image has highlighted the contrast between the text and the background, the executing entity mainly focuses on extracting the connected foreground pixel regions. These regions are connected components that remain stable under the grayscale changes of the binary image, constituting candidate units for subsequent processing, i.e., obtaining multiple regions to be processed.

[0069] Step 1022: Filter out regions whose size does not conform to the preset size range from multiple regions to be processed to obtain multiple candidate text regions.

[0070] Here, after obtaining multiple regions to be processed, the executing entity can filter out regions whose size does not conform to the preset size range from the multiple regions to be processed, and obtain multiple candidate text regions.

[0071] In one possible embodiment, the execution entity analyzes the geometric dimensions of each region to be processed obtained in step 1021. The execution entity typically measures these dimensions by the width w and height h of its bounding rectangle. Based on prior knowledge or application scenarios, a reasonable size threshold range is set, such as minimum area and maximum aspect ratio. Regions that are too large, such as those far exceeding the expected text size in the image, may correspond to large blocks of background noise or graphics, or regions that are too small, such as those consisting of only a few pixels, may correspond to scattered noise or areas with texture details that clearly do not conform to the characteristics of text. Through this step, the execution entity can initially eliminate a large number of non-textual interferences, and the remaining regions constitute multiple candidate text regions.

[0072] Step 1023: Score each candidate text region using a tree structure model to obtain the score result for each candidate text region.

[0073] Here, after obtaining multiple candidate text regions, the executing entity can score each candidate text region using a tree structure model to obtain the score result for each candidate text region.

[0074] In one possible embodiment, the executing entity builds a tree structure model (TSM) for each type of text k, the expression of which is:

[0075] Where k is the data category index, Each node in the tree represents a component of the data. This represents the topological relationships between nodes, i.e., the structural constraints between the various components of the data. I represents the input image. Let L represent the position of a component i. For a certain type of data k, let L be the arrangement of a certain position of all components. The obtained detection score is:

[0076]

[0077]

[0078] Among them, the score of a certain detection result for a certain type of data k. Scoring by local components Global shape score and deviation coefficient Composition, appearance score of local components The matching degree between the image features of each component and the model template is measured, and the global shape and structure score is calculated. The deviation coefficient measures the degree to which the spatial relationships between all components conform to the topology defined in the model. Represents the global bias term for text category k.

[0079] For each candidate text region, the executing agent arranges the components by searching for the optimal component positions in and around the region. Calculate the maximum score (max) corresponding to different text categories (k). The highest score is used as the score for the candidate region, and the executing entity records the category with the highest score.

[0080] Step 1024: Determine the candidate text regions and scoring results as the initial detection results.

[0081] Here, after the executing entity scores each candidate text region using a tree structure model and obtains the score result for each candidate text region, it can determine the candidate text region and the score result as the initial detection result.

[0082] In one possible embodiment, the executing entity associates and integrates the candidate text regions obtained through step 1022 with their corresponding scoring results calculated using the tree structure model in step 1023 to form an initial detection result set, denoted as... , It includes all regions in the image that are initially determined to potentially contain text, along with their confidence metrics. Typically, to remove highly overlapping redundant detection boxes, the executing agent will... Non-maximum suppression is performed to obtain a more concise set of detection results. This serves as input for subsequent steps.

[0083] In this embodiment, firstly, the execution subject performs extreme region detection on the binarized text image to obtain multiple regions to be processed; then, the execution subject filters out regions whose size does not conform to the preset size range from the multiple regions to be processed to obtain multiple candidate text regions; then, the execution subject scores each candidate text region through a tree structure model to obtain the score result of each candidate text region; finally, the execution subject determines the candidate text regions and the score results as the initial detection results.

[0084] As described above, this embodiment efficiently focuses on candidate text regions by performing extreme region detection on the binarized image and combining it with a preset size range for initial screening. Then, a tree structure model is used to comprehensively score each candidate region. This score deeply integrates the appearance features of local components of the text with global shape and structure constraints, thereby accurately quantifying the credibility of each region as a specific text. This embodiment avoids the excessive reliance on the initial segmentation results of traditional single detection processes, providing initial detection results rich in semantic information and with quantified confidence for subsequent steps. This lays a crucial and reliable foundation for the removal of false detections, the recovery of missed detections, and the final optimization of character sequences in the entire integrated recognition process.

[0085] Step 103: Based on the scoring results, perform false detection removal and false negative recovery processing on the candidate text regions in the initial detection results to obtain the optimized text region set.

[0086] Here, after the execution entity processes the binary text image through the tree structure model and obtains the initial detection result, it can perform false detection removal and false detection recovery processing on the candidate text regions in the initial detection result based on the scoring result, and obtain the optimized text region set.

[0087] In one possible embodiment, as shown in Figure 4, the candidate text regions in the initial detection results are processed for false detection removal and false negative detection recovery based on the scoring results to obtain an optimized set of text regions, including the following steps: Step 1031, perform a false detection judgment operation on each candidate text region based on the scoring results to obtain an intermediate region set.

[0088] Here, after the execution entity processes the binary text image through the tree structure model and obtains the initial detection result, it can perform a false detection judgment operation on each candidate text region based on the scoring result to obtain an intermediate region set. The false detection judgment operation is used to remove false detection regions in the candidate text regions.

[0089] In one possible embodiment, a false detection judgment operation is performed on each candidate text region based on the scoring result to obtain an intermediate region set, including the following steps: applying at least one false detection judgment condition to the candidate text regions based on the scoring result, removing candidate text regions that do not meet the false detection judgment condition as false detection regions, and obtaining an intermediate region set.

[0090] In one possible embodiment, the false detection judgment condition includes at least one of the following: the highest score result of the candidate text region is lower than a first threshold, or the average score result of the candidate text region is lower than a second threshold, or the proportion of the candidate text region belonging to a preset interference structure exceeds a predetermined proportion, and the average score result of the candidate text region is lower than a third threshold.

[0091] In one possible embodiment, after obtaining the initial detection results, the executing entity performs false detection judgment on each candidate text region based on the scoring results to remove obviously erroneous detections. Specifically, the executing entity processes the initial detection result set, which is the result after non-maximum suppression processing. For each candidate text region, the executing entity applies at least one of the following false detection criteria: False detection based on the highest score: If the highest score of the candidate text region across all text categories is lower than a first threshold. If the region does not contain any valid text, the executing entity considers it a false detection. For example, the executing entity can set a first threshold. Set it to -0.4.

[0092] False detection based on average score: If the average score of all detected components or sub-regions within the candidate text area is lower than the second threshold. If the entire area is considered a background area, the executing entity will determine it as a false detection. For example, the executing entity can use the second threshold. Set it to -0.65.

[0093] False detection judgment based on the combination of structural composition and scoring: The executing entity counts the number of components in the candidate text region that are identified as belonging to a set of preset interfering structures. The preset interfering structures may include characters or shapes that are easily confused in a specific context. For example, in one embodiment, easily confused characters or shapes may include data structures corresponding to the characters L, I, T, I, J, F, and E. If the number of these interfering structures exceeds a predetermined proportion P of the total number of components detected in the region, such as 80%, and at the same time the average score of the region is lower than a third threshold, false detection will be performed. ,For example If the value is 0, the region is considered to be mainly composed of interfering structures and is thus identified as an interfering region. The executing entity then determines this as a false detection.

[0094] The executing entity will identify candidate text regions that meet any of the above conditions as false detection regions and remove them. The remaining candidate text regions that do not meet any false detection conditions will together form the intermediate region set.

[0095] Step 1032: Based on the scoring results, perform a missed detection recovery process on the intermediate region set to obtain the recovered region.

[0096] Here, the executing entity performs a false detection judgment operation on each candidate text region based on the scoring results, and after obtaining the intermediate region set, it can perform a missed detection recovery process on the intermediate region set based on the scoring results to obtain the recovered region.

[0097] In one possible embodiment, a missed detection recovery process is performed on the intermediate region set based on the scoring results to obtain the recovered region, including the following steps: expanding the regions in the intermediate region set in at least one direction to obtain multiple expanded regions; detecting the multiple expanded regions using a tree structure model to obtain the expanded region scoring results corresponding to the multiple expanded regions; and determining the expanded regions whose expanded region scoring results exceed a fourth threshold as the recovered regions.

[0098] Specifically, after performing false detection judgment on each candidate text region based on the scoring results to obtain an intermediate region set, the executing entity first expands the regions in the intermediate region set in at least one direction to obtain multiple expanded regions. Then, the executing entity detects the multiple expanded regions through a tree structure model to obtain the expansion region scoring results corresponding to the multiple expanded regions. Finally, the executing entity determines the expanded regions whose expansion region scoring results exceed the fourth threshold as the retrieved regions.

[0099] In one possible embodiment, after obtaining the intermediate region set, the execution subject performs a multi-directional region expansion operation for each confirmed text region in the set. Specifically, in order to find adjacent text components that may have been missed due to incomplete initial detection, the execution subject expands the current region in four main directions: up, down, left, and right. The expansion step size can be dynamically determined according to the size of the current region. For example, the execution subject sets it to 1.1 times the height of the bounding rectangle of the current region. Each time an expansion operation is performed in one direction, a new expanded region is generated. This expanded region is a new rectangular region formed by expanding the original region along the specified direction by the specified step size.

[0100] For each generated extended region, the executing entity re-performs data detection within that extended region using a tree structure model. This detection process is similar to the initial detection; the tree structure model scans and evaluates potential text components within the extended region and calculates the highest score corresponding to the best matching result within that extended region. This score is the score result for that extended region, used to quantify the probability that the extended region contains valid text. The executing entity presets a fourth threshold. ,For example = 0.25, the executing entity will compare the score result of each expanded region with this threshold. The comparison is performed if the score of a certain extended region exceeds the threshold. If the text is not detected, it is determined that there are previously missed characters in the expansion direction, and the expansion area is identified as the recovery area.

[0101] It should be noted that the above-mentioned missed detection recovery process is an adaptive iterative process based on scoring feedback. Specifically, for each text region in the middle region set, the execution entity independently performs expansion and detection loops in four directions: upward, downward, left, and right. In a certain direction, it expands once with a preset step size, such as 1.1 times the region height. Then, the tree structure model detection is re-run within the expanded region to obtain its highest score. If the score exceeds the fourth threshold... If the expanded region is not found, it is recorded as the recovered region. The boundary of this expanded region then becomes the new starting point, and the next expansion and detection continues in the same direction. This iterative process continues until the score of the expanded region in a certain direction does not exceed a threshold. If the target character is not found, the expansion in that direction will be terminated immediately. Through this mechanism, the executing entity can adaptively probe and confirm repeatedly in each direction where characters may be missed until there are no more high-confidence discoveries, thereby achieving a comprehensive and accurate retrieval of missed characters.

[0102] Step 1033: Merge the retrieved region with the intermediate region set to obtain the optimized text region set.

[0103] Here, the executing entity performs a missed detection recovery process on the intermediate region set based on the scoring results. After obtaining the recovered regions, the recovered regions can be merged with the intermediate region set to obtain the optimized text region set.

[0104] In one possible embodiment, the executing entity merges the retrieved regions obtained from the missed detection retrieval process with the intermediate region set obtained after false detection removal to generate the final optimized text region set. Specifically, the executing entity first merges spatially adjacent or overlapping retrieved regions with the existing intermediate regions into continuous text blocks, and adds independent retrieved regions as new blocks. Then, it performs deduplication processing on all integrated regions to eliminate highly overlapping redundant regions, ultimately obtaining a complete, clean, and non-repeating optimized text region set, providing high-quality input for subsequent character recognition.

[0105] In this embodiment, firstly, the executing entity expands the regions in the intermediate region set in at least one direction to obtain multiple expanded regions; then, the executing entity detects the multiple expanded regions through a tree structure model to obtain the expansion region scoring results corresponding to the multiple expanded regions; finally, the executing entity determines the expanded regions whose expansion region scoring results exceed the fourth threshold as the retrieved regions.

[0106] As described above, this embodiment adaptively expands the regions in the intermediate region set in multiple directions and re-runs the tree structure model detection on each expanded region to obtain the expanded region scoring results. Then, based on the fourth threshold, high-confidence retrieved regions are selected. Through iterative expansion and scoring feedback mechanisms, this embodiment can actively and accurately detect and retrieve text components missed due to incomplete initial detection. This effectively overcomes the missed detection problem caused by traditional methods relying on fixed segmentation or single detection, thereby significantly improving the completeness and recall rate of text region extraction and providing a more reliable input basis for subsequent recognition steps.

[0107] Step 104: Perform character recognition on the optimized text region set to obtain the recognized character sequence, and optimize the character sequence based on the preset index word list to obtain the target recognition result.

[0108] Here, the execution entity performs false detection removal and false detection recovery processing on the candidate text regions in the initial detection results based on the scoring results. After obtaining the optimized text region set, it can perform character recognition on the optimized text region set to obtain the recognized character sequence. Then, it optimizes the character sequence based on the preset index word list to obtain the target recognition result.

[0109] In one possible embodiment, the executing entity performs false detection removal and false negative recovery processing on the candidate text regions in the initial detection results based on the scoring results to obtain an optimized text region set. Then, the executing entity performs single-character recognition on each independent text region in the optimized text region set. This is usually achieved through a trained single-character classifier or recognition model, such as a convolutional neural network (CNN). The model receives the cropped single text region image as input and outputs the probability distribution of the image belonging to each character category. For each region, the character category with the highest probability is selected as its preliminary recognition result. According to the spatial order of the text regions in the image, these preliminarily recognized characters are combined into a character sequence.

[0110] In one possible embodiment, as shown in Figure 5, the character sequence is optimized based on a preset index word list to obtain the target recognition result, including the following steps: Step 1041, construct a sentence-level graph model based on the candidate strings in the preset index word list.

[0111] Here, after the execution entity performs character recognition on the optimized text region set and obtains the recognized character sequence, it can construct a sentence-level graph model based on the candidate strings in the preset index word list. The characters in the candidate strings serve as nodes in the sentence-level graph model, and the spatial position relationship between adjacent characters in the candidate strings in the image serves as the edge connecting the corresponding nodes.

[0112] In one possible embodiment, for any candidate string in the index vocabulary, for example denoted as a sentence containing n characters, Lex=( The execution entity constructs a corresponding sentence-level graph model for the string, specifically as follows: the nodes in the graph model correspond to each character in the sentence. Each node is associated with a set of possible locations. This set contains all characters initially identified from the recognition results of the optimized text region set. The candidate region's location information in the image; edges in the graph model are used to connect adjacent character nodes in the sentence, i.e., connecting characters. Corresponding nodes and characters The node corresponding to +1 is used to model and constrain the spatial relationship that the two adjacent characters should satisfy in the image, such as horizontal spacing and vertical alignment. In this graph model, it is usually assumed that there is a parent-child relationship between adjacent nodes, such as the i-th node being the parent node of the i+1-th node, so as to facilitate dynamic programming reasoning from back to front.

[0113] Step 1042: By minimizing the sentence-level loss function associated with the sentence-level graph model, the optimal character sequence is determined from the character sequence as the target recognition result.

[0114] Here, after the executing entity constructs a sentence-level graph model based on candidate strings in a preset index word list, it can determine the optimal character sequence from the character sequence as the target recognition result by minimizing the sentence-level loss function associated with the sentence-level graph model. The sentence-level loss function integrates the character recognition confidence and the constraints defined by the spatial position relationship.

[0115] In one possible implementation, for a candidate string Lex and one possible combination of character positions, the executing agent defines its sentence-level loss function. for:

[0116] in, This is a binary loss function, used to incorporate spatial location constraints between two adjacent data points. This is a balance parameter between univariate loss and binary loss. This is the length normalization factor.

[0117] The executing entity finds the final sentence recognition result from the candidate detection results, which requires finding the result that satisfies E(L) among all possible data combinations for each sentence model. The sentence model corresponding to the smallest combination, for a given sentence model in the index, the best data combination can be obtained by the following formula:

[0118] Given the loss C of the (i+1)th data point If the parent node is the i-th node, then the parent node is at position i. Loss C ( ) is calculated using the following formula:

[0119] The executing entity first calculates the last data, i.e., the nth data, in all possible positions. The loss Then the (n-1)th and the data are in any possible position Optimal loss The optimal combination of sentence models can be calculated using the formula above, when the loss is finally passed to the first data point in the sentence model. The loss is C ( In other words, for each given candidate string Lex, its optimal... This can be efficiently solved using dynamic programming. Specifically, the execution entity starts from the last character of the sentence and calculates the cumulative loss (ln) at each possible position. Then, the executing entity recursively calculates the position of the previous character. Cumulative losses Ultimately, the minimum cumulative loss of the first character across all possible positions. C ( The minimum loss of the sentence model is calculated by the execution entity traversing all candidate strings in the index vocabulary and selecting the string with the global minimum loss and its character position combination. This serves as the final target identification result.

[0120] In this embodiment, firstly, the executing entity constructs a sentence-level graph model based on candidate strings in a preset index word list; then, the executing entity determines the optimal character sequence from the character sequence as the target recognition result by minimizing the sentence-level loss function associated with the sentence-level graph model.

[0121] As described above, this embodiment transforms the character sequence optimization problem of single-character recognition into a structured search problem by constructing a sentence-level graph model based on an index dictionary. Then, by minimizing a sentence-level loss function that integrates character recognition confidence and spatial positional constraints, the optimal character sequence is determined globally as the target recognition result. This embodiment effectively overcomes the error accumulation problem caused by independent single-character recognition and lack of contextual association in existing technologies. By introducing dictionary priors and geometric constraints, it not only corrects misrecognition at the single-character level but also ensures the overall rationality of the output sequence in terms of language and layout, thereby significantly improving the accuracy and robustness of the final recognition result and achieving high-quality conversion from images to reliable text.

[0122] This disclosure provides an OCR data detection and recognition method, apparatus, device, medium, and product. In this embodiment, firstly, the maximum stable extreme value region of the original image is obtained, and a binarized text image of the original image is determined based on the maximum stable extreme value region. Then, the binarized text image is processed using a tree structure model to obtain an initial detection result. The initial detection result includes candidate text regions and their corresponding score results. Afterward, based on the score results, false detection removal and missed detection recovery processing are performed on the candidate text regions in the initial detection result to obtain an optimized text region set. Finally, character recognition is performed on the optimized text region set to obtain a recognized character sequence, and the character sequence is optimized based on a preset index word list to obtain the target recognition result.

[0123] As described above, this embodiment of the present disclosure obtains the maximum stable extreme value region of the original image and determines the binarized text image of the original image based on the maximum stable extreme value region, thereby effectively suppressing the complex background of the original image in the preprocessing stage and avoiding the loss of key features due to background interference or inverse grayscale processing. This embodiment of the present disclosure processes the binarized text image through a tree structure model to obtain an initial detection result containing candidate text regions and their scoring results, realizing the fusion and mutual promotion of detection and recognition. Then, based on the scoring results, false detection removal and missed detection recovery processing can be performed on candidate text regions to obtain an optimized text region set, avoiding recognition chain errors caused by segmentation errors and overcoming the defects of traditional methods that rely on segmentation algorithms. Finally, this embodiment of the present disclosure performs character recognition on the optimized text region set and optimizes the character sequence based on a preset index word list to obtain the target recognition result, realizing the integrated collaboration of detection and recognition, and improving the accuracy and robustness of text recognition in complex backgrounds.

[0124] As described above, the technical solution disclosed herein constructs a collaboratively enhanced OCR processing flow by integrating graph model background suppression, tree structure model integrated detection and recognition, score-driven false detection removal and missed detection recovery, and sentence-level sequence optimization. The technical solution disclosed herein effectively overcomes key problems such as complex background interference, traditional segmentation error propagation, and lack of context in single-character recognition, significantly improving the completeness of text detection and the accuracy of recognition results, while enhancing the system's adaptability to complex scenarios and overall processing efficiency.

[0125] By dividing each functional module according to its corresponding function, this disclosure provides an OCR data detection and recognition device, which can be a server or a chip applied to a server. Figure 6 is a schematic block diagram of the functional modules of the OCR data detection and recognition device provided in an exemplary embodiment of this disclosure. As shown in Figure 6, the OCR data detection and recognition device includes: a detection module 601, used to obtain the maximum stable extreme value region of the original image and determine the binarized text image of the original image based on the maximum stable extreme value region; a first processing module 602, used to process the binarized text image through a tree structure model to obtain an initial detection result; the initial detection result includes candidate text regions and the scoring results corresponding to the candidate text regions; a second processing module 603, used to perform false detection removal and false detection recovery processing on the candidate text regions in the initial detection result based on the scoring results to obtain an optimized text region set; and a recognition module 604, used to perform character recognition on the optimized text region set to obtain a recognized character sequence, and optimize the character sequence based on a preset index word list to obtain a target recognition result.

[0126] In one embodiment, the detection module 601 includes: a first construction unit, configured to use the maximum stable extreme value region as a node of the original image and construct a graph model based on the node; and a calculation unit, configured to solve for the optimal segmentation of the original image by minimizing the loss function associated with the graph model to obtain the binarized text image; wherein the loss function includes a univariate loss function term and a binary loss function term, the univariate loss function term being determined based on the classification probability of the node, and the binary loss function term being determined based on the feature similarity between adjacent nodes.

[0127] In one embodiment, the first processing module 602 includes: a first detection unit, configured to perform extreme region detection on the binarized text image to obtain multiple regions to be processed; a filtering unit, configured to filter out regions whose size does not conform to a preset size range from the multiple regions to be processed to obtain multiple candidate text regions; a scoring unit, configured to score each candidate text region using the tree structure model to obtain a scoring result for each candidate text region; and a first determination unit, configured to determine the candidate text regions and the scoring results as the initial detection result.

[0128] In one embodiment, the second processing module 603 includes: a first false detection unit, configured to perform a false detection judgment operation on each of the candidate text regions based on the scoring result to obtain an intermediate region set; wherein the false detection judgment operation is used to remove false detection regions from the candidate text regions; a false detection unit, configured to perform false detection recovery processing on the intermediate region set based on the scoring result to obtain a recovered region; and a merging unit, configured to merge the recovered region with the intermediate region set to obtain the optimized text region set.

[0129] In one embodiment, the second processing module 603 includes: a second detection unit, configured to apply at least one false detection judgment condition to the candidate text region based on the scoring result, remove candidate text regions that do not meet the false detection judgment condition as false detection regions, and obtain the intermediate region set.

[0130] In one embodiment, the false detection judgment condition includes at least one of the following: the highest score result of the candidate text region is lower than a first threshold, or the average score result of the candidate text region is lower than a second threshold, or the proportion of the candidate text region belonging to a preset interference structure exceeds a predetermined proportion, and the average score result of the candidate text region is lower than a third threshold.

[0131] In one embodiment, the second processing module 603 includes: an expansion unit, configured to expand the regions in the intermediate region set in at least one direction to obtain multiple expanded regions; a first detection unit, configured to detect the multiple expanded regions using the tree structure model to obtain expansion region scoring results corresponding to the multiple expanded regions; and a second determination unit, configured to determine the expanded regions whose expansion region scoring results exceed a fourth threshold as the retrieved regions.

[0132] In one embodiment, the recognition module 604 includes: a second construction unit, configured to construct a sentence-level graph model based on candidate strings in the preset index vocabulary; wherein, characters in the candidate strings serve as nodes of the sentence-level graph model, and the spatial positional relationship of adjacent characters in the candidate strings in the image serves as edges connecting the corresponding nodes; and a third determination unit, configured to determine the optimal character sequence from the character sequence as the target recognition result by minimizing a sentence-level loss function associated with the sentence-level graph model; wherein, the sentence-level loss function integrates character recognition confidence and constraints defined by the spatial positional relationship.

[0133] This disclosure also provides an electronic device, including: at least one processor; a memory for storing processor-executable instructions; wherein the at least one processor is configured to execute the instructions to implement the methods disclosed in this disclosure.

[0134] Figure 7 is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment of the present disclosure. As shown in Figure 7, the electronic device 700 includes at least one processor 701 and a memory 702 coupled to the processor 701. The processor 701 can execute the corresponding steps in the methods disclosed in the embodiments of the present disclosure.

[0135] The processor 701 described above can also be called a central processing unit (CPU), which can be an integrated circuit chip with signal processing capabilities. Each step in the method disclosed in this embodiment can be implemented by the integrated logic circuitry in the processor 701 or by software instructions. The processor 701 can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this embodiment can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in the memory 702, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor 701 reads information from the memory 702 and, in conjunction with its hardware, completes the steps of the method described above.

[0136] Furthermore, various operations / processes according to this disclosure, implemented via software and / or firmware, can install programs constituting the software from a storage medium or network onto a computer system with a dedicated hardware architecture, such as the computer system 800 shown in FIG. 8. When various programs are installed, this computer system is capable of performing various functions, including those described above. FIG. 8 is a structural block diagram of a computer system provided in an exemplary embodiment of this disclosure.

[0137] Computer system 800 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0138] As shown in Figure 8, the computer system 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 can also store various programs and data required for the operation of the computer system 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0139] Multiple components in the computer system 800 are connected to the I / O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 can be any type of device capable of inputting information into the computer system 800. The input unit 806 can receive input numerical or character information and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 807 can be any type of device capable of presenting information and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. The storage unit 808 may include, but is not limited to, a hard disk and an optical disk. The communication unit 809 allows the computer system 800 to exchange information / data with other devices via a network such as the Internet, and may include, but is not limited to, a modem, network card, infrared communication device, wireless communication transceiver, and / or chipset, such as Bluetooth™ device, WiFi device, WiMax device, cellular communication device, and / or the like.

[0140] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above. For example, in some embodiments, the methods disclosed in this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 700 via ROM 802 and / or communication unit 809. In some embodiments, the computing unit 801 can be configured to perform the methods disclosed in this disclosure by any other suitable means (e.g., by means of firmware).

[0141] This disclosure also provides a computer-readable storage medium, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the methods disclosed in this disclosure.

[0142] The computer-readable storage medium in this disclosure can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. The aforementioned computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specifically, the aforementioned computer-readable storage medium may include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0143] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0144] Figure 9 illustrates a computer program product 900 provided in an exemplary embodiment of this disclosure. The computer program product 900 includes a computer program 901, wherein the computer program 901, when executed by a processor, implements the methods disclosed in the embodiments of this disclosure.

[0145] In embodiments of this disclosure, computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include, but are not limited to, object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer.

[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0147] The modules, components, or units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules, components, or units do not necessarily constitute a limitation on the module, component, or unit itself.

[0148] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0149] The above description is merely an embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0150] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.

Claims

1. A method for detecting and recognizing OCR data, characterized in that, include: Obtain the maximum stable extremum region of the original image, and determine the binarized text image of the original image based on the maximum stable extremum region; The binary text image is processed using a tree structure model to obtain initial detection results; The initial detection result includes candidate text regions and the corresponding score results for the candidate text regions; Based on the scoring results, the candidate text regions in the initial detection results are processed to remove false detections and recover missed detections, resulting in an optimized text region set; character recognition is performed on the optimized text region set to obtain the recognized character sequence, and the character sequence is optimized based on a preset index word list to obtain the target recognition result.

2. The method according to claim 1, characterized in that, The step of determining the binarized text image of the original image based on the maximum stable extreme value region includes: using the maximum stable extreme value region as a node of the original image and constructing a graph model based on the node; solving for the optimal segmentation of the original image by minimizing the loss function associated with the graph model to obtain the binarized text image; wherein, the loss function includes a univariate loss function term and a binary loss function term, the univariate loss function term being determined based on the classification probability of the node, and the binary loss function term being determined based on the feature similarity between adjacent nodes.

3. The method according to claim 1, characterized in that, The step of processing the binarized text image using a tree structure model to obtain an initial detection result includes: performing extreme region detection on the binarized text image to obtain multiple regions to be processed; filtering out regions whose size does not conform to a preset size range from the multiple regions to be processed to obtain multiple candidate text regions; scoring each candidate text region using the tree structure model to obtain a score result for each candidate text region; and determining the candidate text regions and the score results as the initial detection result.

4. The method according to claim 1, characterized in that, The step of performing false detection removal and false negative detection recovery processing on candidate text regions in the initial detection results based on the scoring results to obtain an optimized text region set includes: performing a false detection judgment operation on each candidate text region based on the scoring results to obtain an intermediate region set; wherein, the false detection judgment operation is used to remove false detection regions in the candidate text regions; performing false negative detection recovery processing on the intermediate region set based on the scoring results to obtain recovered regions; and merging the recovered regions with the intermediate region set to obtain the optimized text region set.

5. The method according to claim 4, characterized in that, The step of performing a false detection judgment operation on each candidate text region based on the scoring result to obtain an intermediate region set includes: applying at least one false detection judgment condition to the candidate text regions based on the scoring result, removing candidate text regions that do not meet the false detection judgment condition as false detection regions, and obtaining the intermediate region set.

6. The method according to claim 5, characterized in that, The false detection criteria include at least one of the following: the highest score of the candidate text region is lower than a first threshold, or the average score of the candidate text region is lower than a second threshold, or the proportion of the candidate text region belonging to a preset interference structure exceeds a predetermined proportion, and the average score of the candidate text region is lower than a third threshold.

7. The method according to claim 4, characterized in that, The step of performing a missed detection recovery process on the intermediate region set based on the scoring results to obtain the recovered region includes: expanding the regions in the intermediate region set in at least one direction to obtain multiple expanded regions; detecting the multiple expanded regions using the tree structure model to obtain the expanded region scoring results corresponding to the multiple expanded regions; and determining the expanded regions whose expanded region scoring results exceed a fourth threshold as the recovered regions.

8. The method according to claim 1, characterized in that, The optimization of the character sequence based on a preset index term to obtain the target recognition result includes: constructing a sentence-level graph model based on candidate strings in the preset index term; wherein, the characters in the candidate strings serve as nodes of the sentence-level graph model, and the spatial positional relationship of adjacent characters in the candidate strings in the image serves as edges connecting the corresponding nodes; determining the optimal character sequence from the character sequence as the target recognition result by minimizing the sentence-level loss function associated with the sentence-level graph model; wherein, the sentence-level loss function integrates the character recognition confidence and the constraints defined by the spatial positional relationship.

9. A device for detecting and recognizing OCR data, characterized in that, include: The detection module is used to obtain the maximum stable extremum region of the original image and determine the binarized text image of the original image based on the maximum stable extremum region; The first processing module is used to process the binary text image using a tree structure model to obtain initial detection results; The initial detection result includes candidate text regions and the corresponding score results for the candidate text regions; The second processing module is used to perform false detection removal and missed detection recovery processing on the candidate text regions in the initial detection results based on the scoring results, so as to obtain an optimized set of text regions. The recognition module is used to perform character recognition on the optimized text region set, obtain the recognized character sequence, and optimize the character sequence based on a preset index word list to obtain the target recognition result.

10. An electronic device, characterized in that, include: At least one processor; A memory for storing the at least one processor-executable instructions; wherein the at least one processor is configured to execute the instructions to implement the method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-8.