Text recognition method and device, electronic equipment and storage medium

By adjusting the position and semantic recognition of text images of different shooting angles, the inaccuracy problem of text recognition caused by image slitting methods in the prior art is solved, and higher reliability and accuracy of text recognition are achieved.

CN119399785APending Publication Date: 2025-02-07GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411516853.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing image data recognition methods recognize text information through image slitting, which can easily cause slitting and damage to text information, resulting in recognition errors and inaccuracies.

Method used

By acquiring at least two text images of different shooting angles and adjusting the position, a standard text image of the text to be identified at a standard acquisition angle is obtained. Then, the character splitting line between lines and the character splitting line within lines are determined, the character data set is extracted, and semantic recognition is performed to obtain the text content.

Benefits of technology

It improves the reliability and accuracy of text recognition, avoids the slitting damage of text information by image slitting method, and enhances the image quality and character extraction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399785A_ABST
    Figure CN119399785A_ABST
Patent Text Reader

Abstract

The invention discloses a text recognition method and device, electronic equipment and a storage medium, and relates to the technical field of data recognition. The method comprises the following steps: acquiring at least two text images acquired from a to-be-recognized text; performing pose adjustment on the at least two text images to obtain a standard text image of the to-be-recognized text at the standard acquisition angle; extracting characters in the standard text image to obtain a corresponding character data set; and performing semantic recognition on the character data set to obtain text content corresponding to the to-be-recognized text. According to the technical scheme provided by the invention, the reliability and accuracy of character recognition can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data recognition technology, and in particular to a text recognition method, device, electronic device and storage medium. Background Art

[0002] With the development of science and technology, mobile devices are one of the common devices used in users' daily work and life. At present, image data recognition is a convenient means of information acquisition and conversion for mobile devices. By identifying and extracting text information from images, it can improve the convenience and efficiency of users' work such as meeting records, class notes and data backup.

[0003] The existing image data recognition method mainly obtains image data by cutting the image data into several blocks and extracting the text information in the blocks in turn. Although the image cutting method can reduce the text recognition content of each block and improve the efficiency and accuracy of text recognition, the image cutting method is easy to cause cutting damage to the text information content of the original image, causing interference or recognition errors in the recognition of incomplete information in each block, affecting the reliability of the overall image text information recognition. Summary of the invention

[0004] The present application provides a text recognition method, device, electronic device and storage medium, which can improve the reliability and accuracy of text recognition.

[0005] In a first aspect, the present application provides a text recognition method, the method comprising:

[0006] Acquire at least two text images collected for the text to be recognized;

[0007] Adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle;

[0008] Extracting characters from the standard text image to obtain a corresponding character data set;

[0009] Semantic recognition is performed on the character data set to obtain text content corresponding to the text to be recognized.

[0010] Furthermore, the posture of the at least two text images is adjusted to obtain a standard text image of the text to be recognized at a standard acquisition angle, including: determining at least two key positions in each text image; connecting the at least two key positions to obtain coordinate data of the at least two key positions; calculating the deflection data of each text image between the current image acquisition angle and the standard acquisition angle based on the coordinate data; calculating the first text image corresponding to each text image at the standard acquisition angle based on the deflection data corresponding to each text image; and correcting and superimposing the first text images corresponding to the at least two text images to obtain the standard text image of the text to be recognized.

[0011] Furthermore, the characters in the standard text image are extracted to obtain a corresponding character data set, including: identifying reference characters in the standard text image; determining inter-line character segmentation lines and intra-line character segmentation lines of the characters in the standard text image based on the reference characters; and extracting the characters on each line in the standard text image in turn based on the inter-line character segmentation lines and the intra-line character segmentation lines to obtain the character data set.

[0012] Furthermore, determining the inter-line character division lines and intra-line character division lines of the characters in the standard text image based on the reference character includes: performing character searches in the horizontal and vertical directions based on the reference character to identify a first adjacent character adjacent to the reference character in the horizontal direction and a second adjacent character adjacent to the reference character in the vertical direction; calculating the intra-line character division lines based on the position data of the reference character and the position data of the first adjacent character; and calculating the inter-line character division lines based on the position data of the reference character and the position data of the second adjacent character.

[0013] Furthermore, semantic recognition is performed on the character data set to obtain text content corresponding to the text to be recognized, including: marking a plurality of reference characters from the character data set based on a preset character marking method; extracting characters adjacent to each reference character to obtain a plurality of character groups; performing semantic recognition on the plurality of character groups based on a preset semantic model to obtain text to be output corresponding to the semantic recognition results; and performing semantic verification on the text to be output to obtain text content corresponding to the text to be recognized.

[0014] Furthermore, the text to be output is semantically checked to obtain text content corresponding to the text to be recognized, including: performing phrase pairing on each character in the text to be output to determine target characters that cannot be phrase paired; determining whether the target characters are separate characters by performing semantic recognition on the target characters; if not separate characters, performing semantic check based on phrases corresponding to characters adjacent to the separate characters to obtain text content corresponding to the text to be recognized.

[0015] Furthermore, before adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle, it also includes: performing image preprocessing on each of the at least two text images to obtain a processed text image.

[0016] In a second aspect, the present application provides a text recognition device, the device comprising:

[0017] An image acquisition module, used to acquire at least two text images collected for the text to be recognized;

[0018] An image processing module, used for adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle;

[0019] A character extraction module, used to extract characters from the standard text image to obtain a corresponding character data set;

[0020] The text recognition module is used to perform semantic recognition on the character data set to obtain the text content corresponding to the text to be recognized.

[0021] In a third aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text recognition method described in any embodiment of the present application.

[0022] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text recognition method described in any embodiment of the present application when executed.

[0023] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the text recognition method described in any embodiment of the present application.

[0024] In order to solve the defects of the prior art in the background technology, the embodiment of the present application provides a text recognition method, and the execution of the method can bring the following beneficial effects: the present application obtains at least two text images at different shooting angles, performs image conversion on the text images at different shooting angles, adjusts the contour posture state of the text image, and obtains a standard text image of the text to be recognized at a standard acquisition angle, which can improve the image quality of the text image. The present application first determines the character segmentation lines between lines and the character segmentation lines within lines, and then extracts the characters in the standard text image based on the character segmentation lines between lines and the character segmentation lines within lines to obtain a character data set, which can avoid the problem of segmentation damage to the text information content of the original image due to the use of image segmentation, and can improve the accuracy of character extraction, and then when performing semantic recognition on the character data set, it can improve the reliability and accuracy of text recognition.

[0025] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the text recognition device, or may be packaged separately from the processor of the text recognition device, which is not limited in this application.

[0026] The description of the second, third, ..., and fifth aspects in this application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, ..., and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.

[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.

[0028] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, and usage scenarios of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0030] Figure 1 A flowchart of a text recognition method provided in an embodiment of the present application;

[0031] Figure 2A structural diagram of a text recognition device provided in an embodiment of the present application;

[0032] Figure 3 It is a block diagram of an electronic device used to implement a text recognition method in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of this application.

[0034] It should be noted that the terms "first", "second", "target", and "original" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having", and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0035] Figure 1 This is a flowchart of a text recognition method provided in an embodiment of the present application. This embodiment can be applied to the case of recognizing text in a photo. The text recognition method provided in this embodiment can be performed by a text recognition device provided in an embodiment of the present application. The device can be implemented in software and / or hardware and integrated in an electronic device that performs the method.

[0036] See also Figure 1 The method of this embodiment includes but is not limited to the following steps:

[0037] S110: Acquire at least two text images collected for the text to be recognized.

[0038] The text to be recognized refers to a text content on an object (such as paper or a display screen) that needs to be recognized. The text image refers to image data collected (such as photographed) from the text content on an object.

[0039] In an embodiment of the present application, taking the recognition of text data (i.e., text to be recognized) in a display screen of an instrument as an example, the display screen is photographed by a high-definition camera of a mobile device (such as a tablet computer, mobile phone, etc.) to obtain at least two photographs of the text to be recognized, i.e., text images.

[0040] Preferably, in order to improve the image quality of the text image, it may be required that at least two text images have shooting angles that differ by at least 15°. That is, during the process of capturing text images, the user can obtain at least two text images at different shooting angles by adjusting the shooting angle of the mobile device at the same shooting position.

[0041] S120: Adjust the posture of at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle.

[0042] In the embodiment of the present application, image conversion is performed on text images taken at different shooting angles to adjust the contour position and posture of the text image.

[0043] Specifically, the posture adjustment of at least two text images is performed to obtain a standard text image of the text to be recognized at a standard acquisition angle, including: first, determining at least two key positions in each text image, such as: the upper left corner of the image, the center point of the image, etc. Second, connecting at least two key positions by a preset coordinate calculation formula to obtain coordinate data of at least two key positions. Third, calculating the deflection data of each text image between the current image acquisition angle and the standard acquisition angle based on the coordinate data by a preset angle calculation formula, and the deflection data includes a deflection matrix and a translation matrix. Among them, the standard acquisition angle refers to the angle of shooting directly above the display screen of the instrument. Fourth, based on the deflection data corresponding to each text image, the coordinate data of each pixel point in each text image is calculated and converted into the corresponding coordinate data at the standard acquisition angle, thereby obtaining the first text image corresponding to each text image at the standard acquisition angle. Fifth, after performing image conversion processing on the photo image data of different shooting angles, the first text images after at least two image conversions are corrected and superimposed to obtain the standard text image of the text to be recognized.

[0044] The coordinate data of the pixel points in the text image are converted, and the coordinate conversion relationship corresponding to the pixel points is shown in the following formula (1):

[0045] [X1,Y1]=M1[X0,Y0]

[0046]

[0047] Where [X1, Y1] is the projection coordinate distance of the pixel point at the standard acquisition angle. is the coordinate data of the pixel point at the standard acquisition angle; [X0, Y0] is the projection coordinate distance of the pixel point at the current image acquisition angle, is the coordinate data of the pixel point at the current image acquisition angle; M1 is the translation matrix between the text image at the current image acquisition angle and the text image at the standard acquisition angle (ie, the first text image), R1 T is the deflection matrix between the text image at the current image acquisition angle and the text image at the standard acquisition angle (ie, the first text image).

[0048] In an optional embodiment, before adjusting the posture of at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle, it also includes: in order to improve the image quality and recognition accuracy, in view of interference factors such as reflections and shadows that may exist on the display screen of the instrument, each of the at least two text images is subjected to some image preprocessing operations such as grayscale, binarization, denoising and scaling to obtain a processed text image.

[0049] S130: Extract characters from the standard text image to obtain a corresponding character data set.

[0050] In an embodiment of the present application, multiple lines of text recognition can be performed on the text part of a standard text image based on a long short-term memory network (LSTM) model. The LSTM model adds an input gate, an output gate, and a forget gate to the short-term memory model (RNN). Through these three logical control units, the LSTM model can better control the flow and memory of information, increase the memory length of the model, and enable the model to simultaneously recognize multiple lines of text in a photo.

[0051] Specifically, characters in a standard text image are extracted to obtain a corresponding character data set, including: identifying reference characters in the standard text image; performing character search in a preset direction based on the position data of the reference characters, determining adjacent characters adjacent to the reference characters in the preset direction, and then calculating inter-line character segmentation lines and intra-line character segmentation lines based on the position data of the adjacent characters; based on the inter-line character segmentation lines and intra-line character segmentation lines, a LSTM model can be used to simultaneously obtain multiple lines of text content, and the characters on each line in the standard text image are extracted in turn to obtain a character data set.

[0052] The reference character is a character located at a key position to assist in text recognition, and can be the first character in a standard text image. The intra-line character segmentation line refers to a segmentation line between characters in the same line in a text image, and the inter-line character segmentation line refers to a segmentation line between characters in two adjacent lines in a text image.

[0053] Furthermore, determining the inter-line character segmentation lines and the intra-line character segmentation lines of the characters in the standard text image based on the reference characters includes:

[0054] First, based on the reference character, a character search is performed in the horizontal and vertical directions, and a first adjacent character adjacent to the reference character in the horizontal direction and a second adjacent character adjacent to the reference character in the vertical direction are identified. Exemplarily, the first character of the first line in the standard text image is identified, the first character is set as the reference character, the position point of the reference character is determined, and a character search is performed in the left and downward directions. The second character (i.e., the first adjacent character) is obtained in the horizontal direction, and the first character of the second line (i.e., the second adjacent character) is obtained in the vertical direction.

[0055] Second, the character segmentation line within the line is calculated based on the position data of the reference character and the position data of the first adjacent character. The position of the character segmentation line within the line is expressed by the following formula (2):

[0056] LQ=(L1-Ld)*τ (2)

[0057] Wherein, LQ is the distance between the position of the reference character and the position of the intra-line character segmentation line, L1 is the distance between the reference character and the first adjacent character, Ld is the unit length of the character, τ is the proportional coefficient, 0.6≤τ≤0.8; so that the intra-line character segmentation line is close to the first adjacent character.

[0058] Third, the line character segmentation line is calculated based on the position data of the reference character and the position data of the second adjacent character. The position of the line character segmentation line is expressed by the following formula (3):

[0059] LQ′=(L2-Lh)*0.5 (3)

[0060] Among them, LQ′ is the distance between the reference character and the position of the line dividing line between characters, L2 is the distance between the reference character and the second adjacent character, Lh is the unit height of the character, and the line dividing line between characters is located in the middle between two lines.

[0061] S140: Perform semantic recognition on the character data set to obtain text content corresponding to the text to be recognized.

[0062] Specifically, semantic recognition is performed on the character dataset to obtain the text content corresponding to the text to be recognized, including: First, arrange the characters in the character dataset in the order in the text image, and mark multiple reference characters from the character dataset based on a preset character marking method. For example, even-position character data in the character dataset can be marked as reference characters. Second, extract the characters adjacent to each reference character to obtain multiple character groups. For example, according to the position of the reference character, extract the character before the reference character and combine it with the reference character to form a character group; extract the character after the reference character to form another character group; starting from the reference character, extract the characters adjacent to the reference character to obtain multiple character groups of the reference character, and the number of characters in any one character group is between 2 and 5. Third, perform semantic recognition on multiple character groups based on a preset semantic model to obtain the text to be output corresponding to the semantic recognition result. Fourth, perform semantic verification on the text to be output to obtain the text content corresponding to the text to be recognized.

[0063] Further, the specific process of performing semantic recognition on multiple character groups based on a preset semantic model is as follows: perform phrase matching on multiple character groups in the semantic model database to obtain the phrases corresponding to the multiple character groups; find the characters at the positions corresponding to the reference characters in each phrase. For example, if the position of the reference character in the character group is the 2nd, then find the 2nd character in each phrase. Extract the characters found at the positions corresponding to the reference characters in the phrases as candidate characters and temporarily store them; calculate the credibility of the candidate characters corresponding to the reference characters, assign weights according to the character groups in which the candidate characters corresponding to the reference characters appear and the matching phrases, calculate the candidate characters with high credibility, and output the candidate character as the reference character. After completing the recognition of the characters at even positions in the text content, remove the first and last characters of the text content to obtain new character arrangement data, and repeat the above semantic analysis of the even-position characters for the new character arrangement data to determine the accurate character data content corresponding to each character in the text content, so as to obtain the text to be output corresponding to the semantic recognition result.

[0064] Further, performing semantic verification on the text to be output to obtain the text content corresponding to the text to be recognized includes: performing phrase pairing on each word in the text to be output to determine the target words that cannot be paired into phrases; determining whether the target words are single characters (such as auxiliary words like "de", "di", "wei", "shi", etc.) by performing semantic recognition on the target words; if they are not single characters, then perform semantic verification based on the phrases corresponding to the words adjacent to the single characters to obtain the text content corresponding to the text to be recognized.

[0065] In an optional embodiment, the process of phrase pairing for each character in the output text is as follows: detecting whether the character group composed of the first character and the second character in the output text is a word, the second character is a character adjacent to the first character in a preset direction; if it is a word, marking the first character and the second character as the first word; detecting whether the character group composed of the third character and the first word is a new word, the third character is a character adjacent to the second character in a preset direction; if it is a word, re-marking the third character and the first word as the second word; if it is not a word, taking the third character as the new first character, and repeatedly executing the operation of detecting whether the character group composed of the first character and the second character in the output text is a word, completing the phrase pairing task, and also obtaining the target character that cannot be phrase paired.

[0066] The technical solution provided in this embodiment is to obtain at least two text images collected for the text to be recognized; adjust the posture of at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle; extract the characters in the standard text image to obtain a corresponding character data set; and perform semantic recognition on the character data set to obtain the text content corresponding to the text to be recognized. The present application obtains at least two text images at different shooting angles, performs image conversion on the text images at different shooting angles, adjusts the contour posture state of the text image, and obtains a standard text image of the text to be recognized at a standard acquisition angle, which can improve the image quality of the text image. The present application first determines the character segmentation lines between lines and the character segmentation lines within lines, and then extracts the characters in the standard text image based on the character segmentation lines between lines and the character segmentation lines within lines to obtain a character data set, which can avoid the problem of segmentation damage to the text information content of the original image due to the use of image segmentation, and can improve the accuracy of character extraction, and then when the character data set is semantically recognized, the reliability and accuracy of text recognition can be improved.

[0067] Figure 2 A structural diagram of a text recognition device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the device 200 may include:

[0068] An image acquisition module 210 is used to acquire at least two text images collected for the text to be recognized;

[0069] An image processing module 220 is used to adjust the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle;

[0070] A character extraction module 230 is used to extract characters from the standard text image to obtain a corresponding character data set;

[0071] The text recognition module 240 is used to perform semantic recognition on the character data set to obtain text content corresponding to the text to be recognized.

[0072] Furthermore, the above-mentioned image processing module 220 can be specifically used to: determine at least two key positions in each text image; connect the at least two key positions to obtain coordinate data of the at least two key positions; calculate the deflection data of each text image between the current image acquisition angle and the standard acquisition angle based on the coordinate data; calculate the first text image corresponding to each text image at the standard acquisition angle based on the deflection data corresponding to each text image; correct and overlap the first text images corresponding to the at least two text images to obtain the standard text image of the text to be recognized.

[0073] Furthermore, the above-mentioned character extraction module 230 can be specifically used to: identify reference characters in the standard text image; determine the inter-line character segmentation lines and intra-line character segmentation lines of the characters in the standard text image based on the reference characters; and extract the characters on each line in the standard text image in turn based on the inter-line character segmentation lines and the intra-line character segmentation lines to obtain the character data set.

[0074] Furthermore, the above-mentioned character extraction module 230 can also be specifically used for: performing character search in the horizontal and vertical directions based on the reference character, identifying the first adjacent character adjacent to the reference character in the horizontal direction and the second adjacent character adjacent to the reference character in the vertical direction; calculating the intra-line character division line based on the position data of the reference character and the position data of the first adjacent character; calculating the inter-line character division line based on the position data of the reference character and the position data of the second adjacent character.

[0075] Furthermore, the above-mentioned text recognition module 240 can be specifically used to: mark multiple benchmark characters from the character data set based on a preset character marking method; extract characters adjacent to each benchmark character to obtain multiple character groups; perform semantic recognition on the multiple character groups based on a preset semantic model to obtain text to be output corresponding to the semantic recognition results; perform semantic verification on the text to be output to obtain text content corresponding to the text to be recognized.

[0076] Furthermore, the above-mentioned text recognition module 240 can also be specifically used to: perform phrase pairing on each character in the text to be output, and determine the target character that cannot be phrase paired; determine whether the target character is a separate character by performing semantic recognition on the target character; if it is not a separate character, perform semantic verification based on the phrase corresponding to the adjacent characters of the separate character to obtain the text content corresponding to the text to be recognized.

[0077] Furthermore, the above-mentioned text recognition device may also include: an image preprocessing module;

[0078] The image preprocessing module is used to perform image preprocessing on each of the at least two text images to obtain a processed text image before adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle.

[0079] The text recognition device provided in this embodiment can be applied to the text recognition method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0080] Figure 3 It is a block diagram of an electronic device for implementing a text recognition method of an embodiment of the present application. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0081] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0082] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0083] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a text recognition method.

[0084] In some embodiments, the text recognition method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the text recognition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the text recognition method in any other appropriate manner (e.g., by means of firmware).

[0085] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0087] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0088] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0089] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server) or a computing system that includes middleware components (e.g., an application server) or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein) or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0090] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0091] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. For example, those skilled in the art can use the various forms of processes shown above to reorder, add, or delete steps; the steps recorded in the present application can be performed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of the present application can be achieved, and this document does not limit them here.

[0092] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A text recognition method, characterized in that: The method comprises: Acquire at least two text images collected for the text to be recognized; Adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle; Extracting characters from the standard text image to obtain a corresponding character data set; Semantic recognition is performed on the character data set to obtain text content corresponding to the text to be recognized.

2. The text recognition method according to claim 1, characterized in that: Adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle includes: Determine at least two key locations in each text image; Connecting the at least two key positions to obtain coordinate data of the at least two key positions; Calculate the deflection data of each text image between the current image acquisition angle and the standard acquisition angle based on the coordinate data; Calculate a first text image corresponding to each text image at the standard acquisition angle based on the deflection data corresponding to each text image; The first text images corresponding to the at least two text images are corrected and superimposed to obtain a standard text image of the text to be recognized.

3. The text recognition method according to claim 1, characterized in that: The characters in the standard text image are extracted to obtain a corresponding character data set, including: recognizing reference characters in the standard text image; Determine the inter-line character segmentation lines and the intra-line character segmentation lines of the characters in the standard text image based on the reference characters; The characters on each line in the standard text image are sequentially extracted based on the inter-line character segmentation lines and the intra-line character segmentation lines to obtain the character data set.

4. The text recognition method according to claim 3, characterized in that: Determining the inter-line character segmentation lines and the intra-line character segmentation lines of the characters in the standard text image based on the reference characters includes: Performing character search in the horizontal direction and the vertical direction based on the reference character, identifying a first adjacent character adjacent to the reference character in the horizontal direction and a second adjacent character adjacent to the reference character in the vertical direction; Calculating the in-line character segmentation line based on the position data of the reference character and the position data of the first adjacent character; The inter-line character division line is calculated based on the position data of the reference character and the position data of the second adjacent character.

5. The text recognition method according to claim 1, characterized in that: Performing semantic recognition on the character data set to obtain text content corresponding to the text to be recognized includes: Marking a plurality of reference characters from the character data set based on a preset character marking method; Extracting characters adjacent to each reference character to obtain multiple character groups; Performing semantic recognition on the multiple character groups based on a preset semantic model to obtain a text to be output corresponding to the semantic recognition result; Perform semantic verification on the text to be output to obtain text content corresponding to the text to be recognized.

6. The text recognition method according to claim 5, characterized in that: Performing semantic verification on the text to be output to obtain text content corresponding to the text to be recognized includes: Phrase-pairing each character in the to-be-output text to determine target characters that cannot be phrase-paired; Determining whether the target text is a single character by performing semantic recognition on the target text; If it is not a single character, a semantic check is performed based on the phrase corresponding to the text adjacent to the single character to obtain the text content corresponding to the text to be recognized.

7. The text recognition method according to claim 1, characterized in that: Before adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle, the method further includes: Perform image preprocessing on each of the at least two text images to obtain a processed text image.

8. A text recognition device, characterized in that: The device comprises: An image acquisition module, used to acquire at least two text images collected for the text to be recognized; An image processing module, used for adjusting the posture of the at least two text images to obtain a standard text image of the text to be recognized at a standard acquisition angle; A character extraction module, used to extract characters from the standard text image to obtain a corresponding character data set; The text recognition module is used to perform semantic recognition on the character data set to obtain the text content corresponding to the text to be recognized.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text recognition method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text recognition method according to any one of claims 1 to 7 when executed.