Text recognition method for natural scene, readable storage medium and text recognition device
By adjusting the text angle to 0 degrees through text region detection, perspective transformation, and deep learning models, the problem of low recognition efficiency of text at different angles in natural scenes is solved, and efficient single-character segmentation and recognition are achieved.
Patent Information
- Application Number
- CN202111565107.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2041-12-20
AI Technical Summary
Text recognition in natural scenes struggles to handle text from different angles, resulting in low recognition efficiency.
By acquiring the text image to be recognized, text region detection and perspective transformation are performed. A deep learning model is used to train an angle detection model, the text angle is adjusted to 0 degrees, and single character segmentation and recognition are performed.
It improves the recognition efficiency of text from different angles, reduces the difficulty of character segmentation and recognition, and unifies the text angle to the state that the human eye is used to viewing, thereby improving the recognition accuracy.
Smart Images

Figure CN114220108B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of character recognition, in particular to a natural scene text recognition method, readable storage medium and text recognition device. BACKGROUND
[0002] Under the current tide of technological development, it is common to use image recognition technology to recognize characters. It can be mainly divided into optical character recognition and text recognition in natural scenes. Optical character recognition (OCR) mainly faces high-definition document images. Such technology assumes that the input image background is clean, the font is simple, and the text arrangement is neat. Under the premise of meeting this requirement, the trained network model can achieve high recognition accuracy and the training process is fast.
[0003] Text recognition in natural scenes (STR) mainly faces natural scene images containing text. However, the characters in some natural scene text in life have different angles and other attributes, which makes it difficult to recognize the characters in these natural scenes. SUMMARY
[0004] In view of the prior art, the technical problem solved by the present application is to provide a natural scene text recognition method, readable storage medium and terminal which can improve the recognition efficiency of text containing characters with different angles.
[0005] To solve the above technical problems, the present application provides a natural scene text recognition method, which comprises:
[0006] Obtaining a to-be-recognized text image, detecting the text region of the to-be-recognized text image to obtain a first text region of a rectangular frame;
[0007] Performing perspective transformation on the first text region, and rotating the first text region after perspective transformation to obtain a second text region, so that the long side of the rectangular frame of the second text region is parallel to the X-axis;
[0008] Training an angle detection model based on a deep learning model, detecting the angle of the characters in the second text region using the angle detection model, and adjusting the angle of the characters in the second text region of the rectangular frame according to the angle detected by the angle detection model to obtain a third text region, so that the included angle of the characters in the third text region is 0 degrees;
[0009] Performing single-character segmentation and single-character recognition on the characters in the third text region;
[0010] Wherein, the X-axis and the Y-axis are perpendicular to each other to form an image coordinate system, and the character angle is the included angle between the character and the Y-axis.
[0011] In a possible implementation, the step of rotating the first text region after the perspective transformation to obtain the second text region comprises:
[0012] determining whether the length ratio of the rectangular frame of the first text region on the Y axis and the X axis is greater than 1.5;
[0013] if yes, rotating the first text region of the rectangular frame counterclockwise by 90 degrees;
[0014] otherwise, rotating the first text region of the rectangular frame counterclockwise by 0 degrees.
[0015] In a possible implementation, the step of obtaining the angle detection model based on the deep learning model training comprises:
[0016] cutting a text image of a rectangular frame in which characters are horizontally parallel and the character angle is 0 degrees in a natural scene as a data set;
[0017] dividing the data set into six parts, and recording the six parts as a first data, a second data, a third data, a fourth data, a fifth data, and a sixth data respectively;
[0018] rotating each character in each text image in the first data counterclockwise by 0 degrees to obtain a first training data set; rotating each character in each text image in the second data counterclockwise by 90 degrees to obtain a second training data set; rotating each character in each text image in the third data counterclockwise by 180 degrees to obtain a third training data set; rotating each character in each text image in the fourth data counterclockwise by 270 degrees to obtain a fourth training data set; rotating each character in each text image in the fifth data counterclockwise by 45 degrees to obtain a fifth training data set; and rotating each character in each text image in the sixth data clockwise by negative 45 degrees to obtain a sixth training data set;
[0019] extracting the first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set, and the sixth training data set about the character angle features of the text image to generate a feature map by using a feature layer of a ShuffleNetV2 network model, learning and training based on the ShuffleNetV2 network model until the ShuffleNetV2 network model converges, and obtaining the angle detection model.
[0020] In a possible implementation, the number of text images in the first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set, and the sixth training data set is the same.
[0021] In a possible implementation, the step of performing character angle adjustment on the second text region of the rectangular frame according to the angle detected by the angle detection model to obtain a third text region includes:
[0022] if the angle of the character in the second text region detected by the angle detection model is 0 degree, the angle of the character in the second text region is maintained unchanged;
[0023] if the angle of the character in the second text region detected by the angle detection model is 90 degrees, the second text region is rotated counterclockwise by 270 degrees;
[0024] if the angle of the character in the second text region detected by the angle detection model is 180 degrees, the second text region is rotated counterclockwise by 180 degrees;
[0025] if the angle of the character in the second text region detected by the angle detection model is 270 degrees, the second text region is rotated counterclockwise by 90 degrees;
[0026] if the angle of the character in the second text region detected by the angle detection model is 45 degrees, the second text region is rotated counterclockwise by 215 degrees.
[0027] In a possible implementation, the step of performing text region detection on the to-be-recognized text image to obtain a first text region of a rectangular frame includes:
[0028] performing five times of convolution operation on the text image by using a 3*3 convolution kernel, and performing cascade fusion based on a feature pyramid network on results of the five times of convolution to obtain a feature map of the text image;
[0029] performing prediction on the feature map by using a DBNet learning network to obtain a probability map related to text;
[0030] performing threshold operation on the probability map to obtain a segmentation result related to text;
[0031] extracting an outline of the segmentation result, calculating a circumscribed rectangular frame of the outline, and taking the circumscribed rectangular frame as a first text region of a region rectangular frame.
[0032] In a possible implementation, the step of performing single-character segmentation and single-character recognition on the character in the third text region includes:
[0033] segmenting all single characters in the third text region and a circumscribed rectangular frame of each single character by using a yolov3 model;
[0034] according to an order of horizontal coordinates of top-left vertices of the circumscribed rectangular frames of all single characters from small to large, inputting the single characters into a single-character recognition model one by one for character recognition.
[0035] In a possible implementation, the single-character recognition model is a ResNet50 learning model.
[0036] The application further provides a computer readable storage medium storing a computer program, which, when executed by a processor, implements the natural scene text recognition method.
[0037] The application further provides a text recognition device, which comprises a memory and one or more processors, and the memory and the processors are coupled; the memory is configured to store computer program code, the computer program code comprising computer instructions, which, when executed by the text recognition device, cause the text recognition device to perform the natural scene text recognition method.
[0038] In the natural scene text recognition method, first, a text region of a text image to be recognized is detected to obtain a first text region of a rectangular frame; and the first text region after perspective transformation is rotated to obtain a second text region, so that the long side of the rectangular frame of the second text region is parallel to the X axis, that is, the second text region of a horizontal rectangular frame is obtained; then an angle detection model trained is used to detect the angle of the characters in the second text region, and the second text region of the rectangular frame is adjusted in character angle according to the angle detected by the angle detection model to obtain a third text region, so that the included angle of the characters in the third text region is 0 degrees, that is, the characters in the third text region have no angle deviation on the Y axis, so that the character angles in the third text region are unified to the state habitually viewed by human eyes; thus, the problem of increasing the difficulty of subsequent character recognition and affecting the efficiency of character recognition due to different angles of characters is solved. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0040] Figure 1 Flowchart of the natural scene text recognition method of the embodiments of the present application;
[0041] Figure 2 Result schematic diagram of the obtained first text region, perspective transformation and rotation of the first text region, obtained second text region and obtained third text region of the embodiments of the present application;
[0042] Figure 3A flowchart of steps of the embodiment of the present application for performing single-character segmentation and single-character recognition on the characters in the third text region. DETAILED DESCRIPTION
[0043] In order to make the technical problems to be solved, technical solutions and beneficial effects of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0044] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0045] It should be understood that the terms "length", "width", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the present application and simplify the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.
[0046] In addition, the terms "first", "second", "third", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined with "first", "second", etc. can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.
[0047] The natural scene text recognition method, readable storage medium and text recognition device provided by the embodiments of the present application will now be described in conjunction with the accompanying drawings.
[0048] Referring to Figure 1 The natural scene text recognition method provided by the embodiments of the present application includes the following steps:
[0049] Step S100: acquiring a text image to be recognized, performing text region detection on the text image to be recognized to obtain a first text region of a rectangular frame, wherein, Figure 2 Each text in the first column represents a text result of the first text region of the rectangular frame obtained by performing text region detection.
[0050] Step S200: perspective transformation is performed on the first text region, and the second text region is obtained by rotating the perspective-transformed first text region, so that the long side of the rectangular frame of the second text region is parallel to the X-axis.
[0051] Step S300: an angle detection model is obtained based on deep learning model training.
[0052] Step S400: the angle of the text in the second text region is detected by using the angle detection model.
[0053] Step S500: the text angle of the second text region of the rectangular frame is adjusted according to the angle detected by the angle detection model to obtain a third text region, so that the included angle of the text in the third text region is 0 degrees.
[0054] Step S600: single character segmentation and single character recognition are performed on the characters in the third text region.
[0055] In the above steps, the X-axis and the Y-axis are perpendicular to each other to form an image coordinate system, as shown in Figure 2 It is worth noting that the text angle is the included angle between the text and the Y-axis, which can be understood as the angle deviation between the text observed by the human eye and the Y-axis. For the sake of understanding the text angle, for example, Figure 2 the text angle in the text region of the fifth rectangular frame of the first column of text in Figure 2 the text angle in the text region of the first rectangular frame of the second column of text in Figure 2 the text angle in the text region of the fifth rectangular frame of the third column of text in Figure 2 the text angle in the text region of the sixth rectangular frame of the third column of text in Figure 2 the text angle in the text region of the seventh rectangular frame of the third column of text in Figure 2 the text angle in the text region of the second rectangular frame of the third column of text in
[0056] Referring to Figure 3 , in step S100, the step of detecting the text region of the text image to be recognized to obtain the first text region of the rectangular frame includes:
[0057] Step S110: five times of convolution operation are continuously performed on the text image by using a 3*3 convolution kernel.
[0058] Step S120: the results of the five times of convolution are cascaded and fused based on a feature pyramid network (FPN) to obtain a feature map of the text image; wherein the features in the feature map are features related to the characteristics of the text image.
[0059] Step S130: predicting the feature map to obtain a probability map of the text by using the DBNet learning network.
[0060] Step S140: performing a threshold operation on the probability map to obtain a segmentation result of the text.
[0061] Step S150: extracting a contour of the segmentation result, and calculating a bounding rectangle of the contour as a first text region of the region rectangle.
[0062] In an application embodiment, the threshold value of the threshold operation in step S140 is 0.2.
[0063] In step S200, the first text region is subjected to a perspective transformation, and the second column of text is obtained by performing a perspective transformation on the first column of text in the first text region. Figure 2 The result of performing a perspective transformation on the first column of text in the first text region is the second column of text.
[0064] In step S200, the step of rotating the first text region subjected to the perspective transformation to obtain the second text region includes: judging whether the length ratio of the rectangular frame of the first text region in the Y axis and the X axis is greater than 1.5; if yes, rotating the first text region of the rectangular frame counterclockwise by 90 degrees; otherwise, rotating the first text region of the rectangular frame counterclockwise by 0 degrees. Figure 2 The third column of text in the first text region subjected to the perspective transformation is the result of rotating the second column of text.
[0065] It can be understood that the length of the rectangular frame of the first text region in the Y axis can be understood as the height of the rectangular frame, and the length of the rectangular frame of the first text region in the X axis can be understood as the width of the rectangular frame; therefore, the rotation of the first text region subjected to the perspective transformation in step S200 is to obtain a horizontal rectangular frame, that is, at this time, the long side of the rectangular frame of the second text region is parallel to the X axis; if the rectangular frame is in a positive direction, any side length can be determined as the long side, that is, the length of the rectangular frame of the first text region in the X axis is set as the long side or the length of the rectangular frame of the first text region in the Y axis is set as the long side.
[0066] Step S300: the step of training the angle detection model based on the deep learning model includes:
[0067] Cutting a text image of a rectangular frame of characters horizontally and vertically distributed in a natural scene and with a character angle of 0 degrees as a data set;
[0068] Dividing the data set into six parts, respectively denoted as a first data, a second data, a third data, a fourth data, a fifth data and a sixth data;
[0069] The first training data set is obtained by rotating each character of each text image in the first data counterclockwise by 0 degrees; the second training data set is obtained by rotating each character of each text image in the second data counterclockwise by 90 degrees; the third training data set is obtained by rotating each character of each text image in the third data counterclockwise by 180 degrees; the fourth training data set is obtained by rotating each character of each text image in the fourth data counterclockwise by 270 degrees; the fifth training data set is obtained by rotating each character of each text image in the fifth data counterclockwise by 45 degrees; and the sixth training data set is obtained by rotating each character of each text image in the sixth data clockwise by negative 45 degrees.
[0070] The first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set and the sixth training data set are extracted by using a feature layer of a ShuffleNetV2 network model to generate a feature map about the character angle features of the text images, and learning and training are performed based on the ShuffleNetV2 network model until the ShuffleNetV2 network model converges, so as to obtain an angle detection model. The ShuffleNetV2 network model is a neural network model.
[0071] Further, to improve the accuracy of the angle detection model, the number of text images in the first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set and the sixth training data set is set to be the same. Moreover, negative samples are added to the first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set and the sixth training data set.
[0072] Further reference is made to Figure 1 In step S500, the step of adjusting the character angle of the second text region of the rectangular frame according to the angle detected by the angle detection model to obtain a third text region includes:
[0073] Step S510: If the character angle in the second text region detected by the angle detection model is 0 degrees, the angle of the character in the second text region is maintained unchanged.
[0074] Step S520: If the character angle in the second text region detected by the angle detection model is 90 degrees, the second text region is rotated counterclockwise by 270 degrees.
[0075] Step S530: If the character angle in the second text region detected by the angle detection model is 180 degrees, the second text region is rotated counterclockwise by 180 degrees.
[0076] Step S540: if the angle of the text in the second text region detected by the angle detection model is 270 degrees, rotate the second text region counterclockwise by 90 degrees.
[0077] Step S550: if the angle of the text in the second text region detected by the angle detection model is 45 degrees, rotate the second text region counterclockwise by 215 degrees.
[0078] It is worth noting that the text included angle of 0 degrees can be understood as: when the text is viewed by the person's usual visual angle, the text is normally vertically written and has no angle deviation in the vertical direction; for example, Figure 2 The text in the fourth column of text in the table is 0 degrees with the Y axis direction, and when the text in the fourth column of text region is observed by the person's usual visual angle, the text is normally vertically written and has no angle deviation in the vertical direction.
[0079] In step S500, the second text region of the rectangular frame is adjusted according to the angle detected by the angle detection model to obtain a third text region, so that the angle of the text in the third text region is parallel to the Y axis, i.e. the angle of the text in the third text region has no angle deviation in the vertical direction, so that the angle of the text in the third text region is uniform to the state of the person's usual habit of viewing, so as to facilitate subsequent single character segmentation and single character recognition, and reduce the difficulty of subsequent character segmentation and character recognition. It can be understood that when the text angle is various, the text in the commonly used character recognition library is generally normally vertically written, so that when different angle character recognition is performed using the commonly used character recognition library, the recognition difficulty and recognition efficiency will be inevitably affected.
[0080] In the table, Figure 2 The fourth column of text in the table is the result of angle detection and text angle adjustment on the third column of text using the angle detection model.
[0081] In step S600, the steps of single character segmentation and single character recognition on the characters in the third text region include: using the yolov3 model to segment all single characters and the outer rectangular frame of each single character in the third text region; according to the order from small to large of the horizontal coordinates of the top left corner vertices of the outer rectangular frames of all single characters, the single characters are input into the single character recognition model one by one for character recognition.
[0082] In an application embodiment, the single character recognition model is a ResNet50 learning model. The training data for training the ResNet50 learning model is 6763 Chinese characters in the first and second level character library of the character set GB2312-80. To increase the diversity of the data set and increase the accuracy of the ResNet50 learning model, the brightness of at least part of the character images in the character set used for training the model is changed to 70% to 130% of the original; the contrast of at least part of the character images is randomly changed to 70% to 130% of the original; the saturation of at least part of the character images is randomly changed to 70% to 130% of the original; and the images with the changed brightness, saturation and contrast are added to the original character set to generate new training data.
[0083] In the text recognition method of the natural scene, first, a text region of a text image to be recognized is detected to obtain a first text region with a rectangular frame; and the first text region after perspective transformation is rotated to obtain a second text region with a rectangular frame whose long side is parallel to the X axis, i.e., a second text region with a horizontal rectangular frame; then an angle detection model trained is used to detect the angle of the characters in the second text region, and the second text region with a rectangular frame is adjusted in character angle according to the angle detected by the angle detection model to obtain a third text region with characters at an angle of 0 degrees, i.e., the characters in the third text region have no angle deviation on the Y axis, so that the characters in the third text region are uniformly at an angle habitually viewed by human eyes; thus, the problem of increasing the difficulty of subsequent character recognition and affecting the efficiency of character recognition due to different angles of characters is solved.
[0084] The application embodiment further provides a computer readable storage medium storing a computer program, and the computer program is executed by a processor to implement the text recognition method of the natural scene in the above embodiment.
[0085] In the embodiment, the computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)), etc.
[0086] The embodiment of the present application further provides a text recognition device, which comprises a memory and one or more processors, the memory and the processor are coupled; the memory is used for storing computer program codes, the computer program codes comprise computer instructions, when the computer instructions are executed by the text recognition device, the text recognition device executes the natural scene text recognition method in the embodiment.
[0087] In the embodiment, the processor can include one or more processing units, for example: the processor can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc.; wherein different processing units can be independent devices, or can be integrated in one or more processors. The memory can be, but is not limited to, an electric, magnetic, optical or semiconductor system, device or apparatus, specifically, but not limited to, a magnetic disk, a hard disk, a read-only memory, a random access memory or an erasable programmable read-only memory. The processor can be a central processing unit, and can also be other general-purpose processors, digital signal processors, application-specific integrated circuits, ready programmable gate arrays or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0088] The above merely describes the preferred embodiments of the present application and is not used to limit the present application, and any modifications, equivalent replacements and improvements made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for text recognition in natural scenes, characterized in that, The method comprises the following steps: obtaining a to-be-recognized text image, performing text region detection on the to-be-recognized text image to obtain a first text region in a rectangular frame; performing perspective transformation on the first text region, and rotating the first text region after the perspective transformation to obtain a second text region, so that the long side of the rectangular frame of the second text region is parallel to the X-axis; training an angle detection model based on a deep learning model, detecting the angle of the characters in the second text region by using the angle detection model, and adjusting the angle of the characters in the second text region based on the angle detected by the angle detection model to obtain a third text region, so that the included angle of the characters in the third text region is 0 degrees; performing single-character segmentation and single-character recognition on the characters in the third text region; wherein the X-axis and the Y-axis are perpendicular to each other to form an image coordinate system, and the angle of the characters is the included angle between the characters and the Y-axis.
2. The natural-scene text recognition method of claim 1, wherein, The step of rotating the first text region after the perspective transformation to obtain the second text region comprises: determining whether the length ratio of the rectangular frame of the first text region to the Y-axis and the X-axis is greater than 1.5; if yes, rotating the first text region of the rectangular frame counterclockwise by 90 degrees; otherwise, rotating the first text region of the rectangular frame counterclockwise by 0 degrees.
3. The natural-scene text recognition method of claim 1, wherein, The step of training the angle detection model based on the deep learning model comprises: cutting text images of rectangular frames in which characters are horizontally parallel and the angle of the characters is 0 degrees in a natural scene as a data set; dividing the data set into six parts, respectively denoted as first data, second data, third data, fourth data, fifth data and sixth data; rotating each character in each text image in the first data counterclockwise by 0 degrees to obtain a first training data set; rotating each character in each text image in the second data counterclockwise by 90 degrees to obtain a second training data set; rotating each character in each text image in the third data counterclockwise by 180 degrees to obtain a third training data set; rotating each character in each text image in the fourth data counterclockwise by 270 degrees to obtain a fourth training data set; rotating each character in each text image in the fifth data counterclockwise by 45 degrees to obtain a fifth training data set; and rotating each character in each text image in the sixth data clockwise by negative 45 degrees to obtain a sixth training data set; extracting the first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set and the sixth training data set about the angle features of the text images by using the feature layer of the ShuffleNetV2 network model to generate a feature map, learning and training based on the ShuffleNetV2 network model until the ShuffleNetV2 network model converges, and obtaining the angle detection model.
4. The natural-scene text recognition method of claim 3, wherein, The number of text images in the first training data set, the second training data set, the third training data set, the fourth training data set, the fifth training data set and the sixth training data set is the same.
5. The natural-scene text recognition method of claim 3, wherein, The step of adjusting the angle of the characters in the second text region based on the angle detected by the angle detection model to obtain the third text region comprises: if the angle of the text in the second text region detected by the angle detection model is 0 degree, maintaining the angle of the text in the second text region unchanged; if the angle of the text in the second text region detected by the angle detection model is 90 degrees, rotating the second text region 270 degrees counterclockwise; if the angle of the text in the second text region detected by the angle detection model is 180 degrees, rotating the second text region 180 degrees counterclockwise; if the angle of the text in the second text region detected by the angle detection model is 270 degrees, rotating the second text region 90 degrees counterclockwise; if the angle of the text in the second text region detected by the angle detection model is 45 degrees, rotating the second text region 215 degrees counterclockwise.
6. The natural-scene text recognition method of claim 1, wherein, The step of detecting the first text region of the rectangular frame in the text image to be recognized includes: performing five times of convolution operation on the text image by using a 3*3 convolution kernel, and performing cascade fusion of the feature pyramid network based on the results of the five times of convolution to obtain a feature map of the text image; using a DBNet learning network to predict the feature map to obtain a probability map of the text; performing threshold operation on the probability map to obtain a segmentation result of the text; extracting the contour of the segmentation result, calculating the circumscribed rectangular frame of the contour, and taking the rectangular frame as the first text region of the region rectangular frame.
7. The natural-scene text recognition method of claim 1, wherein, The step of performing single character segmentation and single character recognition on the characters in the third text region includes: segmenting all single characters in the third text region and the circumscribed rectangular frame of each single character by using a yolov3 model; according to the order from small to large of the horizontal coordinates of the top left corner vertices of the circumscribed rectangular frames of all single characters, inputting the single characters into a single character recognition model one by one for character recognition.
8. The natural-scene text recognition method of claim 1, wherein, The single character recognition model is a ResNet50 learning model.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the text recognition method in any one of claims 1 to 8.
10. A text recognition apparatus characterized by comprising: The text recognition device includes a memory and one or more processors, and the memory and the processors are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions, when the computer instructions are executed by the text recognition device, the text recognition device executes the text recognition method in any one of claims 1 to 8.
Citation Information
Patent Citations
Method, system and device for recognizing characters
CN112085022A
Slanted text detection method, apparatus and device
CN113785305A