Image text information recognition method, device and storage medium

By combining text detection model and text recognition model, end-to-end image text information extraction is realized, solving the problem that recognition speed depends on network speed in the prior art, improving recognition accuracy and efficiency, and supporting offline use.

CN110659633BActive Publication Date: 2025-04-11CANDELA SHENZHEN TECH INNOVATE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910753155.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-15
Publication Date
2025-04-11
Estimated Expiration
2039-08-15

AI Technical Summary

Technical Problem

In the prior art, the recognition speed of image text information is heavily dependent on network speed, and has high requirements for server performance and cannot be used offline.

Method used

Using a method combining text detection model and text recognition model, the area to be identified in the image is pre-processed, the text area is detected, the bias correction process is performed, and finally text recognition is performed to achieve end-to-end text information extraction.

Benefits of technology

It realizes image text information recognition that does not rely on network transmission, improves recognition accuracy and efficiency, and supports offline use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110659633B_ABST
    Figure CN110659633B_ABST
Patent Text Reader

Abstract

The present application discloses a method for recognizing text information in an image, and the recognition method includes: obtaining an area to be recognized in an image, and preprocessing the area to be recognized; inputting the preprocessed image into a text detection model to obtain the coordinates of a quadrilateral text box of all text areas in the area to be recognized; performing a first cropping of each text area according to the coordinates of the quadrilateral text box; performing a correction process on the cropped text area; and using a text recognition model to recognize each text area after the correction process to obtain text information. Through the above method, the present application can realize end-to-end text information extraction and improve the accuracy and efficiency of image text information recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to image detection technology, and in particular to a method, device and storage medium for recognizing image text information. Background Art

[0002] Text information extraction includes text detection and text recognition (Optical Character Recognition, OCR), that is, extracting text content from the text area of ​​​​the image. It is widely used in image search, business card recognition, bill recognition, product recommendation and precise advertising delivery.

[0003] In recent years, with the rapid development of e-commerce, the collection and delivery of express parcels has exploded, and the express delivery workload in the logistics industry has increased dramatically. The address information of the freight bill is an important basis for the delivery of objects. Whether the address information can be correctly identified is the key to whether the object can be delivered correctly. The existing technology extracts text information from freight documents. The method usually used is that the mobile terminal calls the application programming interface (API) provided by the open platform to identify the image content, such as Baidu AI Open Platform, Youtu OCR, etc. The mobile terminal receives the recognition results and performs corresponding processing.

[0004] However, the problems caused by the text information extraction scheme in the existing technology are as follows: 1. It requires network transmission, and its image recognition speed is seriously dependent on the network speed; 2. It requires frequent API calls, which has high requirements on server performance; 3. It cannot be used offline. Summary of the invention

[0005] The present application provides a method, device and storage medium for recognizing image text information, which can solve the problems in the prior art that the text information recognition speed is heavily dependent on the network speed, has high requirements on server performance and cannot be used offline.

[0006] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a method for identifying image text information, the identification method comprising: obtaining an area to be identified in an image, and preprocessing the area to be identified; inputting the preprocessed image into a text detection model to obtain the quadrilateral text box coordinates of all text areas in the area to be identified; performing a first cropping on each of the text areas according to the quadrilateral text box coordinates; performing a correction processing on the cropped text areas; and using a text recognition model to identify each text area after the correction processing to obtain the text information.

[0007] The clipping of each of the text regions according to the quadrilateral text frame coordinates comprises: calculating the rectangular frame coordinates of each of the text regions according to the quadrilateral text frame coordinates; and clipping the text regions for the first time according to the rectangular frame coordinates.

[0008] Among them, the correction processing of the cropped text area includes: calculating the rotation angle value of the text area according to the text box coordinates; rotating the text area to a horizontal direction according to the rotation angle value; and performing a second cropping on the rotated text area to retain the area where the text information is located.

[0009] The second cropping of the rotated text area includes: keeping the width of the rotated text area unchanged, obtaining the text box height of the text area; calculating the cropping value of the text area according to the height of the text box; and cropping the text area for the second time according to the cropping value.

[0010] The width of the rectangular frame is greater than or equal to the width of the quadrilateral frame.

[0011] Among them, after the correction processing is performed on each of the text areas according to the position information, it further includes: converting the text area after the correction processing into a grayscale image; keeping the aspect ratio of the grayscale image unchanged, and scaling the height of the grayscale image to a preset value; converting the pixel value of the grayscale image into a floating point number, and preprocessing each of the pixel values.

[0012] The preprocessing of the area to be identified includes: keeping the aspect ratio of the area to be identified unchanged, scaling the width of the area to be identified to a second preset width value; and performing color space reduction processing on the scaled area to be identified.

[0013] The recognition method further comprises: combining and correcting the text information recognized in each text area in sequence, and outputting the recognized text segment.

[0014] In order to solve the above technical problems, another technical solution adopted in the present application is: to provide a device for recognizing image text information, the device includes a processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to call the computer program to execute the above-mentioned recognition method.

[0015] In order to solve the above technical problems, another technical solution adopted in the present application is: providing a storage medium, wherein the storage medium stores a computer program, and the computer program can be executed by a processor to perform the above-mentioned identification method.

[0016] The beneficial effects of the present application are: providing a method, device and storage medium for recognizing image text information, which can achieve end-to-end text information extraction by combining a text detection model and a text recognition model, without the need for any preprocessing of the input image, and can improve the accuracy and efficiency of image text information recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flowchart of the first implementation method of the image text information recognition method of the present application;

[0018] Figure 2 It is a flowchart of an implementation method of step S100 of the present application;

[0019] Figure 3 It is a schematic diagram of the processing flow of the image text information recognition method of the present application;

[0020] Figure 4 It is a flowchart of an implementation method of step S300 of the present application;

[0021] Figure 5 It is a flowchart of an implementation method of step S400 of the present application;

[0022] Figure 6 It is a flowchart of an implementation method of step S430 of the present application;

[0023] Figure 7 It is a schematic diagram of an embodiment of a device for recognizing image text information of the present application;

[0024] Figure 8 It is a structural schematic diagram of an implementation method of a storage medium of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] The image text information recognition method provided in this application can be applied to many scenarios such as logistics order number recognition, image search, business card recognition, bill recognition, product recommendation and precise advertising. This application takes the input of express document information in the logistics scenario as an example to introduce the image text information recognition method in detail.

[0027] It is understandable that the warehousing of express documents in the prior art is usually done manually, and its input workload is extremely large, slow, and prone to error. In order to run the neural network model on the Android platform, the present application adopts the TensorflowMobile framework. Wherein, the two models involved in the present application are mainly text detection model (Connectionist TextProposal Network, CTPN) and text recognition model (Convolutional Recurrent Neural Network, CRNN), and the CTPN and CRNN models are both implemented with the Keras framework (Tensorflow backend), which can realize the conversion of the weight file of the model training into a static image (pb format) adapted to the mobile terminal, as a resource file for subsequent loading of the model. In this way, the CTPN and CRNN models are jointly deployed on the Android mobile terminal device, without the need for network transmission, and can be used offline, and the combination of the two can realize the extraction of end-to-end text information, without any pre-processing of the input image. The text information recognition method of the present application is described in detail below.

[0028] Please refer to the figure, Figure 1 The flowchart of the first embodiment of the method for recognizing image text information of the present application is as follows: Figure 1 As shown, the image text information recognition method provided by this application includes the following steps:

[0029] S100, obtaining a region to be identified in an image, and preprocessing the region to be identified.

[0030] In a specific application scenario of the present application, the camera of a mobile device is called to shoot the express delivery document that needs to be identified. The mobile device here can be a device equipped with an Android operating system, such as a mobile phone, a tablet computer, etc., which is not specifically limited here.

[0031] In this embodiment, the mobile phone camera is used to shoot the express document to obtain image information, and the area to be identified in the image is further selected. Here, the area to be identified in the image can be manually selected, or the mobile phone can automatically select the text area to be identified in the image. There is no specific limitation here. After selecting and intercepting the area to be identified in the image, the intercepted area to be identified is further preprocessed. Please combine Figure 2 , Figure 2 This is a flow chart of an implementation method of step S100 of the present application. Step S100 further includes the following sub-steps:

[0032] S110, keeping the aspect ratio of the area to be identified unchanged, and scaling the width of the area to be identified to a second preset width value.

[0033] Optionally, in step S110, the aspect ratio of the area to be identified is kept unchanged, and the width of the area to be identified is scaled to a second preset width value. In the present embodiment, the second preset width value may be 640 pixels (Pixel), and in other embodiments it may be other pixel values, that is, the selection of the width value of the area to be identified may be different in different application scenarios, which is not specifically limited here. Among them, the aspect ratio of the area to be identified is kept unchanged, that is, the ratio of the height to the width of the area to be identified before and after scaling remains unchanged. For example, assuming that the height of the area to be identified is 320 pixels and the width is 200 pixels, after the width is scaled to 640 pixels, the height automatically becomes 400 pixels.

[0034] It is understandable that the larger the input image size, the better the subsequent text information recognition effect, but in actual applications, the larger the image, the slower the processing speed. This application comprehensively considers the processing speed and recognition accuracy, and scales the width of the area to be recognized to 640 pixels.

[0035] S120, performing color space reduction processing on the scaled area to be identified.

[0036] Optionally, the image obtained in the present application is a color image, that is, a three-channel image (red channel, green channel, blue channel), and the grayscale value range of each color channel can be 0 to 255. In this embodiment, in order to facilitate the training of the model, the scaled image (the area to be identified in this article) is subjected to color space reduction processing, that is, the pixel values ​​of the red channel, the green channel, and the blue channel are respectively subtracted from the preset pixel average value, thereby avoiding the inability to fit the model due to the huge difference in values. In this embodiment, the grayscale values ​​of the red channel, the green channel, and the blue channel are respectively subtracted by 103.939, 116.779, and 123.68, thereby completing the preprocessing of the area to be identified.

[0037] S200, inputting the preprocessed image into a text detection model to obtain the coordinates of the quadrilateral text boxes of all text areas in the area to be recognized.

[0038] Please combine Figure 3 , Figure 3 This is a schematic diagram of the processing flow of the image text information recognition method of this application. Figure 3 It can be seen that the preprocessed image is input into the text detection model (CTPN), and the text detection model outputs the coordinates of the quadrilateral text boxes of all text areas in the area to be identified in the image. Figure 3As shown, the coordinates of the quadrilateral text box of the text area output by the text detection model in the present application can be represented by four coordinate points, namely C = {P1, P2, P3, P4}, where P1 (x1, y1) is the first coordinate point of the quadrilateral text box, P2 (x2, y2) is the second coordinate point of the quadrilateral text box, P3 (x3, y3) is the third coordinate point of the quadrilateral text box, and P4 (x4, y4) is the fourth coordinate point of the quadrilateral text box, which respectively represent the upper left coordinate, upper right coordinate, lower right coordinate and lower left coordinate of the quadrilateral text box. Each coordinate point of the quadrilateral text box output by this detection model is composed of an X-axis and a Y-axis, and the length L of the quadrilateral text box is the Euclidean distance between the third coordinate point and the fourth coordinate point. The specific expression is as follows:

[0039]

[0040] S300, performing a first cropping on each text area according to the coordinates of the quadrilateral text box.

[0041] It is understandable that because the text detection model outputs a quadrilateral text box, and only a rectangular area can be cropped during actual cropping, it is necessary to calculate the coordinates of the rectangular box based on the coordinates of the quadrilateral text box before the first cropping to facilitate cropping. Figure 4 , Figure 4 This is a flow chart of an implementation method of step S300 of the present application. Step S300 further includes the following sub-steps:

[0042] S310, calculating the rectangular frame coordinates of each text area according to the quadrilateral text frame coordinates.

[0043] Combination Figure 3 , the text box output by the text detection model is a quadrilateral ( Figure 3 10 in the figure), and the coordinate points of the quadrilateral text box are represented by P1, P2, P3, and P4. The rectangular box ( Figure 3 20) is the coordinate B(b1, b2), where b1 = (x min ,y min ) represents the upper left coordinate point of the rectangular text box, b2 = (x max ,y max ) represents the lower right coordinate point of the text box, x min 、x max ,y min and max The calculation formula is as follows:

[0044] x min =min(x1,x2,x3,x4)-Margin (2)

[0045] xmax=max(x1,x2,x3,x4)+Margin (3)

[0046] y min =min(y1,y2,y3,y4)-Margin (4)

[0047] y max =max(y1, y2, y3, y4)+Margin (5)

[0048] Among them, the function min(……) represents the minimum value of the X axis or Y axis in the quadrilateral coordinate frame, and similarly, the function max(……) represents the maximum value of the X axis or Y axis in the quadrilateral coordinate frame. Margin represents the outer margin of the text box, and its expression is:

[0049] Margin=(LL*cos(θ)) / 2(6)

[0050] Wherein, θ represents the tilt radian value of the text area, which is described in detail below and will not be repeated here. It can be understood that the coordinates of the rectangular frame calculated in the above manner (combined with the outer margin of the text frame) can completely wrap the text area to ensure that the text area will not be cropped.

[0051] S320: Perform a first cropping of the text area according to the coordinates of the rectangular frame.

[0052] like Figure 3 The block diagram 20 shown shows the rectangular area to be intercepted, and the first cropping is performed according to the coordinate points of the rectangular text box obtained in step S310. Optionally, in order to ensure that the two ends of the rotated text area will not be cropped during the correction process, the width of the rectangular box should be set to be greater than or equal to the width of the quadrilateral box.

[0053] S400, performing a deflection correction process on the cropped text area.

[0054] Optionally, the text area after the first cropping needs to be de-skewed before text recognition. Figure 5 This is a flow chart of an implementation method of step S400 of the present application. Step S400 further includes the following sub-steps:

[0055] S410, calculating the rotation angle value of the text area according to the text box coordinates.

[0056] It is understandable that the quadrilateral text box output by the text detection module in this application may be tilted, so it needs to be corrected before text recognition, that is, the text area is changed from tilted to horizontal, so as to improve the recognition accuracy of the subsequent text recognition model. Specifically, the inclination arc value θ between the straight line connecting the two points and the horizontal direction is calculated based on the third coordinate point P3 and the fourth coordinate point P4 of the quadrilateral text box. Among them, the expression of θ is as follows:

[0057] θ=arctan((y4-y3) / (x3-x4)) (7)

[0058] The rotation angle value expression is:

[0059] D=θπ*180 (8)

[0060] The above expression (8) works by converting the tilt radian value θ into a rotation angle value D.

[0061] S420: Rotate the text area to a horizontal direction according to the rotation angle value.

[0062] According to the rotation angle value D in step S420, the text area is rotated to the horizontal direction, thereby ensuring the recognition accuracy of the subsequent text recognition model. In the specific application scenario of the first embodiment, the rotation angle value D calculated in step S420 is 30°, then the actual rotation angle of the text area is -30°, that is, the text area is rotated 30° in the opposite direction, so that the rotated text area can be ensured to be in the horizontal direction. Of course, the embodiment is only a schematic illustration. In other embodiments, the rotation angle value D is based on the actual calculated value, and 30 should not be used as a specific limitation here.

[0063] S430: performing a second cropping on the rotated text area to retain the area where the text information is located.

[0064] Furthermore, in order to obtain compact text information, the rotated text area needs to be cropped a second time to retain only the area where the text information is located. Figure 6 , Figure 6 This is a flow chart of an implementation method of step S430 of the present application. Step S430 further includes the following sub-steps:

[0065] S431, keeping the width of the rotated text area unchanged, and obtaining the text box height of the text area.

[0066] Keep the width of the rotated text area unchanged, and calculate the height of the text box according to the first coordinate point P1 and the fourth coordinate point P4 of the quadrilateral text box or according to the second coordinate point P2 and the third coordinate point P3. The height T of the text box is the Euclidean distance between the first coordinate point and the fourth coordinate point of the quadrilateral text box, and the calculation formula is as follows:

[0067]

[0068] Of course, the height T of the text box can also be the Euclidean distance between the second coordinate point P2 and the third coordinate point P3, that is:

[0069]

[0070] In actual application scenarios, it is selected as needed and no specific limitation is made here.

[0071] S432, calculating the clipping value of the text area according to the height of the text box.

[0072] Optionally, the height of the text area can be calculated according to the height T of the text box, which can be expressed as H. According to the height H of the text area, the minimum Y-axis coordinates minY and maxY of the text area can be obtained. The expressions are as follows:

[0073] minY=H / 2-T / 2 (11)

[0074] maxY=H / 2+T / 2 (12)

[0075] Among them, H / 2 is the midpoint coordinate of the text area on the Y axis, so the cropping value of the second cropping of the text area is obtained.

[0076] S433, performing a second cropping on the text area according to the cropping value.

[0077] Optionally, the text region is cropped for the second time according to the cropping values ​​(minimum Y-axis coordinates minY and maxY) in step S432, so that a final compact text region can be obtained.

[0078] S500, converting the text area after the deskew processing into a grayscale image.

[0079] Optionally, before performing text recognition on the text region, the preprocessed text region needs to be converted into a grayscale image.

[0080] S600, maintaining the aspect ratio of the grayscale image unchanged, and scaling the height of the grayscale image to a preset value.

[0081] Because the text recognition model processing stage only requires the height value of the image, the aspect ratio of the grayscale image is kept unchanged in step S600, and the height of the grayscale image is scaled to a preset value. For example, if the original height of the grayscale image is 64 pixels and the width is 560 pixels, then after the height is scaled to 32 pixels, the width will automatically become 280 pixels. In other words, the aspect ratio is maintained, and after the height is scaled, the width will automatically scale. And the purpose of scaling the height value of the grayscale image in step S600 is to standardize the data of the grayscale image, that is, to present a Gaussian distribution, to facilitate model training, and to avoid the inability to fit the model due to huge differences in values.

[0082] S700, converting the pixel values ​​of the grayscale image into floating point numbers, and preprocessing each pixel value.

[0083] Finally, the 8-bit unsigned integer pixel values ​​of the grayscale image are converted to floating-point numbers, and each pixel value is preprocessed by dividing it by 255 and then subtracting 0.5.

[0084] It is understandable that, in order to facilitate model training, the operations in steps S500 to S700 are preprocessing processes for the text area after the correction process. And steps S500 to S700 are not mandatory steps for implementing this application, and those skilled in the art may modify or omit them according to actual usage.

[0085] S800: using a text recognition model to recognize each text region after the correction process to obtain text information.

[0086] Each text region after the correction processing is input into the text recognition model to obtain the text information of each text region. Optionally, the text information of each text region identified by the text recognition model is combined and corrected in sequence to output a complete text segment.

[0087] In the above implementation, by combining the text detection model and the text recognition model, end-to-end text information extraction can be achieved without any preprocessing of the input image, which can improve the accuracy of image text information recognition and the efficiency of text information recognition. In addition, the Tensoflow Mobile framework is used in this application to deploy both the text detection model and the text recognition model on an Android mobile device, so no network transmission is required and it can be used offline.

[0088] It can be understood that the above implementation only takes the express documents in the logistics scenario as an example to introduce in detail the method for recognizing text information in the image of the present application. The image text information recognition method of the present application can also be applied to many fields such as image search, business card recognition, bill recognition, product recommendation and precise advertising delivery, which will not be repeated here.

[0089] See also Figure 7 , Figure 7 This is a schematic diagram of an embodiment of a device for recognizing image text information of the present application. Figure 7 As shown, the recognition device includes a processor 11 and a memory 12. The processor 11 is connected to the memory 12. The memory 12 is used to store computer programs. The processor 11 is used to call the computer program to execute the text information recognition method in any implementation manner.

[0090] The processor 11 may also be referred to as a CPU (Central Processing Unit). The processor 11 may be an integrated circuit chip having the ability to process signals. The processor 11 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0091] The processor in the above-mentioned device can respectively execute the corresponding steps in the above-mentioned identification method embodiment, so it will not be repeated here. Please refer to the description of the above corresponding steps for details.

[0092] See also Figure 8 , Figure 8 The storage medium 100 of the present application stores a computer program 110, wherein the computer program 110 is used to implement the image text information recognition method in the above embodiment when executed by a processor.

[0093] The storage medium 110 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other media that can store program codes.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0095] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0096] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0097] In summary, it is easy for those skilled in the art to understand that the present application provides a method, device and storage medium for recognizing image text information. By combining a text detection model and a text recognition model, end-to-end text information extraction can be achieved without any preprocessing of the input image, which can improve the accuracy of image text information recognition and improve the efficiency of text information recognition.

[0098] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for recognizing image text information, characterized in that: The identification method comprises: Acquire a region to be identified in the image, and preprocess the region to be identified; Inputting the preprocessed image into a text detection model to obtain the coordinates of the quadrilateral text boxes of all text areas in the area to be identified; The rectangular frame coordinates of each of the text areas are determined according to the coordinates of the quadrilateral text frame and the extension margin of the quadrilateral text frame, wherein the rectangular frame coordinates of each of the text areas are determined according to the following formula: x min [min(x1、x2、x3、x4)-Margin, x max =max(x1、x2、x3、x4)+Margin, <h2 style=";text-align:left;direction:ltr">y<h2 style=";text-align:left;direction:ltr"> min <h2 style=";text-align:left;direction:ltr"> =min(y1、y2、y3、y4)-Margin, <h2 style=";text-align:left;direction:ltr">y<h2 style=";text-align:left;direction:ltr"> max <h2 style=";text-align:left;direction:ltr"> =max(y1、y2、y3、y4)+Margin, Among them, x1, x2, x3, and x4 respectively represent the X-axis coordinates of the coordinate points of the quadrilateral text box, y1, y2, y3, and y4 respectively represent the Y-axis coordinates of the coordinate points of the quadrilateral text box, the function min(...) represents obtaining the minimum value of the X-axis or Y-axis in the coordinates of the quadrilateral text box, and similarly, the function max(...) represents obtaining the maximum value of the X-axis or Y-axis in the coordinates of the quadrilateral text box, and Margin represents the extension margin of the quadrilateral text box. The extension margin of the quadrilateral text box satisfies the following formula: Margin=(LL*cos(θ)) / 2, Among them, L satisfies the formula: θ represents the tilt radian value of the text area; Performing a first cropping of the text area according to the rectangular frame coordinates; Performing a deflection correction process on the cropped text area; A text recognition model is used to recognize each text region after the correction process to obtain the text information.

2. The identification method according to claim 1, characterized in that: The performing the deflection correction process on the cropped text area comprises: Calculate the rotation angle value of the text area according to the coordinates of the quadrilateral text box; Rotating the text area to a horizontal direction according to the rotation angle value; The rotated text area is cropped for the second time to retain the area where the text information is located.

3. The identification method according to claim 2, characterized in that: The second cropping of the rotated text area comprises: Keep the width of the text area unchanged after rotation, and obtain the text box height of the text area; Calculate the clipping value of the text area according to the height of the text box; The text area is cropped a second time according to the cropping value.

4. The identification method according to claim 1, characterized in that: The width of the rectangular frame is greater than or equal to the width of the quadrilateral text frame.

5. The identification method according to claim 1, characterized in that: After the correction processing is performed on the cropped text area, the following further comprises: Converting the text area after the correction process into a grayscale image; Keeping the aspect ratio of the grayscale image unchanged, scaling the height of the grayscale image to a preset value; The pixel values ​​of the grayscale image are converted into floating point numbers, and each of the pixel values ​​is preprocessed.

6. The identification method according to claim 1, characterized in that: The preprocessing of the to-be-identified area comprises: Keeping the aspect ratio of the area to be identified unchanged, scaling the width of the area to be identified to a second preset width value; The scaled area to be identified is subjected to color space reduction processing.

7. The identification method according to claim 1, characterized in that: The identification method further comprises: The text information recognized in each text area is combined and corrected in sequence, and the recognized text segment is output.

8. A device for recognizing image text information, characterized in that: The device includes a processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to call the computer program to execute the identification method described in any one of claims 1-7.

9. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to implement the identification method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • OCR-based credential recognition method, a device, a computer device and a storage medium

    CN109492643A

  • Text image correction method based on image projection transformation

    CN110097054A