Character recognition method, device and storage medium

CN117746430BActive Publication Date: 2026-09-22XIAOHONGSHU TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310081938.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2026-09-22
Estimated Expiration
2043-01-31

AI Technical Summary

Benefits of technology

[0046]本申请实施例中,先对至少一个矩形区域进行OCR处理,得到各个矩形区域的候选识别结果,然后基于至少一个矩形区域的区域特征以及候选识别结果,在至少一个矩形区域中确定字符方向为非常规方向的目标矩形区域之后,按照非常规方向识别策略对目标矩形区域进行字符识别,得到目标矩形区域的目标识别结果,生成目标图像的字符识别结果,字符识别结果包括目标矩形区域的目标识别结果,以及至少一个矩形区域中除目标矩形区域以外的矩形区域的候选识别结果,可确保字符识别的准确性。另外,本申请实施例从至少一个矩形区域中筛选出字符方向为非常规方向的目标矩形区域,然后仅对目标矩形区域按照非常规方向识别策略进行字符识别,至少一个矩形区域中除目标矩形区域以外的矩形区域则按照传统的字符识别方式进行识别(即进行OCR处理,得到候选识别结果),因此可确保字符识别的识别效率。由此可见,本申请实施例能够同时兼顾字符识别的准确性和识别效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117746430B_ABST
    Figure CN117746430B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a character recognition method and device and a storage medium. The method comprises: performing text detection on a target image to obtain at least one rectangular region; performing OCR processing on the at least one rectangular region to obtain candidate recognition results of the rectangular regions; determining a target rectangular region in the at least one rectangular region based on region features of the at least one rectangular region and the recognition results, the character direction of the target rectangular region being an irregular direction; performing character recognition on the target rectangular region according to an irregular direction recognition strategy to obtain a target recognition result of the target rectangular region; and generating a character recognition result of the target image, the character recognition result comprising the target recognition result of the target rectangular region and candidate recognition results of rectangular regions in the at least one rectangular region other than the target rectangular region. The embodiments of the present application can simultaneously take into account the accuracy and efficiency of character recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to character recognition methods, devices and storage media. Background Technology

[0002] Optical character recognition (OCR) refers to the process of using computer devices (such as scanners or digital cameras) to capture images containing characters, and then using character recognition methods to translate the shapes of the characters in the image into computer text. Specifically, traditional character recognition methods typically detect the rectangular regions containing the text in each row or column of an image, and then perform character recognition on these rectangular regions. However, in real-world scenarios, the orientation of the characters in the captured images is not always conventional. Conventional orientations include horizontal or vertical alignments, while unconventional orientations include inversions, mirror flips, or 180-degree rotations. Therefore, how to perform character recognition on images with characters exhibiting unconventional orientations, while ensuring accuracy and efficiency, is a pressing technical problem that needs to be solved. Summary of the Invention

[0003] This application provides a character recognition method, apparatus, and storage medium that can simultaneously ensure both the accuracy and efficiency of character recognition.

[0004] On one hand, embodiments of this application provide a character recognition method, which includes:

[0005] Text detection is performed on the target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image;

[0006] OCR processing is performed on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information;

[0007] Based on the regional features of the at least one rectangular region and the candidate recognition results, a target rectangular region is determined in the at least one rectangular region, wherein the character direction of the target rectangular region is an unconventional direction;

[0008] The target rectangular region is subjected to character recognition according to an unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region.

[0009] Generate character recognition results for the target image, including target recognition results for the target rectangular region and candidate recognition results for rectangular regions other than the target rectangular region in the at least one rectangular region.

[0010] In one embodiment, determining the target rectangular region within the at least one rectangular region based on the regional features of the at least one rectangular region and the candidate recognition results includes:

[0011] The confidence level of each rectangular region is obtained based on the confidence level of each character in the text information contained in each rectangular region.

[0012] Obtain the initial character direction for each rectangular region, where the initial character direction refers to either a first conventional direction or a second conventional direction;

[0013] For any rectangular region group in at least one rectangular region group, the confidence level of the rectangular region group is obtained based on the confidence level of the rectangular regions contained in the rectangular region group; wherein, the initial character orientation of the rectangular regions contained in the rectangular region group is the same.

[0014] Each rectangular region in the group of rectangular regions with a confidence level less than the first confidence threshold is identified as the target rectangular region.

[0015] In one embodiment, the method further includes:

[0016] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence threshold. If the average confidence level of the first character in the text information contained in the currently traversed rectangular region is less than the second confidence threshold, or the average confidence level of the second character in the text information contained in the currently traversed rectangular region is less than the third confidence threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0017] In one embodiment, the method further includes:

[0018] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the short side length of the currently traversed rectangular region is greater than the length threshold, then the currently traversed rectangular region is identified as the target rectangular region. Here, the short side length refers to the minimum value between the length and width of the currently traversed rectangular region.

[0019] In one embodiment, the method further includes:

[0020] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the number of characters in the text information contained in the currently traversed rectangular region is greater than the number threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0021] In one embodiment, the method further includes:

[0022] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the average relative width of the characters in the currently traversed rectangular region is greater than the width threshold, then the currently traversed rectangular region is identified as the target rectangular region. The average relative width of the characters is determined based on the length and width of the currently traversed rectangular region, as well as the number of characters in the text information contained in the currently traversed rectangular region.

[0023] In one embodiment, the step of performing character recognition on the target rectangular region according to an unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region includes:

[0024] The target rectangular region is flipped in at least one direction to obtain at least one flipped rectangular region;

[0025] Perform OCR recognition processing on the at least one flipped rectangular region to obtain candidate recognition results for the at least one flipped rectangular region;

[0026] For any rectangular region among the target rectangular region and the at least one flipped rectangular region, an evaluation value for the rectangular region is obtained based on the confidence level of each character in the candidate recognition results of the rectangular region.

[0027] The candidate recognition result of the rectangular region with the highest evaluation value is taken as the target recognition result of the target rectangular region.

[0028] In one embodiment, flipping the target rectangular region in at least one direction to obtain at least one flipped rectangular region includes:

[0029] The target rectangular region is flipped vertically to obtain a flipped rectangular region.

[0030] Flip the most recently obtained flipped rectangular area horizontally to obtain a flipped rectangular area;

[0031] Flip the recently obtained flipped rectangular area vertically to obtain a flipped rectangular area.

[0032] On the other hand, embodiments of this application provide a character recognition device, which includes:

[0033] A text detection unit is used to perform text detection on a target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image;

[0034] A character recognition unit is used to perform OCR processing on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information;

[0035] A region determination unit is used to determine a target rectangular region in the at least one rectangular region based on the region features of the at least one rectangular region and the candidate recognition results, wherein the character direction of the target rectangular region is an unconventional direction.

[0036] The character recognition unit is also used to perform character recognition on the target rectangular region according to an unconventional direction recognition strategy, so as to obtain the target recognition result of the target rectangular region;

[0037] The result generation unit is used to generate character recognition results for the target image. The character recognition results include target recognition results for the target rectangular region and candidate recognition results for rectangular regions other than the target rectangular region in the at least one rectangular region.

[0038] On the other hand, embodiments of this application provide a computer device including a processor, a storage device, and a communication interface, wherein the processor, storage device, and communication interface are interconnected, wherein the storage device is used to store a computer program that supports the computer device in executing the above-described method, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the following steps:

[0039] Text detection is performed on the target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image;

[0040] OCR processing is performed on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information;

[0041] Based on the regional features of the at least one rectangular region and the candidate recognition results, a target rectangular region is determined in the at least one rectangular region, wherein the character direction of the target rectangular region is an unconventional direction;

[0042] The target rectangular region is subjected to character recognition according to an unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region.

[0043] Generate character recognition results for the target image, including target recognition results for the target rectangular region and candidate recognition results for rectangular regions other than the target rectangular region in the at least one rectangular region.

[0044] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the aforementioned character recognition method.

[0045] On the other hand, embodiments of this application provide a computer program product, which includes a computer program adapted to be loaded by a processor and executed by the character recognition method described above.

[0046] In this embodiment, at least one rectangular region is first subjected to OCR processing to obtain candidate recognition results for each rectangular region. Then, based on the regional features of the at least one rectangular region and the candidate recognition results, a target rectangular region with an unconventional character orientation is determined within the at least one rectangular region. Character recognition is then performed on the target rectangular region according to the unconventional orientation recognition strategy to obtain the target recognition result of the target rectangular region. This generates the character recognition result of the target image, which includes the target recognition result of the target rectangular region and the candidate recognition results of the rectangular regions other than the target rectangular region within the at least one rectangular region. This ensures the accuracy of character recognition. Furthermore, this embodiment filters out target rectangular regions with unconventional character orientations from the at least one rectangular region. Then, character recognition is performed only on the target rectangular region according to the unconventional orientation recognition strategy. The rectangular regions other than the target rectangular region within the at least one rectangular region are recognized using the traditional character recognition method (i.e., OCR processing is performed to obtain candidate recognition results). This ensures the efficiency of character recognition. Therefore, this embodiment can simultaneously consider both the accuracy and efficiency of character recognition. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1a This is a schematic diagram of a rectangular area where the character orientation is in a conventional direction, provided in an embodiment of this application;

[0049] Figure 1b This is a schematic diagram of another rectangular area where the character orientation is in a conventional direction, provided in an embodiment of this application;

[0050] Figure 1c This is a schematic diagram of a rectangular area where the character orientation is unconventional, provided in an embodiment of this application.

[0051] Figure 1d This is a schematic diagram of another rectangular area where the character orientation is unconventional, provided in an embodiment of this application;

[0052] Figure 1e This is a schematic diagram of another rectangular area where the character orientation is unconventional, provided in an embodiment of this application;

[0053] Figure 2 This is a flowchart illustrating a character recognition method provided in an embodiment of this application;

[0054] Figure 3 This is a flowchart illustrating another character recognition method provided in an embodiment of this application;

[0055] Figure 4 This is a flowchart illustrating another character recognition method provided in an embodiment of this application;

[0056] Figure 5 This is a schematic diagram of the structure of a character recognition device provided in an embodiment of this application;

[0057] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0059] Images on content publishing platforms (such as notes, video screenshots, advertising images, or product images) often contain text, which greatly assists in subject recognition, scene recognition, or product content recognition. Traditional character recognition methods can only recognize characters in a conventional orientation. Specifically, after performing text detection on an image to obtain at least one rectangular region, if the text information in the rectangular region is arranged horizontally (e.g., ... Figure 1a (as shown) or vertical (as shown) Figure 1b As shown in the image, traditional character recognition methods can accurately identify the characters within the rectangular area. However, if the characters in the rectangular area are in an unconventional orientation, such as when the text information in the rectangular area is arranged in a reversed, unconventional manner (e.g., ...), the character recognition method will not be able to identify the characters within the rectangular area. Figure 1c As shown), mirror flip (as shown) Figure 1d (as shown), or rotate 180 degrees (as shown) Figure 1eas shown in [ ], etc., the conventional character recognition methods cannot accurately recognize characters in rectangular areas. For example, "u" is recognized as "n", "甲" is recognized as "由", or the problem of reversed character order occurs, for example, "你好" is recognized as "好你".

[0060] Based on this, after performing text detection on a target image to obtain at least one rectangular area, the character recognition method provided by the embodiments of the present application can determine a target rectangular area whose character direction is a non-conventional direction from the at least one rectangular area, and perform character recognition on the target rectangular area according to a non-conventional direction recognition strategy, which can ensure the accuracy of character recognition. In addition, the recognition efficiency of the conventional character recognition method is higher than that of character recognition performed according to the non-conventional direction recognition strategy. Therefore, in the embodiments of the present application, only the target rectangular area is subjected to character recognition according to the non-conventional direction recognition strategy, and the rectangular areas other than the target rectangular area among the at least one rectangular area are recognized according to the conventional character recognition method, so the recognition efficiency of character recognition can be ensured. That is, the embodiments of the present application can balance both the accuracy and recognition efficiency of character recognition.

[0061] The character recognition method provided by the embodiments of the present application can be applied in a character recognition device, and the character recognition device can be installed or integrated in computer equipment. The computer equipment can include terminal equipment or a server, etc. The computer equipment includes, but is not limited to, a scanner, electronic equipment configured with an image acquisition device, etc. Examples of the electronic equipment include a smart phone, a camera, a wearable device or a computer, etc. Examples of the image acquisition device include a camera, an infrared sensor or an ultrasonic sensor, etc. Optionally, after the character recognition device obtains the character recognition result of the image, it can be applied to scenarios such as e-commerce search, e-commerce recommendation, multi-modal search or multi-modal recommendation.

[0062] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a character recognition method provided by an embodiment of the present application. The character recognition method can be executed by a character recognition device or computer equipment; as Figure 2 the character recognition scheme shown includes but is not limited to steps S201 to S205, wherein:

[0063] S201, performing text detection on a target image to obtain at least one rectangular area.

[0064] wherein, the at least one rectangular area refers to an area where at least one text in the target image is located.

[0065] In one implementation, text detection can be performed on the target image using a neural network to obtain at least one polygonal region. Each polygonal region refers to the area in the target image that indicates the location of a piece of text. If a polygonal region is not a rectangular region, then the minimum bounding rectangle of that polygonal region can be obtained, or the polygonal region can be corrected to obtain a rectangular region. Then, the minimum bounding rectangle or the corrected rectangular region can be used as the rectangular region corresponding to the polygonal region.

[0066] The polygonal region can include at least four sides, such as a quadrilateral or hexagonal region. The polygonal region can be a symmetrical polygon or an asymmetrical polygon, such as a rectangle or a sector.

[0067] The neural network includes, but is not limited to, Differentiable Binarization Networks (DBNet) or DBNet++. DBNet works by first outputting a probability map for text segmentation, then using a binarization threshold learned by the network to transform the probability map into a binary map, and finally obtaining the detection result (i.e., at least one rectangular region as described above) through post-processing. DBNet++ adds an Adaptive Scale Fusion (ASF) module to DBNet. Features at different scales are processed by the ASF module to obtain better fused features. The ASF module also introduces a spatial attention mechanism, making the fused features more robust.

[0068] In one implementation, text detection in the target image can be performed using regression-based methods to obtain at least one rectangular region. Examples of regression-based methods include TextBoxes++, EAST, DeepReg, and DeRPN. TextBoxes++ can detect text from multiple angles. EAST (Efficient and Accurate Scene Textdetector) is a pixel-based scene text detection algorithm. DeepReg is an open-source toolkit for medical image registration using deep learning. DeRPN proposes a dimensionality decomposition region proposal network capable of handling scale issues in scene text detection.

[0069] In one implementation, text detection in a target image can be performed using a component-based approach, yielding at least one rectangular region. Component-based methods include SegLink and SegLink++. The main idea behind SegLink is to decompose text into two locally detectable elements: segments (boundaries) and links. Segments are bounding boxes representing characters or words, and links connect these bounding boxes; final detection is generated by connecting the segments. SegLink++ refers to a bottom-up text detection method that is sensitive to text instances.

[0070] In one implementation, text detection in the target image can be performed based on segmentation methods to obtain at least one rectangular region. Segmentation-based methods include Mask Text Spotter and PSENet. Mask Text Spotter incorporates semantic segmentation into its end-to-end training, and its biggest advantage is its ability to detect text of arbitrary shapes. PSENet is a novel instance segmentation network capable of locating text of arbitrary shapes, and it proposes a progressive scale-scaling algorithm that successfully identifies adjacent text instances.

[0071] S202, perform OCR processing on at least one rectangular region to obtain candidate recognition results for each rectangular region. The candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information.

[0072] Traditional character recognition methods can be used to perform OCR processing on at least one rectangular region to obtain candidate recognition results for each rectangular region. The confidence level of any character refers to the probability that the recognized character is accurate.

[0073] For example, traditional character recognition methods may include Convolutional Recurrent Neural Networks (CRNNs), 2D-CTC, ACE, SVTR, SAR, and TroOCR. 2D-CTC addresses the problem of irregular images containing a large amount of background, which is noise for the model. The 1D probability matrix of CTC inevitably introduces noise, so 2D-CTC adds height information to minimize the impact of background noise on the probability matrix. ACE is a sequence recognition algorithm based on cross-entropy loss. SVTR is a scene text detection and recognition algorithm. SAR can be used to recognize irregular text (such as curved characters or artistic fonts). TroOCR refers to an end-to-end Transformer-based OCR model that utilizes a pre-trained model.

[0074] S203, based on the regional features of at least one rectangular region and the candidate recognition results, determine the target rectangular region in at least one rectangular region, wherein the character direction of the target rectangular region is an unconventional direction.

[0075] Specifically, based on the regional features of at least one rectangular region and the candidate recognition results, it can be determined whether there is a rectangular region in the at least one rectangular region with an unconventional character orientation. If so, that rectangular region is taken as the target rectangular region. If the character orientations of all rectangular regions in the at least one rectangular region are all conventional, then the candidate recognition results of each rectangular region are taken as the character recognition results of the target image.

[0076] In one implementation, the region features may include one or more of the following: the initial character orientation of the rectangular region, the length of the short side of the rectangular region, the number of characters in the text information contained in the rectangular region, and the average relative width of the characters in the rectangular region.

[0077] The specific method for determining the target rectangular region within at least one rectangular region based on the regional features of at least one rectangular region and the candidate recognition results can be found in the following embodiment description.

[0078] S204, perform character recognition on the target rectangular region according to the unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region.

[0079] If a target rectangular region exists within at least one rectangular region, then character recognition can be performed on the target rectangular region using an unconventional direction recognition strategy to obtain the target recognition result for the target rectangular region. The specific method for performing character recognition on the target rectangular region using the unconventional direction recognition strategy is detailed in the following embodiments.

[0080] S205, generate character recognition results for the target image, including target recognition results for the target rectangular region and candidate recognition results for at least one rectangular region other than the target rectangular region.

[0081] For example, suppose text detection is performed on a target image, resulting in three rectangular regions: a first rectangular region, a second rectangular region, and a third rectangular region. Based on the region features and candidate recognition results of the first rectangular region, the character direction in the first rectangular region is determined to be a normal direction. Based on the region features and candidate recognition results of the second rectangular region, the character direction in the second rectangular region is determined to be a normal direction. Based on the region features and candidate recognition results of the third rectangular region, the character direction in the third rectangular region is determined to be an unconventional direction, meaning the third rectangular region is the target rectangular region. Then, character recognition can be performed on the third rectangular region using an unconventional direction recognition strategy to obtain the target recognition result for the third rectangular region. Furthermore, the candidate recognition results of the first rectangular region, the candidate recognition results of the second rectangular region, and the target recognition result of the third rectangular region can be used as the character recognition result of the target image.

[0082] In this embodiment, at least one rectangular region is first subjected to OCR processing to obtain candidate recognition results for each rectangular region. Then, based on the regional features of at least one rectangular region and the candidate recognition results, a target rectangular region with an unconventional character direction is determined in at least one rectangular region. Character recognition is then performed on the target rectangular region according to the unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region. The character recognition result of the target image is generated. The character recognition result includes the target recognition result of the target rectangular region and the candidate recognition results of the rectangular regions other than the target rectangular region in at least one rectangular region. This approach can simultaneously ensure both the accuracy and efficiency of character recognition.

[0083] Based on the above description, please refer to Figure 3 , Figure 3 This is a flowchart illustrating another character recognition method provided in an embodiment of this application. This character recognition method can be executed by a character recognition device or a computer device; for example... Figure 3 The character recognition scheme shown includes, but is not limited to, steps S301 to S308, wherein:

[0084] S301, perform text detection on the target image to obtain at least one rectangular region.

[0085] S302, perform OCR processing on at least one rectangular region to obtain candidate recognition results for each rectangular region. The candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information.

[0086] The steps S301 and S302 can be found in the detailed descriptions of steps S201 and S202 in the above embodiments, and will not be repeated in this application embodiment.

[0087] S303, based on the confidence level of each character in the text information contained in each rectangular region, obtain the confidence level of each rectangular region.

[0088] In practice, for any rectangular region, the confidence score of each character in the text information contained within that region can be averaged to obtain the confidence score of the rectangular region. For example, suppose a rectangular region contains the text information HARVEST, where the confidence score of the character "H" is 0.98, the confidence score of the character "A" is 0.95, the confidence score of the character "R" is 0.93, the confidence score of the character "V" is 0.88, the confidence score of the character "E" is 0.89, the confidence score of the character "S" is 0.97, and the confidence score of the character "T" is 0.94. Then the confidence score of the rectangular region is: (0.98+0.95+0.93+0.88+0.89+0.97+0.94) / 7=0.93.

[0089] S304, obtain the initial character direction of each rectangular area. The initial character direction refers to the first normal direction or the second normal direction.

[0090] The initial character direction indicates whether the characters within the rectangular area are arranged horizontally or vertically; that is, the first normal direction is horizontal and the second normal direction is vertical. Alternatively, the first normal direction is vertical and the second normal direction is horizontal. For example, Figure 1a , Figure 1c , Figure 1d or Figure 1e The initial character orientation of the rectangular area shown is horizontal. Figure 1b The initial character orientation of the rectangular area shown is vertical.

[0091] S305, for any rectangular region group in at least one rectangular region group, obtain the confidence level of any rectangular region group based on the confidence level of the rectangular regions contained in any rectangular region group.

[0092] In any rectangular region group, the initial character orientation of the rectangular regions contained therein is the same.

[0093] Specifically, rectangular regions with initial character orientation in the first normal direction can be grouped into one rectangular region group (e.g., the first rectangular region group), and rectangular regions with initial character orientation in the second normal direction can be grouped into another rectangular region group (e.g., the second rectangular region group). Then, based on the confidence levels of the rectangular regions contained in each rectangular region group, the confidence level of that rectangular region group can be obtained. For example, the confidence levels of each rectangular region contained in a rectangular region group can be averaged to obtain the confidence level of that rectangular region group.

[0094] For example, suppose text detection is performed on a target image, resulting in three rectangular regions: the first rectangular region, the second rectangular region, and the third rectangular region. The initial character orientation of the first rectangular region is horizontal, the initial character orientation of the second rectangular region is vertical, and the initial character orientation of the third rectangular region is horizontal. The first and third rectangular regions form a first rectangular region group, and the second rectangular regions form a second rectangular region group. Assuming the confidence score of the first rectangular region is 0.93, the confidence score of the second rectangular region is 0.85, and the confidence score of the third rectangular region is 0.88, then the confidence score of the first rectangular region group is (0.93 + 0.88) / 2 = 0.91, and the confidence score of the second rectangular region group is 0.85.

[0095] S306, identify each rectangular region in the group of rectangular regions with a confidence level less than the first confidence level threshold as the target rectangular region.

[0096] The characters in the target rectangular region are in an unconventional orientation. The first confidence threshold is a pre-set value that is greater than 0 and less than 1. This first confidence threshold can be set based on experience or learned through a neural network.

[0097] For example, suppose the first confidence threshold is 0.87, the confidence of the first rectangular region group is 0.91, the confidence of the second rectangular region group is 0.85, and the second rectangular region group only includes the second rectangular region. Then it can be determined that the second rectangular region is the target rectangular region, that is, the character direction of the second rectangular region is an unconventional direction.

[0098] In one implementation, each rectangular region in the group of rectangular regions with a confidence level greater than or equal to a first confidence threshold is traversed. If the average confidence level of the first character in the text information contained in the currently traversed rectangular region is less than a second confidence threshold, or the average confidence level of the second character in the text information contained in the currently traversed rectangular region is less than a third confidence threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0099] For example, assuming a group of rectangular regions with a confidence level greater than or equal to a first confidence threshold is designated as the first rectangular region group, and this group includes a first rectangular region and a third rectangular region, then for any rectangular region within either the first or third rectangular region, the average confidence level of the first character and the average confidence level of the second character in the text information contained within that rectangular region can be obtained. If the average confidence level of the first character is less than the second confidence threshold, or the average confidence level of the second character is less than the third confidence threshold, then that rectangular region is identified as the target rectangular region. For instance, the first character can be Chinese, and the second character can be English. The average confidence level of the first character refers to the average confidence level of each Chinese character in the text information contained within the rectangular region, and the average confidence level of the second character refers to the average confidence level of each English character in the text information contained within the rectangular region. The second and third confidence thresholds can be set based on experience or learned through neural networks. For example, the second confidence threshold can be 0.90 and the third confidence threshold can be 0.95.

[0100] In one implementation, each rectangular region in the group of rectangular regions with a confidence level greater than or equal to a first confidence threshold is traversed. If the shorter side length of the currently traversed rectangular region is greater than a length threshold, then the currently traversed rectangular region is identified as the target rectangular region. Here, the shorter side length refers to the minimum value between the length and width of the currently traversed rectangular region. The length threshold can be set empirically or obtained through neural network learning; for example, the length threshold can be 2.

[0101] In one implementation, each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence threshold is traversed. If the number of characters in the text information contained in the currently traversed rectangular region is greater than a number threshold, then the currently traversed rectangular region is identified as the target rectangular region. The number threshold can be set empirically or obtained through neural network learning; for example, the number threshold can be 20.

[0102] In one implementation, each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold is traversed. If the average relative width of the characters in the currently traversed rectangular region is greater than the width threshold, then the currently traversed rectangular region is identified as the target rectangular region. The average relative width of the characters is determined based on the length and width of the currently traversed rectangular region, as well as the number of characters in the text information contained in the currently traversed rectangular region.

[0103] For example, the average relative width of a character can be calculated using the following formula:

[0104] W=max(H_R, W_R) / min(H_R, W_R) / len(string)

[0105] Where W can represent the average relative width of the characters, H_R can represent the length of the rectangular area, W_R can represent the width of the rectangular area, and len(string) can represent the length of the text information contained in the rectangular area, that is, the number of characters in the text information contained in the rectangular area.

[0106] The width threshold can be set based on experience or learned through a neural network; for example, the width threshold can be 5.

[0107] In one implementation, each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold is traversed. If the currently traversed rectangular region meets one or more of the following conditions, it is identified as the target rectangular region.

[0108] The following conditions may be included: the average confidence score of the first character in the text information contained in the currently traversed rectangular region is less than the second confidence score threshold, or the average confidence score of the second character in the text information contained in the currently traversed rectangular region is less than the third confidence score threshold; the length of the short side of the currently traversed rectangular region is greater than the length threshold; the number of characters in the text information contained in the currently traversed rectangular region is greater than the number threshold; and the average relative width of the characters in the currently traversed rectangular region is greater than the width threshold.

[0109] S307, perform character recognition on the target rectangular area according to the unconventional direction recognition strategy, and obtain the target recognition result of the target rectangular area.

[0110] If a target rectangular region exists within at least one rectangular region, then character recognition can be performed on the target rectangular region using an unconventional direction recognition strategy to obtain the target recognition result for the target rectangular region. The specific method for performing character recognition on the target rectangular region using the unconventional direction recognition strategy is detailed in the following embodiments.

[0111] S308, generate character recognition results for the target image, including target recognition results for the target rectangular region and candidate recognition results for at least one rectangular region other than the target rectangular region.

[0112] In this embodiment, based on the confidence level of each character in the text information contained in each rectangular region, the confidence level of each rectangular region is obtained, and the initial character direction of each rectangular region is obtained. The initial character direction refers to the first conventional direction or the second conventional direction. For any rectangular region group in at least one rectangular region group, based on the confidence level of the rectangular regions contained in any rectangular region group, the confidence level of any rectangular region group is obtained. Each rectangular region in the rectangular region group with a confidence level less than the first confidence level threshold is identified as the target rectangular region, which can accurately identify rectangular regions with non-conventional character directions.

[0113] Based on the above description, please refer to Figure 4 , Figure 4 This is a flowchart illustrating another character recognition method provided in an embodiment of this application. This character recognition method can be executed by a character recognition device or a computer device; for example... Figure 4 The character recognition scheme shown includes, but is not limited to, steps S401 to S408, wherein:

[0114] S401, perform text detection on the target image to obtain at least one rectangular region.

[0115] S402, perform OCR processing on at least one rectangular region to obtain candidate recognition results for each rectangular region. The candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information.

[0116] The steps S401 and S402 can be found in the detailed descriptions of steps S201 and S202 in the above embodiments, and will not be repeated in this application embodiment.

[0117] S403, based on the regional features of at least one rectangular region and the candidate recognition results, determine the target rectangular region in at least one rectangular region, wherein the character direction of the target rectangular region is an unconventional direction.

[0118] Step S403 can be referred to the specific description of steps S303 to S306 in the above embodiments, and will not be repeated in this application embodiment.

[0119] S404, Flip the target rectangular region in at least one direction to obtain at least one flipped rectangular region.

[0120] For example, unconventional orientations are typically inverted, mirrored, or rotated 180 degrees from the conventional orientation. The target rectangular area can be flipped vertically (vertically) or horizontally (horizontally) to obtain at least one flipped rectangular area. Vertical flipping can include at least one of the following: flipping 180 degrees from top to bottom or bottom to top; horizontal flipping can include at least one of the following: flipping 180 degrees from left to right or right to left.

[0121] In one implementation, the target rectangular area can be flipped vertically to obtain a flipped rectangular area. Then, the most recently obtained flipped rectangular area can be flipped horizontally to obtain another flipped rectangular area. Finally, the most recently obtained flipped rectangular area can be flipped vertically to obtain a flipped rectangular area.

[0122] In practice, the target rectangular region can be flipped at least once to obtain at least one flipped rectangular region. Figure 1a , Figure 1c , Figure 1d as well as Figure 1e For example, the number of flips can be 3, assuming the target rectangular area is as follows: Figure 1a As shown, the target rectangular region is flipped vertically once, and the resulting flipped rectangular region can be seen as follows. Figure 1c As shown; for Figure 1c The rectangular area shown is flipped horizontally once, and the resulting flipped rectangular area can be as follows: Figure 1d As shown; for Figure 1d The rectangular area shown is flipped vertically once, and the resulting flipped rectangular area can be as follows: Figure 1e As shown.

[0123] S405, perform OCR recognition processing on at least one flipped rectangular region to obtain candidate recognition results for at least one flipped rectangular region.

[0124] S406, for any rectangular region among the target rectangular region and at least one flipped rectangular region, obtain the evaluation value of any rectangular region based on the confidence of each character in the candidate recognition results of any rectangular region.

[0125] In one implementation, an evaluation value calculation function can be pre-defined. The input to this function is the confidence score of each character in the candidate recognition results for any rectangular region, and the output is the evaluation value for that rectangular region. For example, the evaluation value for any rectangular region can be obtained by summing the confidence scores of each character in the candidate recognition results. Alternatively, the evaluation value can be obtained by averaging the confidence scores of each character in the candidate recognition results for any rectangular region.

[0126] S407: The candidate recognition result of the rectangular region with the highest evaluation value is taken as the target recognition result of the target rectangular region.

[0127] S408, generate character recognition results for the target image. The character recognition results include target recognition results for the target rectangular region and candidate recognition results for at least one rectangular region other than the target rectangular region.

[0128] In this embodiment, based on the regional features of at least one rectangular region and the candidate recognition results, after determining the target rectangular region in at least one rectangular region, the target rectangular region can be flipped in at least one direction to obtain at least one flipped rectangular region. OCR recognition processing is performed on the at least one flipped rectangular region to obtain the candidate recognition results of the at least one flipped rectangular region. For any rectangular region in the target rectangular region and at least one flipped rectangular region, the evaluation value of any rectangular region is obtained based on the confidence of each character in the candidate recognition results of any rectangular region. The candidate recognition result of the rectangular region with the highest evaluation value is taken as the target recognition result of the target rectangular region, which can improve the accuracy of text recognition in rectangular regions where the character direction is unconventional.

[0129] This application also provides a computer storage medium storing program instructions, which, when executed, are used to implement the corresponding methods described in the above embodiments.

[0130] Please see again Figure 5 , Figure 5 This is a schematic diagram of the structure of a character recognition device provided in an embodiment of this application.

[0131] In one implementation of the character recognition device according to the embodiments of this application, the character recognition device includes the following structure.

[0132] The text detection unit 501 is used to perform text detection on the target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image;

[0133] The character recognition unit 502 is used to perform optical character recognition (OCR) processing on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information;

[0134] The region determination unit 503 is used to determine a target rectangular region in the at least one rectangular region based on the region features of the at least one rectangular region and the candidate recognition results, wherein the character direction of the target rectangular region is an unconventional direction.

[0135] The character recognition unit 502 is further configured to perform character recognition on the target rectangular region according to an unconventional direction recognition strategy, and obtain the target recognition result of the target rectangular region;

[0136] The result generation unit 504 is used to generate character recognition results for the target image. The character recognition results include target recognition results for the target rectangular region and candidate recognition results for rectangular regions other than the target rectangular region in the at least one rectangular region.

[0137] In one embodiment, the region determination unit 503 determines a target rectangular region within the at least one rectangular region based on the regional features of the at least one rectangular region and the candidate recognition results, including:

[0138] The confidence level of each rectangular region is obtained based on the confidence level of each character in the text information contained in each rectangular region.

[0139] Obtain the initial character direction for each rectangular region, where the initial character direction refers to either a first conventional direction or a second conventional direction;

[0140] For any rectangular region group in at least one rectangular region group, the confidence level of the rectangular region group is obtained based on the confidence level of the rectangular regions contained in the rectangular region group; wherein, the initial character orientation of the rectangular regions contained in the rectangular region group is the same.

[0141] Each rectangular region in the group of rectangular regions with a confidence level less than the first confidence threshold is identified as the target rectangular region.

[0142] In one embodiment, the region determination unit 503 further includes:

[0143] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence threshold. If the average confidence level of the first character in the text information contained in the currently traversed rectangular region is less than the second confidence threshold, or the average confidence level of the second character in the text information contained in the currently traversed rectangular region is less than the third confidence threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0144] In one embodiment, the region determination unit 503 further includes:

[0145] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the short side length of the currently traversed rectangular region is greater than the length threshold, then the currently traversed rectangular region is identified as the target rectangular region. Here, the short side length refers to the minimum value between the length and width of the currently traversed rectangular region.

[0146] In one embodiment, the region determination unit 503 further includes:

[0147] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the number of characters in the text information contained in the currently traversed rectangular region is greater than the number threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0148] In one embodiment, the region determination unit 503 further includes:

[0149] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the average relative width of the characters in the currently traversed rectangular region is greater than the width threshold, then the currently traversed rectangular region is identified as the target rectangular region. The average relative width of the characters is determined based on the length and width of the currently traversed rectangular region, as well as the number of characters in the text information contained in the currently traversed rectangular region.

[0150] In one embodiment, the character recognition unit 502 performs character recognition on the target rectangular region according to an unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region, including:

[0151] The target rectangular region is flipped in at least one direction to obtain at least one flipped rectangular region;

[0152] Perform OCR recognition processing on the at least one flipped rectangular region to obtain candidate recognition results for the at least one flipped rectangular region;

[0153] For any rectangular region among the target rectangular region and the at least one flipped rectangular region, an evaluation value for the rectangular region is obtained based on the confidence level of each character in the candidate recognition results of the rectangular region.

[0154] The candidate recognition result of the rectangular region with the highest evaluation value is taken as the target recognition result of the target rectangular region.

[0155] In one embodiment, the character recognition unit 502 flips the target rectangular region in at least one direction to obtain at least one flipped rectangular region, including:

[0156] The target rectangular region is flipped vertically to obtain a flipped rectangular region.

[0157] Flip the most recently obtained flipped rectangular area horizontally to obtain a flipped rectangular area;

[0158] Flip the recently obtained flipped rectangular area vertically to obtain a flipped rectangular area.

[0159] In this embodiment, the text detection unit 501 performs text detection on the target image to obtain at least one rectangular region. The character recognition unit 502 performs OCR processing on the at least one rectangular region to obtain candidate recognition results for each rectangular region. The region determination unit 503 determines a target rectangular region in the at least one rectangular region whose character direction is an unconventional direction based on the regional features of the at least one rectangular region and the candidate recognition results. The character recognition unit 502 performs character recognition on the target rectangular region according to the unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region. The result generation unit 504 generates the character recognition result of the target image. The character recognition result includes the target recognition result of the target rectangular region and the candidate recognition results of the rectangular regions other than the target rectangular region in the at least one rectangular region, which can simultaneously take into account the accuracy and efficiency of character recognition.

[0160] Please see again Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device in this embodiment includes a power supply module and other structures, and includes a processor 601, a storage device 602, and a communication interface 603. The processor 601, the storage device 602, and the communication interface 603 can exchange data, and the processor 601 implements the corresponding target detection method.

[0161] Storage device 602 may include volatile memory, such as random-access memory (RAM); storage device 602 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; storage device 602 may also include combinations of the above types of memory.

[0162] Processor 601 may be a central processing unit (CPU). Processor 601 may also be a combination of CPU and GPU. In a server, multiple CPUs and GPUs may be included as needed for corresponding data processing. In one embodiment, storage device 602 is used to store program instructions. Processor 601 can invoke program instructions to implement the various methods described above in the embodiments of this application.

[0163] In a first possible implementation, the processor 601 of the computer device calls program instructions stored in the storage device 602 to perform text detection on the target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image; perform OCR processing on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information; based on the regional features of the at least one rectangular region and the candidate recognition results, determine a target rectangular region in the at least one rectangular region, wherein the character direction of the target rectangular region is an unconventional direction; perform character recognition on the target rectangular region according to the unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region; generate the character recognition result of the target image, wherein the character recognition result includes the target recognition result of the target rectangular region and the candidate recognition results of rectangular regions other than the target rectangular region in the at least one rectangular region.

[0164] In one embodiment, when the processor 601 determines a target rectangular region within the at least one rectangular region based on the regional features of the at least one rectangular region and the candidate recognition results, it may perform the following operations:

[0165] The confidence level of each rectangular region is obtained based on the confidence level of each character in the text information contained in each rectangular region.

[0166] Obtain the initial character direction for each rectangular region, where the initial character direction refers to either a first conventional direction or a second conventional direction;

[0167] For any rectangular region group in at least one rectangular region group, the confidence level of the rectangular region group is obtained based on the confidence level of the rectangular regions contained in the rectangular region group; wherein, the initial character orientation of the rectangular regions contained in the rectangular region group is the same.

[0168] Each rectangular region in the group of rectangular regions with a confidence level less than the first confidence threshold is identified as the target rectangular region.

[0169] In one embodiment, the processor 601 may also perform the following operations:

[0170] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence threshold. If the average confidence level of the first character in the text information contained in the currently traversed rectangular region is less than the second confidence threshold, or the average confidence level of the second character in the text information contained in the currently traversed rectangular region is less than the third confidence threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0171] In one embodiment, the processor 601 may also perform the following operations:

[0172] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the short side length of the currently traversed rectangular region is greater than the length threshold, then the currently traversed rectangular region is identified as the target rectangular region. Here, the short side length refers to the minimum value between the length and width of the currently traversed rectangular region.

[0173] In one embodiment, the processor 601 may also perform the following operations:

[0174] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the number of characters in the text information contained in the currently traversed rectangular region is greater than the number threshold, then the currently traversed rectangular region is identified as the target rectangular region.

[0175] In one embodiment, the processor 601 may also perform the following operations:

[0176] Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the average relative width of the characters in the currently traversed rectangular region is greater than the width threshold, then the currently traversed rectangular region is identified as the target rectangular region. The average relative width of the characters is determined based on the length and width of the currently traversed rectangular region, as well as the number of characters in the text information contained in the currently traversed rectangular region.

[0177] In one embodiment, when the processor 601 performs character recognition on the target rectangular region according to an unconventional direction recognition strategy and obtains the target recognition result of the target rectangular region, it may perform the following operations:

[0178] The target rectangular region is flipped in at least one direction to obtain at least one flipped rectangular region;

[0179] Perform OCR recognition processing on the at least one flipped rectangular region to obtain candidate recognition results for the at least one flipped rectangular region;

[0180] For any rectangular region among the target rectangular region and the at least one flipped rectangular region, an evaluation value for the rectangular region is obtained based on the confidence level of each character in the candidate recognition results of the rectangular region.

[0181] The candidate recognition result of the rectangular region with the highest evaluation value is taken as the target recognition result of the target rectangular region.

[0182] In one embodiment, when the processor 601 flips the target rectangular region in at least one direction to obtain at least one flipped rectangular region, it may perform the following operations:

[0183] The target rectangular region is flipped vertically to obtain a flipped rectangular region.

[0184] Flip the most recently obtained flipped rectangular area horizontally to obtain a flipped rectangular area;

[0185] Flip the recently obtained flipped rectangular area vertically to obtain a flipped rectangular area.

[0186] In this embodiment, the processor performs text detection on the target image to obtain at least one rectangular region, performs OCR processing on the at least one rectangular region to obtain candidate recognition results for each rectangular region, and, based on the regional features of the at least one rectangular region and the candidate recognition results, determines a target rectangular region in the at least one rectangular region whose character direction is an unconventional direction. The processor then performs character recognition on the target rectangular region according to the unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region and generates the character recognition result of the target image. The character recognition result includes the target recognition result of the target rectangular region and the candidate recognition results of the rectangular regions other than the target rectangular region in the at least one rectangular region, which can simultaneously take into account the accuracy and efficiency of character recognition.

[0187] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The computer-readable storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The computer-readable storage medium can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of blockchain nodes, etc.

[0188] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of this application still fall within the scope of this invention.

Claims

1. A character recognition method, characterized in that, include: Text detection is performed on the target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image; Optical character recognition (OCR) processing is performed on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information; The confidence level of each rectangular region is obtained based on the confidence level of each character in the text information contained in each rectangular region. Obtain the initial character direction for each rectangular region, where the initial character direction refers to either a first conventional direction or a second conventional direction; For any rectangular region group in at least one rectangular region group, the confidence level of the rectangular region group is obtained based on the confidence level of the rectangular regions contained in the rectangular region group; wherein, the initial character orientation of the rectangular regions contained in the rectangular region group is the same. Each rectangular region in the group of rectangular regions with a confidence level less than the first confidence threshold is identified as the target rectangular region, and the character direction of the target rectangular region is an unconventional direction; The target rectangular region is subjected to character recognition according to an unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region. Generate character recognition results for the target image, including target recognition results for the target rectangular region and candidate recognition results for rectangular regions other than the target rectangular region in the at least one rectangular region.

2. The method according to claim 1, characterized in that, The method further includes: Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence threshold. If the average confidence level of the first character in the text information contained in the currently traversed rectangular region is less than the second confidence threshold, or the average confidence level of the second character in the text information contained in the currently traversed rectangular region is less than the third confidence threshold, then the currently traversed rectangular region is identified as the target rectangular region.

3. The method according to claim 1, characterized in that, The method further includes: Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the short side length of the currently traversed rectangular region is greater than the length threshold, then the currently traversed rectangular region is identified as the target rectangular region. Here, the short side length refers to the minimum value between the length and width of the currently traversed rectangular region.

4. The method according to claim 1, characterized in that, The method further includes: Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the number of characters in the text information contained in the currently traversed rectangular region is greater than the number threshold, then the currently traversed rectangular region is identified as the target rectangular region.

5. The method according to claim 1, characterized in that, The method further includes: Traverse each rectangular region in the group of rectangular regions with a confidence level greater than or equal to the first confidence level threshold. If the average relative width of the characters in the currently traversed rectangular region is greater than the width threshold, then the currently traversed rectangular region is identified as the target rectangular region. The average relative width of the characters is determined based on the length and width of the currently traversed rectangular region, as well as the number of characters in the text information contained in the currently traversed rectangular region.

6. The method according to claim 1, characterized in that, The step of performing character recognition on the target rectangular region according to the unconventional direction recognition strategy to obtain the target recognition result of the target rectangular region includes: The target rectangular region is flipped in at least one direction to obtain at least one flipped rectangular region; Perform OCR recognition processing on the at least one flipped rectangular region to obtain candidate recognition results for the at least one flipped rectangular region; For any rectangular region among the target rectangular region and the at least one flipped rectangular region, an evaluation value for the rectangular region is obtained based on the confidence level of each character in the candidate recognition results of the rectangular region. The candidate recognition result of the rectangular region with the highest evaluation value is taken as the target recognition result of the target rectangular region.

7. The method according to claim 6, characterized in that, The step of flipping the target rectangular region in at least one direction to obtain at least one flipped rectangular region includes: The target rectangular region is flipped vertically to obtain a flipped rectangular region. Flip the most recently obtained flipped rectangular area horizontally to obtain a flipped rectangular area; Flip the recently obtained flipped rectangular area vertically to obtain a flipped rectangular area.

8. A character recognition device, characterized in that, The device includes: A text detection unit is used to perform text detection on a target image to obtain at least one rectangular region; wherein, the at least one rectangular region refers to the region where at least one text is located in the target image; A character recognition unit is used to perform optical character recognition (OCR) processing on the at least one rectangular region to obtain candidate recognition results for each rectangular region; wherein, the candidate recognition results include text information in the corresponding rectangular region and the confidence level of each character in the text information; A region determination unit is configured to: obtain the confidence level of each rectangular region based on the confidence level of each character in the text information contained in each rectangular region; obtain the initial character direction of each rectangular region, wherein the initial character direction refers to a first conventional direction or a second conventional direction; for any rectangular region group in at least one rectangular region group, obtain the confidence level of any rectangular region group based on the confidence level of the rectangular regions contained in that rectangular region group; wherein the initial character direction of the rectangular regions contained in that rectangular region group is the same direction; and identify each rectangular region in the rectangular region group with a confidence level less than a first confidence level threshold as the target rectangular region, wherein the character direction of the target rectangular region is an unconventional direction. The character recognition unit is also used to perform character recognition on the target rectangular region according to an unconventional direction recognition strategy, so as to obtain the target recognition result of the target rectangular region; The result generation unit is used to generate character recognition results for the target image. The character recognition results include target recognition results for the target rectangular region and candidate recognition results for rectangular regions other than the target rectangular region in the at least one rectangular region.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause a computer device having the processor to perform the steps of the method according to any one of claims 1-7.

10. A computer device, characterized in that, The computer device includes a processor, a storage device, and a communication interface, which are interconnected. The storage device is used to store a computer program, which includes program instructions. The processor is configured to invoke the program instructions to perform the steps of the method as described in any one of claims 1-7.

11. A computer program product, characterized in that, The computer program product includes a computer program adapted to be loaded by a processor and to perform the steps of the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Image information extraction method and system for text direction clustering correction

    CN113869314A

  • Local Scale, Rotation and Position Invariant Word Detection for Optical Character Recognition

    US20140193075A1

  • Automatic method of detection of incorrectly oriented text blocks using results from character recognition

    US6993205B1