A text recognition method, device, terminal and computer readable storage medium

By comparing the target object's identification information with historical frames in video frames and updating the character sequence based on confidence, the problem of low accuracy in ship name recognition is solved, achieving higher text recognition accuracy and stability.

CN116229440BActive Publication Date: 2025-12-30ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211690782.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-12-30
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

In existing technologies, ship name recognition accuracy is low during movement due to factors such as viewing angle, lighting, ship parts being out of the field of view, and characters being temporarily obscured.

Method used

The initial recognition result is obtained by recognizing the text on the target object in the current video frame and comparing it with the target in the historical video frames to determine the identification information. The character array and confidence score are stored in the cache sequence, and the final recognition result is determined based on the updated character sequence and confidence score.

Benefits of technology

It improves the accuracy and stability of text recognition, reduces fluctuations caused by objective factors, and enhances the recognition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116229440B_ABST
    Figure CN116229440B_ABST
Patent Text Reader

Abstract

The application provides a text recognition method, device, terminal and computer readable storage medium, the text recognition method is through the identification of the to-be-recognized text on the target object in the current video frame, and the initial recognition result corresponding to the to-be-recognized text is obtained; the target object in the current video frame is compared with the target in the historical video frame before the current video frame, and the identification information of the target object is determined; in response to the same as the preset identity, the character array corresponding to the identification information and the confidence of each character are stored in the cache sequence corresponding to the preset identity, and the updated character sequence corresponding to the character position is determined; the recognition result of each character position is determined based on each character in the updated character sequence of each character position corresponding to the preset identity and the corresponding confidence, and the recognition result of the to-be-recognized text is obtained. Based on the initial recognition result in the current video frame and the historical video frame, the recognition result is determined together, and the accuracy of text recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of text recognition, in particular to a text recognition method, device, terminal and computer readable storage medium. BACKGROUND

[0002] With the continuous improvement of computer computing power, deep learning is widely used in image detection field and land transportation. At the same time, some methods based on deep learning have been used for ship name recognition. These methods first detect the text area based on the text detection stage, and then recognize the characters in the area through the text recognition stage. In practical application, when the ship is in motion, the ship identification is disturbed due to reasons such as view angle, illumination, part of the ship body exceeding the field of view, and temporary character occlusion, and the ship name recognition effect will be reduced. SUMMARY

[0003] The technical problem solved by the present application is to provide a text recognition method, device, terminal and computer readable storage medium, which solves the problem of low text recognition accuracy in the prior art.

[0004] To solve the above technical problems, the first technical solution adopted by the present application is to provide a text recognition method, which comprises:

[0005] The text recognition method comprises:

[0006] The text recognition method comprises:

[0007] The text recognition method comprises:

[0008] The text recognition method comprises:

[0009] The text recognition method comprises:

[0010] The text recognition method comprises:

[0011] In response to the identification information of the target object being different from each of the preset identities, the identification information of the target object and the initial recognition result corresponding to the target object are stored in the preset database.

[0012] The initial recognition result corresponding to the target object is taken as the recognition result of the text to be recognized.

[0013] The character array corresponding to the identification information and the confidence of each character are stored in the cache sequence corresponding to the preset identity, and the updated character sequence corresponding to each character position in the cache sequence is determined, including:

[0014] It is judged whether the number of characters in the character sequence of each character position reaches a preset number;

[0015] If the number of characters in the character sequence of the character position reaches the preset number, the character corresponding to the lowest confidence in the character sequence is replaced by the character corresponding to the character position in the character array corresponding to the target object to obtain the updated character sequence corresponding to the character position;

[0016] If the number of characters in the character sequence of the character position does not reach the preset number, the character corresponding to the character position in the character array corresponding to the target object is added to the character sequence of the character position to obtain the updated character sequence corresponding to the character position.

[0017] The recognition result of each character position is determined based on each character in the updated character sequence of each character position corresponding to the preset identity and the corresponding confidence, and the recognition result of the text to be recognized is obtained, including:

[0018] Based on each character in the updated character sequence of the character position, a category character corresponding to the character position is determined;

[0019] Based on all confidence corresponding to the category character, a category confidence of the category character is determined;

[0020] The category character corresponding to the category confidence with the largest value is selected as the recognition result of the character position;

[0021] The recognition results of each character position are arranged according to the positions to obtain the recognition result of the text to be recognized.

[0022] The text to be recognized on the target object in the current video frame is recognized to obtain the initial recognition result corresponding to the text to be recognized, including:

[0023] The target object is detected and extracted from the current video frame to obtain a first region image containing the target object;

[0024] The text to be recognized on the target object in the current video frame is recognized to obtain the initial recognition result corresponding to the text to be recognized, including:

[0025] text recognition is performed on the second region image to obtain an initial recognition result of the to-be-recognized text.

[0026] The identification information of the target object is determined by comparing the target object in the current video frame with the target in the historical video frame before the current video frame, and includes:

[0027] The similarity between the target object in the first region image and each target in the preset number of historical video frames adjacent to the current video frame is calculated.

[0028] In response to the similarity between the target object and the target exceeding a similarity threshold, a preset identity associated with the target is taken as the identification information of the target object.

[0029] In response to the similarity between the target object and each target not exceeding the similarity threshold, the target object is assigned identification information.

[0030] The text recognition method further includes:

[0031] In response to the character sequence at each position corresponding to the preset identity in the preset database not being updated for a preset number of consecutive frames, the preset identity and the character sequence at each position corresponding to the preset identity are deleted.

[0032] To solve the above technical problems, a second technical solution adopted by the present application is to provide a text recognition device, which includes:

[0033] The recognition module is configured to recognize the to-be-recognized text on the target object in the current video frame to obtain an initial recognition result corresponding to the to-be-recognized text. The initial recognition result includes a character array composed of at least one character and the confidence of each character.

[0034] The tracking module is configured to compare the target object in the current video frame with the target in the historical video frame before the current video frame to determine the identification information of the target object.

[0035] The update module is configured to, in response to the identification information being the same as a preset identity in a preset database, store the character array corresponding to the identification information and the confidence of each character into a cache sequence corresponding to the preset identity, and determine an updated character sequence at each character position in the cache sequence. The preset database includes the initial recognition result corresponding to the target in the historical video frame.

[0036] The analysis module is configured to determine the recognition result at each character position based on each character in the updated character sequence at each character position corresponding to the preset identity and the corresponding confidence, and obtain the recognition result of the to-be-recognized text.

[0037] To solve the above technical problems, a third technical solution adopted by the present application is to provide a terminal, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor is used to execute the program data to realize the steps in the above text recognition method.

[0038] To solve the above technical problems, a fourth technical solution adopted by the present application is to provide a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor to realize the steps in the above text recognition method.

[0039] The beneficial effects of the present application are as follows: Different from the prior art, the provided text recognition method, device, terminal and computer readable storage medium, the text recognition method identifies the to-be-recognized text on the target object in the current video frame to obtain an initial recognition result corresponding to the to-be-recognized text; the initial recognition result includes a character array composed of at least one character and the confidence of each character; the target object in the current video frame is compared with the target in the historical video frame before the current video frame to determine the identification information of the target object; in response to the identification information being the same as a preset identity in a preset database, the character array corresponding to the identification information and the confidence of each character are stored in a cache sequence corresponding to the preset identity, and an updated character sequence corresponding to each character position in the cache sequence is determined; the preset database includes the initial recognition result corresponding to the target contained in the historical video frame; the recognition result of each character position is determined based on each character in the updated character sequence of each character position corresponding to the preset identity and the corresponding confidence, and the recognition result of the to-be-recognized text is obtained. In the present application, the preset identity consistent with the identification information of the target object in the current video frame is found in the preset database, the initial recognition result in the current video frame and the initial recognition result corresponding to the preset identity with the same identification information in the historical video frame are used to jointly determine the recognition result of the to-be-recognized text in the current video frame, thereby improving the accuracy of text recognition; further, the confidence of each character in the character array corresponding to the to-be-recognized text in the current video frame is compared with the confidence of each character in the corresponding same character position in the character array corresponding to the to-be-recognized text in the historical video frame, and the recognition result of the to-be-recognized text is determined, thereby further improving the text recognition accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0041] Figure 1This is a flowchart illustrating the text recognition method provided by the present invention;

[0042] Figure 2 This is a flowchart illustrating a specific embodiment of the text recognition method provided by the present invention;

[0043] Figure 3 This is a schematic diagram of the framework of an embodiment of the text recognition device provided by the present invention;

[0044] Figure 4 This is a schematic diagram of the framework of an embodiment of the terminal provided by the present invention;

[0045] Figure 5 A schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present invention. Detailed Implementation

[0046] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0047] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0048] In this article, the term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "more" in this article means two or more objects.

[0049] To enable those skilled in the art to better understand the technical solution of the present invention, a text recognition method provided by the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] Please see Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the text recognition method provided by the present invention; Figure 2 This is a flowchart illustrating a specific embodiment of the text recognition method provided by the present invention.

[0051] This embodiment provides a text recognition method, which includes the following steps.

[0052] S1: Recognize the text to be recognized on the target object in the current video frame to obtain the initial recognition result corresponding to the text to be recognized; the initial recognition result includes a character array consisting of at least one character and the confidence score of each character.

[0053] S2: Compare the target object in the current video frame with the target in the previous historical video frames to determine the identification information of the target object.

[0054] S3: In response to the identification information being the same as the preset identity in the preset database, the character array corresponding to the identification information and the confidence level of each character are stored in the cache sequence corresponding to the preset identity, and the updated character sequence corresponding to the position of each character in the cache sequence is determined; the preset database includes the initial recognition results corresponding to the target contained in historical video frames.

[0055] S4: Based on the character positions corresponding to the preset identities, the recognition results of each character position in the updated character sequence and the corresponding confidence scores are determined to obtain the recognition results of the text to be recognized.

[0056] In one embodiment, the specific steps for obtaining text detection information in step S1 are as follows.

[0057] Target detection and extraction are performed on the current video frame to obtain a first region image containing the target object. The current video frame may contain one target object or at least two target objects. The target object can be a ship, vehicle, etc.

[0058] In one specific embodiment, the object detection model performs object detection on the current video frame to obtain the location of the object detection box containing a single object in the current video frame.

[0059] Text detection and extraction are performed on the first region image to obtain a second region image containing the text to be identified; the second region image is a sub-image of the first region image.

[0060] In one embodiment, the current video frame and the corresponding target detection box position are input into the text detection model. The text detection model performs text detection on each target detection box region in the current video frame to obtain the text detection box position containing text in each target detection box region.

[0061] Text recognition is performed on the second region image to obtain the initial recognition result of the text to be recognized.

[0062] Specifically, the text recognition model is used to perform text recognition on the second region image to obtain the initial recognition result of the text to be recognized.

[0063] In one specific embodiment, the current video frame and the text detection box position are input into the text recognition model. The text recognition model performs text recognition on the text within the text detection box region of the current video frame to obtain an initial recognition result of the text to be recognized. The initial recognition result includes a character array consisting of at least one character and the confidence score of each character. For example, in the character array "Titanic", the confidence score of "T" is 0.9, "i" is 0.7, "t" is 0.8, "a" is 0.7, "n" is 0.6, "i" is 0.5, and "c" is 0.7. This embodiment uses UTF-16 encoding containing Chinese characters as an example; this method is equally applicable to other types of characters.

[0064] In one embodiment, the specific steps for determining the identification information of the target object in step S2 are as follows.

[0065] Specifically, each target object in the current video frame is associated with the targets in historical video frames to determine the identification information of the target objects.

[0066] Calculate the similarity between the target object in the first region image and each target in a preset number of historical video frames preceding the current video frame. If the similarity between the target object and each target exceeds a similarity threshold, a preset identity associated with the target is used as the target object's identification information. If the similarity between the target object and none of the targets exceeds the similarity threshold, identification information is assigned to the target object.

[0067] A pre-defined database is constructed using the pre-defined identities of each target in historical video frames and the initial recognition results corresponding to the text detection regions on each target. Each text detection region is associated with a corresponding video frame. Each target's pre-defined identity corresponds to at least one character array, meaning each pre-defined identity corresponds to at least one character sequence. For example, if a pre-defined identity corresponds to three character arrays, then each of the three character arrays corresponds to a text detection box region in one of the three video frames. Furthermore, the characters in each character array are ordered sequentially from the first character position onwards.

[0068] In one embodiment, the identification information of the target object is compared with each preset identity in a preset database. If the identification information of the target object does not match any of the preset identities, the identification information of the target object and the initial recognition result corresponding to the target object are stored in the preset database; the initial recognition result corresponding to the target object is used as the recognition result of the text to be recognized.

[0069] In one embodiment, the specific steps for determining the updated character sequence corresponding to each character position in step S3 are as follows.

[0070] The target and the target object correspond to the initial recognition result, which includes a character array consisting of at least one character and the confidence level of each character.

[0071] Determine whether the number of characters in the character sequence at each character position reaches a preset number. For example, determine whether the number of characters in the character sequence corresponding to the first character position reaches a preset number. The preset number can be 3, or it can be set according to actual needs. Table 1 shows the preset identities and the character sequences corresponding to each character position.

[0072] Table 1

[0073]

[0074] If the number of characters in the character sequence at a given character position reaches a preset number, then the character at the corresponding character position in the character array corresponding to the target object is used to replace the character with the lowest confidence value in the character sequence to obtain the updated character sequence at that character position.

[0075] For example, if the number of characters in the character sequences corresponding to positions 1, 2, 3, and 4 in Table 1 reaches a preset number, then the character with the lowest confidence score in the character sequence is deleted, and the character at the corresponding position in the character array corresponding to the target object in the current video frame is added to the character sequence to obtain an updated character sequence. Alternatively, the confidence score of the character at the corresponding position in the character array corresponding to the target object in the current video frame can be compared with the confidence scores of each character in the corresponding character sequence, and the character with the lowest confidence score can be removed.

[0076] If the number of characters in the character sequence at a given character position does not reach the preset number, then the character at the corresponding character position in the character array corresponding to the target object is added to the character sequence at that character position to obtain the updated character sequence at that character position.

[0077] For example, if the number of characters in the character sequences corresponding to positions 5, 6, and 7 in Table 1 does not reach the preset number, then the characters at the corresponding character positions in the character array corresponding to the target object are directly added to the character sequences at those positions to obtain the updated character sequences.

[0078] In one embodiment, the number of characters in the text to be recognized is determined based on the updated character sequence corresponding to a preset identity and the number of characters in the character sequence. In another embodiment, the number of characters contained in the longest character array corresponding to the preset identity is determined as the number of characters in the text to be recognized.

[0079] In one embodiment, the specific steps for obtaining the recognition result of the text to be recognized in step S4 are as follows.

[0080] By updating each character in the character sequence based on its position, the category character corresponding to that position is determined. For example, the category characters corresponding to the first position include i and T.

[0081] The category confidence of a category character is determined based on all confidence scores corresponding to the category characters. For example, the average of all confidence scores corresponding to a category character is used as the category confidence of the category character. The confidence score of the category character i corresponding to the first position is 0.7; the confidence score of the category character T corresponding to the first position is 0.8.

[0082] The category character corresponding to the highest category confidence score is selected as the recognition result for the character position. For example, the category character T is selected as the recognition result for the 1st position. The updated character sequence for all character positions corresponding to the preset identity is traversed to determine the recognition result for each character position.

[0083] The recognition results for each character position are arranged according to the character position to obtain the recognition result of the text to be recognized.

[0084] In one embodiment, in response to the fact that the character sequence at each character position corresponding to the preset identity in the preset database has not been updated for a preset number of consecutive frames, the preset identity and the character sequence at each character position corresponding to the preset identity are deleted.

[0085] This method yields relatively stable text recognition results, largely avoiding fluctuations caused by objective factors. During the voting phase, it incorporates historical information to select recognition results with high confidence, thus improving recognition performance to some extent.

[0086] In this embodiment, the text recognition method identifies the text to be recognized on a target object in the current video frame to obtain an initial recognition result corresponding to the text to be recognized. The initial recognition result includes a character array consisting of at least one character and the confidence score of each character. The target object in the current video frame is compared with the target in the previous historical video frames to determine the identification information of the target object. In response to the identification information being the same as a preset identity in the preset database, the character array corresponding to the identification information and the confidence score of each character are stored in the cache sequence corresponding to the preset identity, and the updated character sequence corresponding to each character position in the cache sequence is determined. The preset database includes the initial recognition results corresponding to the targets contained in the historical video frames. Based on each character in the updated character sequence corresponding to each character position of the preset identity and the corresponding confidence score, the recognition result of each character position is determined to obtain the recognition result of the text to be recognized. In this application, the identification information of the target object in the current video frame is used to search for a preset identity that matches the identification information in a preset database. The initial identification result in the current video frame and the initial identification results corresponding to the preset identities with the same identification information in historical video frames are used to jointly determine the identification result of the text to be identified in the current video frame, thereby improving the accuracy of text recognition. Furthermore, the confidence scores of each character in the character array corresponding to the text to be identified in the current video frame are compared with the confidence scores of each character at the same position in the character array corresponding to the text to be identified in historical video frames to determine the identification result of the text to be identified, thereby improving the accuracy of text recognition.

[0087] See Figure 3 , Figure 3 This is a schematic diagram of a framework of an embodiment of the text recognition device provided by the present invention. This embodiment provides a text recognition device 60, which includes a recognition module 61, a tracking module 62, an update module 63, and an analysis module 64.

[0088] The recognition module 61 is used to recognize the text to be recognized on the target object in the current video frame and obtain the initial recognition result corresponding to the text to be recognized; the initial recognition result includes a character array consisting of at least one character and the confidence score of each character.

[0089] The tracking module 62 is used to compare the target object in the current video frame with the target in the previous historical video frames to determine the identification information of the target object.

[0090] The update module 63 is used to respond to the fact that the identification information is the same as the preset identity in the preset database, and then store the character array corresponding to the identification information and the confidence of each character in the cache sequence corresponding to the preset identity, and determine the updated character sequence corresponding to each character position in the cache sequence; the preset database includes the initial recognition results corresponding to the target contained in historical video frames.

[0091] The analysis module 64 is used to determine the recognition result of each character position based on the updated character sequence corresponding to each character position of the preset identity and the corresponding confidence level, so as to obtain the recognition result of the text to be recognized.

[0092] The text recognition device provided in this embodiment searches for a preset identity that matches the identification information of the target object in the current video frame in a preset database. Based on the initial recognition result in the current video frame and the initial recognition results corresponding to the preset identities with the same identification information in historical video frames, the recognition result of the text to be recognized in the current video frame is determined, thereby improving the accuracy of text recognition. Furthermore, the confidence scores of each character in the character array corresponding to the text to be recognized in the current video frame are compared with the confidence scores of each character at the same position in the character array corresponding to the text to be recognized in historical video frames to determine the recognition result of the text to be recognized, thereby improving the accuracy of text recognition.

[0093] Please see Figure 4 , Figure 4 This is a schematic diagram of a terminal embodiment provided by the present invention. The terminal 80 includes a memory 81 and a processor 82 coupled to each other. The processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-described text recognition method embodiments. In a specific implementation scenario, the terminal 80 may include, but is not limited to, a microcomputer or a server. In addition, the terminal 80 may also include mobile devices such as laptops and tablets, which are not limited here.

[0094] Specifically, processor 82 controls itself and memory 81 to implement the steps of any of the above-described text recognition method embodiments. Processor 82 can also be referred to as a CPU (Central Processing Unit). Processor 82 may be an integrated circuit chip with signal processing capabilities. Processor 82 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 82 can be implemented using integrated circuit chips.

[0095] Please see Figure 5 , Figure 5This is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present invention. The computer-readable storage medium 90 stores program instructions 901 that can be executed by a processor. The program instructions 901 are used to implement the steps of any of the above-described text recognition method embodiments.

[0096] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0097] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0098] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0100] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0101] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0102] The above are merely embodiments of the present invention and do not limit the scope of patent protection of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A text recognition method, characterized by, The text recognition method comprises: identifying the to-be-recognized text on the target object in the current video frame to obtain an initial recognition result corresponding to the to-be-recognized text; the initial recognition result comprises a character array composed of at least one character and a confidence degree of each character; comparing the target object in the current video frame with a target in a historical video frame before the current video frame to determine identification information of the target object; in response to the identification information being the same as a preset identity in a preset database, storing the character array corresponding to the identification information and the confidence degree of each character into a cache sequence corresponding to the preset identity, and determining an updated character sequence corresponding to each character position in the cache sequence; the preset database comprises the initial recognition result corresponding to the target in the historical video frame; determining a recognition result of each character position based on each character in the updated character sequence of each character position corresponding to the preset identity and the corresponding confidence degree, to obtain a recognition result of the to-be-recognized text; the comparison of the target object in the current video frame with the target in the historical video frame before the current video frame to determine the identification information of the target object comprises: calculating a similarity between the target object in a first region image and each target in a preset number of historical video frames adjacent to the current video frame; in response to the similarity between the target object and the target exceeding a similarity threshold, associating the preset identity of the target as the identification information of the target object; the determination of the recognition result of each character position based on each character in the updated character sequence of each character position corresponding to the preset identity and the corresponding confidence degree to obtain the recognition result of the to-be-recognized text comprises: determining a category character corresponding to the character position based on each character in the updated character sequence of the character position; determining a category confidence degree of the category character based on all the confidence degrees corresponding to the category character; selecting the category character corresponding to the category confidence degree with the largest value as the recognition result of the character position; arranging the recognition results of each character position according to the positions to obtain the recognition result of the to-be-recognized text.

2. The text recognition method of claim 1, wherein, The text recognition method further comprises: comparing the identification information of the target object with each preset identity in the preset database; in response to the identification information of the target object being different from each preset identity, storing the identification information of the target object and the initial recognition result corresponding to the target object into the preset database; storing the initial recognition result corresponding to the target object as the recognition result of the to-be-recognized text.

3. The text recognition method of claim 1, wherein the storing of the character array corresponding to the identification information and the confidence degree of each character into the cache sequence corresponding to the preset identity and the determination of the updated character sequence corresponding to each character position in the cache sequence comprise: determining whether the number of the characters in the character sequence of the character position reaches a preset number; if the number of the characters in the character sequence of the character position reaches the preset number, replacing the character corresponding to the lowest confidence in the character sequence with the character corresponding to the character position in the character array of the target object to obtain an updated character sequence corresponding to the character position; if the number of the characters in the character sequence of the character position does not reach the preset number, adding the character corresponding to the character position in the character array of the target object to the character sequence of the character position to obtain an updated character sequence corresponding to the character position.

4. The text recognition method of claim 1, wherein the recognizing the to-be-recognized text on the target object in the current video frame to obtain an initial recognition result corresponding to the to-be-recognized text comprises: performing target detection and extraction on the current video frame to obtain a first region image containing the target object; performing text detection and extraction on the first region image to obtain a second region image containing the to-be-recognized text; the second region image is a sub-image of the first region image; performing text recognition on the second region image to obtain the initial recognition result of the to-be-recognized text.

5. The text recognition method of claim 1, wherein the comparing the target object in the current video frame with a target in a historical video frame before the current video frame to determine identification information of the target object comprises: calculating a similarity between the target object in the first region image and each of the targets in a preset number of adjacent historical video frames before the current video frame; in response to the similarity between the target object and the target exceeding a similarity threshold, associating the preset identity of the target as the identification information of the target object; in response to the similarity between the target object and each of the targets not exceeding the similarity threshold, assigning the identification information to the target object. The text recognition method further comprises: in response to the character sequence of each of the character positions corresponding to the preset identity in the preset database not being updated for a continuous preset number of frames, deleting the preset identity and the character sequence of each of the character positions corresponding to the preset identity.

6. The text recognition method of claim 1, wherein, The text recognition apparatus comprises: an identification module configured to recognize a to-be-recognized text on a target object in a current video frame to obtain an initial recognition result corresponding to the to-be-recognized text; the initial recognition result comprises a character array composed of at least one character and a confidence of each of the characters.

7. A text recognition apparatus characterized by comprising: ​ ​ The tracking module is configured to compare the target object in the current video frame with the target in the historical video frame before the current video frame to determine the identification information of the target object, and calculate the similarity between the target object in the first region image and each target in the historical video frames adjacent to the current video frame in a preset number, and associate the preset identity of the target with the identification information of the target object when the similarity between the target object and the target exceeds a similarity threshold. The updating module is configured to store the character array and the confidence of each character corresponding to the identification information into a cache sequence corresponding to the preset identity when the identification information is the same as the preset identity in a preset database, and determine an updated character sequence corresponding to each character position in the cache sequence, wherein the preset database includes the initial recognition result corresponding to the target in the historical video frame. The analysis module is configured to determine the recognition result of each character position based on each character and the corresponding confidence in the updated character sequence of each character position corresponding to the preset identity, and obtain the recognition result of the to-be-recognized text, and determine a category character corresponding to each character position based on each character in the updated character sequence of the character position, determine a category confidence of the category character based on all the confidences corresponding to the category character, select the category character corresponding to the category confidence with the maximum value as the recognition result of the character position, and arrange the recognition result of each character position according to the position to obtain the recognition result of the to-be-recognized text.

8. A terminal, characterized by comprising: The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor is configured to execute program data to realize the steps in the text recognition method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps in the text recognition method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Character recognition method and device, electronic equipment and storage medium

    CN111680688A

  • Text recognition method and device, electronic equipment and storage medium

    CN115346216A