A character recognition method, a terminal, and a storage medium
By directly determining text information in graphic recognition, the text information is solved, and the problem of slow recognition speed of large text volumes in the software interface is solved, and a faster text recognition process is achieved.
Patent Information
- Application Number
- CN202111173020.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-10-08
AI Technical Summary
The prior art is slow to recognize large amounts of text on the software interface.
By graphic recognition of the current image frame, the texture information of the text image is obtained, and the recognition results of the previous few frames are found in the preset texture information and text information correspondence relationship, and the text information corresponding to the texture information is directly determined.
This improves the speed of text recognition and reduces the repeated recognition process for each text image.
Smart Images

Figure CN114003754B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic applications, and in particular, to a text recognition method, a terminal, and a storage medium. Background Art
[0002] With the increasing development of electronic technology, more and more software can be inherited on a terminal, and to assist and enhance these software, it is necessary to recognize the text on the software interface. Currently, the common practice is to first recognize a text image, and then perform text recognition on each text image to determine the text information corresponding to the text image. When the number of texts on the software interface is large, this method will cause the text recognition speed to slow down. Summary of the Invention
[0003] Embodiments of this application provide a text recognition method, a terminal, and a storage medium, which can improve the text recognition speed.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, an embodiment of this application proposes a text recognition method, and the method includes:
[0006] Performing graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame;
[0007] Searching for text information corresponding to the texture information from a preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the recognition results of the previous several frames in the current text recognition process;
[0008] If first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, then determining the first preset text information as the text information corresponding to the texture information.
[0009] In a second aspect, an embodiment of this application proposes a terminal, and the terminal includes:
[0010] A graphic recognition module, configured to perform graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame;
[0011] A searching module, configured to search for text information corresponding to the texture information from a preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the recognition results of the previous several frames in the current text recognition process;
[0012] A determining module, configured to, if first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, then determine the first preset text information as the text information corresponding to the texture information.
[0013] In a third aspect, an embodiment of the present application provides a terminal, which includes: a processor, a memory, and a communication bus; when the processor executes the running program stored in the memory, the above-mentioned text recognition method is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned text recognition method is implemented.
[0015] The embodiment of the present application provides a text recognition method, a terminal, and a storage medium. The method includes: performing graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame; searching for text information corresponding to the texture information from a preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the recognition results of the previous several frames in the current text recognition process; if the first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, then the first preset text information is determined as the text information corresponding to the texture information. By adopting the above implementation solution, the terminal stores the recognition results of the previous several frames in the current text recognition process. After obtaining the texture information corresponding to the text image in the current image frame, the terminal directly searches for the text information corresponding to the texture information from the preset correspondence between texture information and text information. If the first preset text information corresponding to the texture information is found, the first preset text information is directly determined as the text information corresponding to the texture information, without performing text recognition on each text image, greatly improving the speed of text recognition. Description of the Drawings
[0016] Figure 1 is a flowchart of a text recognition method provided by an embodiment of the present application;
[0017] Figure 2 is a schematic diagram showing the display of an exemplary image texture provided by an embodiment of the present application;
[0018] Figure 3 is a flowchart of a method of an exemplary text recognition method provided by an embodiment of the present application;
[0019] Figure 4 is a schematic structural diagram of a terminal 1 provided by an embodiment of the present application Figure 1 ;
[0020] Figure 5 is a schematic structural diagram of a terminal 1 provided by an embodiment of the present application Figure 2 . Detailed Embodiments
[0021] It should be understood that the specific embodiments described herein are merely for explaining the present application and are not intended to limit the present application.
[0022] An embodiment of the present application provides a text recognition method. As Figure 1 shown, the method may include:
[0023] S101. Perform graphic recognition on the current image frame to obtain texture information corresponding to the text image in the current image frame.
[0024] A graphic recognition method proposed in an embodiment of the present application is applicable to scenarios where text in the current image frame of a third-party software interface or a game user interface (User Interface, UI) is recognized.
[0025] In an embodiment of the present application, the terminal for performing text recognition may be any device with processing and storage functions, such as: tablet computer, mobile phone, personal computer (Personal Computer, PC), laptop computer, wearable device, and other devices.
[0026] In an embodiment of the present application, the current image frame of the third-party software interface or the game UI interface in the terminal is obtained, and then the current image frame is subjected to graphic recognition by using a preset graphic application programming interface (Application Programming Interface, API) instruction stream to obtain a graphic recognition result; the texture information corresponding to the text image in the current image frame is determined from the graphic recognition result.
[0027] Optionally, the preset graphic API includes but is not limited to the following graphic APIs: Open Computing Language (OpenGL), OpenGL for Embedded Systems (OpenGL ES), Vulkan ("next-generation" open graphics display API), Direct eXtension 11 (DirectX 11), DirectX 12, Metal (low-level rendering application programming interface), and specific selection can be made according to the actual situation, and the embodiments of the present application do not make specific limitations.
[0028] In an embodiment of the present application, the preset graphic API instruction stream is used to perform graphic recognition on the current image frame. Among them, the specific recognition content of the graphic recognition can be selected according to the actual situation, and finally a graphic recognition result including the texture information corresponding to the text image can be obtained.
[0029] Specifically, instructions and caches related to texture information can be extracted from the preset graphics API instruction stream to obtain the encoded stream corresponding to the text image. Each text code in the encoded stream contains the texture information corresponding to the text image.
[0030] It should be noted that at least one image texture is included in the current image frame, and each image texture may contain at least one text image. Therefore, each text image in the current image frame is at a preset position in an image texture. Therefore, to obtain the specific position of each text image in the current image frame, it is necessary to determine the texture identification information and texture coordinate information corresponding to the text image. To sum up, the texture information includes the texture identification information and texture coordinate information corresponding to the text image.
[0031] Exemplarily, as Figure 2 shown, it includes two image textures: Image Texture 1 and Image Texture 2. Image Texture 1 includes the four characters "You, Xi, Fei, Yan", and Image Texture 2 includes the four characters "Kang, Ji, Shang, Yin". Then, the texture identification information corresponding to "Kang" is 2, and the texture coordinate information is (0, 0.25, 0.25, 1); the texture identification information corresponding to "Ji" is 2, and the texture coordinate information is (0.25, 0.25, 1, 1); the texture identification information corresponding to "Fei" is 1, and the texture coordinate information is (0, 0, 0.25, 0.25); the texture identification information corresponding to "Yan" is 1, and the texture coordinate information is (0.25, 0, 1, 0.25).
[0032] S102. Search for the preset text information corresponding to the texture information from the corresponding relationship between the preset texture information and the text information. The corresponding relationship between the preset texture information and the text information stores the recognition results of the previous several frames of text in this text recognition process.
[0033] In the embodiment of the present application, after identifying the texture information corresponding to the text image from the current image frame, search for the preset text information corresponding to the texture information from the corresponding relationship between the preset texture information and the text information.
[0034] It should be noted that the corresponding relationship between the preset texture information and the text information records the recognition results of the previous several frames of text in this text recognition scenario. If the current image frame is the image frame corresponding to the first round of text recognition in this text scenario, the corresponding relationship between the preset texture information and the text information is in an initial blank state.
[0035] It should be noted that the specific storage behavior of the corresponding relationship between the preset texture information and the text information is in the form of <key, value> key-value pairs, where the preset texture information is the key and the preset text information is the value.
[0036] In the embodiments of the present application, first, search for the first preset texture information that matches the text information from the correspondence between the preset texture information and the text information. If the first preset texture information is found, then search for the first preset text information corresponding to the first preset texture information from the correspondence between the preset texture information and the text information.
[0037] In the embodiments of the present application, the text information may include text forms such as Chinese characters and East Asian characters, and specific selection can be made according to the actual situation, and the embodiments of the present application do not make specific limitations.
[0038] S103. If the first preset text information corresponding to the texture information is found from the correspondence between the preset texture information and the text, then determine the first preset text information as the text information corresponding to the texture information.
[0039] In the embodiments of the present application, if the first preset texture information that matches the text information and the first preset text information corresponding to the first preset texture information are found from the correspondence between the preset texture information and the text information, it indicates that the first preset text information corresponding to the texture information is found from the correspondence between the preset texture information and the text information. At this time, determine the first preset text information as the text information corresponding to the texture information.
[0040] It can be understood that finding the first preset text information corresponding to the texture information from the correspondence between the preset texture information and the text information can quickly determine the text information corresponding to the texture information, without performing graphic recognition on all text images in the current image frame to obtain the corresponding text information, which greatly improves the speed of text recognition.
[0041] Further, if the first preset texture information that matches the text information is not found from the correspondence between the preset texture information and the text information, it indicates that the preset text information corresponding to the texture information is not found from the correspondence between the preset texture information and the text information. At this time, the terminal determines the image data corresponding to the texture information from the current image frame; then performs text recognition on the image data to obtain the text information corresponding to the image data.
[0042] In the embodiments of the present application, based on the texture identification information and the texture coordinate information, locate the image data from the current image frame.
[0043] In the embodiments of the present application, the method for performing text recognition on the image data may be a local deep learning method or a cloud recognition method, etc., and specific selection can be made according to the actual situation, and the embodiments of the present application do not make specific limitations.
[0044] In the embodiments of the present application, after performing character recognition on image data to obtain the character information corresponding to the image data, the mapping relationship between the texture information and the character information can also be updated to the corresponding relationship between the preset texture information and the character information, so as to be used in the subsequent rounds of character recognition processes in this character recognition scenario.
[0045] Exemplarily, the four characters "lung", "inflammation", "fight", and "against" are added to the corresponding relationship between the preset texture information and the character information. Specifically, as shown in Table 1,
[0046] Table 1 Corresponding relationship table between preset texture information and character information
[0047]
[0048] Based on the above embodiments, the solution of the present application can be implemented through a graphics recognition module, a character management module, and an image recognition module. Among them, the corresponding relationship between the preset texture information and the character information is stored in the character management module. The specific implementation process is as Figure 3 shown,
[0049] 1. Input the graphics API instruction stream into the graphics recognition module, and the graphics recognition module searches for the texture identification information and texture coordinate information corresponding to the character image from the graphics API instruction stream.
[0050] 2. Search for the character information corresponding to the texture identification information and texture coordinate information from the corresponding relationship between the preset texture information and the character information in the character management module.
[0051] 3. If the first preset character information corresponding to the texture identification information and texture coordinate information is found, the process ends.
[0052] 4. If the character information corresponding to the texture identification information and texture coordinate information is not found, input the texture identification information and texture coordinate information into the image recognition module.
[0053] 5. The image recognition module recognizes the character information corresponding to the texture identification information and texture coordinate information.
[0054] 6. The image recognition module inputs the texture identification information and texture coordinate information, as well as the character information corresponding to the texture identification information and texture coordinate information, into the character management module.
[0055] 7. The character management module updates the corresponding relationship between the preset texture information and the character information by using the texture identification information and texture coordinate information, as well as the character information corresponding to the texture identification information and texture coordinate information.
[0056] It can be understood that the terminal stores the text recognition results of the previous several frames during the current text recognition process. After obtaining the texture information corresponding to the text image in the current image frame, the terminal directly searches for the text information corresponding to the texture information from the preset correspondence between texture information and text information. If the first preset text information corresponding to the texture information is found, the first preset text information is directly determined as the text information corresponding to the texture information, without performing text recognition on each text image, greatly improving the speed of text recognition.
[0057] Embodiment 2
[0058] An embodiment of the present application provides a terminal. As Figure 4 shown, the terminal 1 includes:
[0059] A graphic recognition module 10, configured to perform graphic recognition on the current image frame to obtain the texture information corresponding to the text image in the current image frame;
[0060] A search module 11, configured to search for the text information corresponding to the texture information from the preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the text recognition results of the previous several frames during the current text recognition process;
[0061] A determination module 12, configured to, if the first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, determine the first preset text information as the text information corresponding to the texture information.
[0062] Optionally, the terminal further includes: a text recognition module;
[0063] The determination module 12 is further configured to, if the text information corresponding to the texture information is not found from the preset correspondence between texture information and text information, determine the image data corresponding to the texture information from the current image frame;
[0064] The text recognition module is configured to perform text recognition on the image data to obtain the text information corresponding to the image data.
[0065] Optionally, update the mapping relationship between the texture information and the text information to the preset correspondence between texture information and text information.
[0066] Optionally, the current image frame includes at least one image texture, where each image texture corresponds to a texture identification information;
[0067] The texture information includes the texture identification information and texture coordinate information corresponding to the text image.
[0068] Optionally, the terminal further includes: a positioning module;
[0069] The positioning module is configured to locate the image data from the current image frame based on the texture identification information and the texture coordinate information.
[0070] Optionally, the graphic recognition module 10 is further configured to perform graphic recognition on the current image frame by using a preset graphic application programming interface (API) instruction stream to obtain a graphic recognition result.
[0071] The determining unit 12 is further configured to determine texture information corresponding to the text image in the current image frame from the graphic recognition result.
[0072] A terminal provided by an embodiment of the present application performs graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame; searches for text information corresponding to the texture information from a correspondence between preset texture information and text information; the correspondence between the preset texture information and the text information stores the text recognition results of the previous several frames in the current text recognition process; if first preset text information corresponding to the texture information is found from the correspondence between the preset texture information and the text, the first preset text information is determined as the text information corresponding to the texture information. It can be seen that for the terminal proposed in this embodiment, the terminal stores the text recognition results of the previous several frames in the current text recognition process. After obtaining the texture information corresponding to the text image in the current image frame, the terminal directly searches for the text information corresponding to the texture information from the correspondence between the preset texture information and the text information. If the first preset text information corresponding to the texture information is found, the first preset text information is directly determined as the text information corresponding to the texture information, without performing text recognition on each text image, greatly improving the speed of text recognition.
[0073] Figure 5 Schematic diagram of the composition structure of a terminal 1 provided by an embodiment of the present application Figure 2 , in practical applications, under the same inventive concept as the above embodiment, as Figure 5 shown, the terminal 1 of this embodiment includes: a processor 13, a memory 14, and a communication bus 15.
[0074] During the process of a specific embodiment, the above-mentioned graphic recognition module 10, search module 11, determination module 12, character recognition module, and positioning module can be implemented by a processor 13 located on the terminal 1. The above-mentioned processor 13 can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing image processing device (DSPD), a programmable logic image processing device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic devices for implementing the functions of the above-mentioned processor can also be others, and the present embodiment does not make specific limitations.
[0075] In the embodiment of the present application, the above-mentioned communication bus 15 is used to implement the connection communication between the processor 13 and the memory 14; when the processor 13 executes the running program stored in the memory 14, the following character recognition method is implemented:
[0076] Perform graphic recognition on the current image frame to obtain the texture information corresponding to the text image in the current image frame; search for the text information corresponding to the texture information from the preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the recognition results of the previous several frames in the current character recognition process; if the first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, then determine the first preset text information as the text information corresponding to the texture information.
[0077] Furthermore, the above-mentioned processor 13 is further configured to, if the text information corresponding to the texture information is not found from the preset correspondence between texture information and text information, determine the image data corresponding to the texture information from the current image frame; perform character recognition on the image data to obtain the text information corresponding to the image data.
[0078] Furthermore, the above-mentioned processor 13 is further configured to update the mapping relationship between the texture information and the text information to the preset correspondence between texture information and text information.
[0079] Furthermore, the current image frame includes at least one image texture, wherein each image texture corresponds to a texture identification information; the texture information includes the texture identification information and texture coordinate information corresponding to the text image.
[0080] Further, the above-mentioned processor 13 is further configured to locate the image data from the current image frame based on the texture identification information and the texture coordinate information.
[0081] Further, the above-mentioned processor 13 is further configured to perform graphic recognition on the current image frame by using a preset graphics application programming interface (API) instruction stream to obtain a graphic recognition result; and determine the texture information corresponding to the text image in the current image frame from the graphic recognition result.
[0082] An embodiment of the present application provides a storage medium, on which a computer program is stored. The above-mentioned computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors and are applied to a terminal. The computer program implements the text recognition method as described above.
[0083] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0084] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the related art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing an image display device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present disclosure.
[0085] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A character recognition method, characterized in that, The method includes: Performing graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame; the current image frame includes at least one image texture, and each image texture corresponds to a texture identification information; the texture information includes texture identification information and texture coordinate information; Searching for text information corresponding to the texture information from a preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the text recognition results of the previous several frames in the current text recognition process; If the first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, then determining the first preset text information as the text information corresponding to the texture information.
2. The method according to claim 1, wherein After searching for the text information corresponding to the texture information from the preset correspondence between texture information and text, the method further includes: If the text information corresponding to the texture information is not found from the preset correspondence between texture information and text information, then determining image data corresponding to the texture information from the current image frame; Performing text recognition on the image data to obtain text information corresponding to the image data.
3. The method according to claim 2, wherein After performing text recognition on the image data to obtain text information corresponding to the image data, the method further includes: Updating the mapping relationship between the texture information and the text information to the preset correspondence between texture information and text information.
4. The method according to claim 3, characterized in that, The current image frame includes at least one image texture, and each image texture corresponds to a texture identification information; The texture information includes the texture identification information and texture coordinate information corresponding to the text image.
5. The method according to claim 4, wherein Determining the image data corresponding to the texture information from the current image frame includes: Locating the image data from the current image frame based on the texture identification information and the texture coordinate information.
6. The method according to claim 1, wherein Performing graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame includes: Using a preset graphic application programming interface (API) instruction stream to perform graphic recognition on the current image frame to obtain a graphic recognition result; Determining the texture information corresponding to the text image in the current image frame from the graphic recognition result.
7. A terminal, characterized in that, The terminal includes: A graphic recognition module, configured to perform graphic recognition on a current image frame to obtain texture information corresponding to a text image in the current image frame; the texture information includes texture identification information and texture coordinate information; A searching module, configured to search for text information corresponding to the texture information from a preset correspondence between texture information and text information; the preset correspondence between texture information and text information stores the text recognition results of the previous several frames in the current text recognition process; A determining module, configured to, if the first preset text information corresponding to the texture information is found from the preset correspondence between texture information and text, then determine the first preset text information as the text information corresponding to the texture information.
8. The terminal according to claim 7, wherein The terminal further includes: a text recognition module; The determining module is further configured to, if the text information corresponding to the texture information cannot be found from the preset correspondence between the texture information and the text information, determine the image data corresponding to the texture information from the current image frame; The text recognition module is configured to perform text recognition on the image data to obtain the text information corresponding to the image data.
9. A terminal, characterized in that, The terminal includes: a processor, a memory, and a communication bus; when the processor executes the running program stored in the memory, the method described in any one of claims 1-6 is implemented.
10. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, the method described in any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Method, device and equipment for recognizing character in picture, and storage medium
CN108805115A
Video character tracking method and device, video processing method and device, equipment and medium
CN113392689A