Character recognition method, device, equipment and storage medium in character image

By combining the cropping and identification information of character images, the problem of error accumulation in the autoregressive decoder is solved, and the efficiency and accuracy of character recognition are improved.

CN115116064BActive Publication Date: 2025-08-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210547619.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-18
Publication Date
2025-08-29
Estimated Expiration
2042-05-18

AI Technical Summary

Technical Problem

In the prior art, the autoregressive decoder of character images is susceptible to previous character errors when generating post characters, resulting in error accumulation and affecting recognition efficiency.

Method used

By cropping the character image, dividing it into multiple sub-images, and autoregressive recognition is performed on each sub-image, the tail and head characters in the overlapping area of ​​the adjacent sub-image are determined, and the identification information is fused based on whether the tail and head characters are repeated to generate the final recognition result.

Benefits of technology

It reduces the dependence on the previous character during the later character generation, reduces error accumulation, and improves the recognition efficiency and accuracy of character images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115116064B_ABST
    Figure CN115116064B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device and storage medium for character recognition in a character image, and belongs to the field of character recognition technology. The method comprises: performing a cropping process on a character image to obtain at least two sub-images, wherein there is an overlapping area between two adjacent sub-images in the at least two sub-images; performing autoregressive recognition processing on the at least two sub-images to obtain at least two pieces of recognition information; determining the tail character recognized from the overlapping area of ​​the preceding sub-image, and determining the head character recognized from the overlapping area of ​​the following sub-image; based on whether there are repeated characters in the tail character and the head character, performing a fusion process on the at least two pieces of recognition information to obtain a recognition result of the character in the character image. The present application reduces the number of previously generated characters in the recognition information that are relied upon when generating the following characters by cropping the character image; and reduces the possibility of character error accumulation during the autoregressive recognition process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of character recognition, and in particular to a method, apparatus, device and storage medium for character recognition in a character image. Background Art

[0002] Character recognition involves computer equipment detecting the shape features of character images, converting character images into computer text, and determining the identification information corresponding to the character images through computer equipment.

[0003] In related art, an image processing model consisting of an encoder and an autoregressive decoder is used to perform character recognition processing on a character image to obtain identification information for the character image. When the identification information includes multiple characters, the autoregressive decoder generates the identification information one character at a time, and the generation of subsequent characters depends on the generation of all preceding characters.

[0004] Since the generation of the subsequent character depends on the recognition information of the previous character, errors generated when generating the previous character will affect the subsequent character, gradually forming error accumulation. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for character recognition in a character image. The technical solution is as follows:

[0006] According to one aspect of the present application, a method for character recognition in a character image is provided, the method comprising:

[0007] performing cropping processing on the character image to obtain at least two sub-images, wherein there is an overlapping area between two adjacent sub-images of the at least two sub-images, and the latter sub-image of the two adjacent sub-images is located behind the former sub-image in the character arrangement direction;

[0008] Performing autoregressive recognition processing on the at least two sub-images to obtain at least two pieces of recognition information, wherein the at least two pieces of recognition information respectively include recognition results of characters in corresponding sub-images in the at least two sub-images;

[0009] determining a tail character identified in the overlapping region of the preceding sub-image of the two adjacent sub-images, and determining a head character identified in the overlapping region of the following sub-image of the two adjacent sub-images;

[0010] Based on whether there is a repeated character in the tail character and the head character, the at least two pieces of recognition information are fused to obtain a recognition result of the character in the character image.

[0011] According to another aspect of the present application, a device for character recognition in a character image is provided, the device comprising:

[0012] a cropping module configured to crop the character image to obtain at least two sub-images, wherein there is an overlapping area between two adjacent sub-images of the at least two sub-images, and the latter sub-image of the two adjacent sub-images is located behind the former sub-image in the character arrangement direction;

[0013] a recognition module, configured to perform autoregressive recognition processing on the at least two sub-images to obtain at least two pieces of recognition information, wherein the at least two pieces of recognition information respectively include recognition results of characters in corresponding sub-images in the at least two sub-images;

[0014] a determination module, configured to determine a tail character identified in the overlapping region of the preceding sub-image from among the two adjacent sub-images, and to determine a head character identified in the overlapping region of the following sub-image from among the two adjacent sub-images;

[0015] The processing module is used to fuse the at least two pieces of recognition information based on whether there are repeated characters in the tail character and the head character, so as to obtain a recognition result of the character in the character image.

[0016] In an optional design of the application, the processing module is further configured to:

[0017] Based on whether there are repeated characters between the tail character and the head character, at least one of the preceding identification information and the following identification information is trimmed to obtain trimmed preceding identification information and trimmed following identification information;

[0018] splicing the trimmed front recognition information and the trimmed back recognition information to obtain a recognition result of the character in the character image;

[0019] The preceding identification information is identification information corresponding to the preceding sub-image, and the following identification information is identification information corresponding to the following sub-image.

[0020] In an optional design of the application, the processing module is further configured to:

[0021] In the case where there is a repeated character between the tail character and the head character, determining the first sub-information as the trimmed preceding identification information, and determining the second sub-information as the trimmed following identification information;

[0022] The first sub-information includes the character before the repeated character and the repeated character in the previous recognition information, and the second sub-information includes the character after the repeated character in the subsequent recognition information.

[0023] In an optional design of the application, the processing module is further configured to:

[0024] If there is no repeated character between the tail character and the head character, determining the third sub-information as the trimmed preceding identification information, and determining the fourth sub-information as the trimmed following identification information;

[0025] The third sub-information includes the characters in the preceding identification information excluding the tail character, and the fourth sub-information includes all the characters in the following identification information;

[0026] or, if there is no repeated character between the tail character and the head character, determining the fifth sub-information as the trimmed preceding identification information, and determining the sixth sub-information as the trimmed following identification information;

[0027] The fifth sub-information includes all characters in the preceding identification information, and the sixth sub-information includes characters in the following identification information excluding the first character.

[0028] In an optional design of the application, the processing module is further configured to:

[0029] Sequentially splicing the trimmed front recognition information and the trimmed back recognition information according to the arrangement order of the at least two recognition information to obtain a recognition result of the character in the character image;

[0030] Alternatively, the trimmed preceding recognition information and the trimmed following recognition information are integrally spliced ​​according to the arrangement order of the at least two pieces of recognition information to obtain a recognition result of the character in the character image;

[0031] Alternatively, the trimmed front recognition information and the trimmed back recognition information are grouped and spliced ​​according to the arrangement order of the at least two recognition information to obtain at least two group splicing results; the at least two group splicing results are merged and spliced ​​according to the arrangement order to obtain the recognition result of the character in the character image.

[0032] In an optional design of the application, the processing module is further configured to:

[0033] In the case where the tail character is a blank character, the preceding recognition information and the following recognition information are concatenated to obtain a recognition result of the character in the character image;

[0034] The empty character is used to indicate that there is no corresponding character in the previous sub-image in the overlapping area.

[0035] In an optional design of the application, the identification module is further used to:

[0036] performing autoregressive recognition processing on the at least two sub-images to obtain the at least two pieces of recognition information and at least two attention map groups, wherein the i-th attention map group is used to indicate a position of a character of the i-th piece of recognition information in the at least two pieces of recognition information in the i-th sub-image, where i is a positive integer less than or equal to the number of images of the at least two sub-images;

[0037] The determining module is further configured to:

[0038] The tail character and the head character are determined according to the previous attention map group corresponding to the previous sub-image in the at least two attention map groups, the previous recognition information and the subsequent recognition information corresponding to the two adjacent sub-images.

[0039] In an optional design of the application, the determination module is further configured to:

[0040] determining, in the previous recognition information, the tail character of the previous sub-image located in the overlapping area according to the previous attention map group;

[0041] The first t characters in the subsequent identification information are determined as the head characters, and t is the number of the tail characters.

[0042] In an optional design of the application, the previous attention map group includes a attention maps, where a is the number of characters in the previous recognition information;

[0043] The determining module is further configured to:

[0044] Determining a target attention map in the group of previous attention maps, wherein the target attention map is the first attention map in the group of previous attention maps that meets a target condition;

[0045] Determine the first character corresponding to the target attention map and the character following the first character in the previous recognition information as the tail character;

[0046] The target condition includes that the position of the pixel point exceeding the target threshold in the attention map belongs to the area corresponding to the overlapping area in the attention map.

[0047] In an optional design of the application, the identification module is further used to:

[0048] Dividing the at least two sub-images into at least one batch processing group, each of the batch processing group includes at least two sub-images;

[0049] Autoregressive recognition processing is performed on the at least one batch processing group to obtain at least one identification information group, where the at least one identification information group includes the at least two identification information.

[0050] In an optional design of the application, the identification module is further used to:

[0051] performing encoding processing on the at least two sub-images to obtain at least two feature representations;

[0052] Autoregressive decoding is performed on the at least two feature representations to obtain the at least two pieces of identification information.

[0053] In an optional design of the application, the cutting module is further used to:

[0054] determining an image between a first starting cropping line and a first ending cropping line in the character image as a first sub-image, wherein the first starting cropping line is located at a starting position of a character in the character image, a distance between the first starting cropping line and the first ending cropping line is a first length, and a direction from the first starting cropping line to the first ending cropping line is the same as a character arrangement direction;

[0055] Determine the image between the mth starting cropping line and the mth ending cropping line in the character image as the mth sub-image, the distance between the mth starting cropping line and the m-1th ending cropping line being the second length, the direction from the m-1th ending cropping line to the mth starting cropping line being opposite to the character arrangement direction, and the direction from the mth starting cropping line to the mth ending cropping line being the same as the character arrangement direction;

[0056] Wherein, m is an integer greater than 1 and less than or equal to the number of images of the at least two sub-images. When the distance between the mth starting cropping line and the end position of the character is less than the first length, the mth ending cropping line is located at the end position of the character in the character image.

[0057] In an optional design of the application, the device further comprises:

[0058] An acquisition module, configured to receive modification information of the recognition result;

[0059] An updating module, configured to update the first length used by a next character image according to the modification information;

[0060] The modification information includes at least one of the number of modifications to the recognition result, the number of modified characters, and the degree of difference between the modified characters.

[0061] In an optional design of the application, the device further comprises:

[0062] An acquisition module, configured to acquire a processing time for fusing the at least two pieces of identification information;

[0063] An updating module is used to update the second length used by the next character image according to the processing time.

[0064] In an optional design of the application, the cutting module is further used to:

[0065] The original image is cropped according to the character arrangement direction in the original image to obtain at least one character image, in which a row or a column of characters are arranged.

[0066] According to another aspect of the present application, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the character recognition method in the character image as described above.

[0067] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for character recognition in a character image as described above.

[0068] According to another aspect of the present application, a computer program product is provided, which includes computer instructions, which are stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the character recognition method in the character image described above.

[0069] The beneficial effects of the technical solution provided by this application include at least:

[0070] By cropping the character image, the number of previously generated characters that the subsequent characters in the recognition information rely on is reduced. By fusing adjacent recognition information, the integrity of the recognition results obtained by autoregressive recognition is ensured; the possibility of error accumulation of characters during the autoregressive recognition process is reduced, and the recognition efficiency of character images is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.

[0072] Figure 1 is a schematic diagram of a computer system provided by an exemplary embodiment of the present application;

[0073] Figure 2 is a schematic diagram of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0074] Figure 3 is a schematic diagram of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0075] Figure 4 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0076] Figure 5 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0077] Figure 6 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0078] Figure 7 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0079] Figure 8 is a schematic diagram of a character image provided by an exemplary embodiment of the present application;

[0080] Figure 9 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0081] Figure 10 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0082] Figure 11 is a schematic diagram of a character image provided by an exemplary embodiment of the present application;

[0083] Figure 12 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0084] Figure 13is a schematic diagram of character batch recognition in a character image provided by an exemplary embodiment of the present application;

[0085] Figure 14 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0086] Figure 15 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0087] Figure 16 is a schematic diagram of a character image provided by an exemplary embodiment of the present application;

[0088] Figure 17 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0089] Figure 18 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0090] Figure 19 is a flow chart of a method for character recognition in a character image provided by an exemplary embodiment of the present application;

[0091] Figure 20 is a schematic diagram of an original image provided by an exemplary embodiment of the present application;

[0092] Figure 21 is a structural block diagram of a character recognition device in a character image provided by an exemplary embodiment of the present application;

[0093] Figure 22 This is a structural block diagram of a server provided by an exemplary embodiment of the present application.

[0094] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION

[0095] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0096] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0097] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0098] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the character images and other data involved in this application were obtained with full authorization.

[0099] It should be understood that although the terms first, second, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter without departing from the scope of this disclosure. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0100] Figure 1 A schematic diagram of a computer system provided by an embodiment of the present application is shown. The computer system can be implemented as a system architecture of a method for character recognition in a character image. The computer system may include: a terminal 100 and a server 200. The terminal 100 may be an electronic device such as a mobile phone, a tablet computer, a vehicle-mounted terminal (vehicle computer), a wearable device, a PC (Personal Computer), an unmanned reservation terminal, etc. A client that runs a target application may be installed in the terminal 100. The target application may be an image processing application or other application that provides image processing functions, which is not limited in the present application. In addition, the present application does not limit the form of the target application, including but not limited to App (Application, application) installed in the terminal 100, applets, etc., and may also be in the form of a web page. The server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The server 200 may be the background server of the above-mentioned target application, used to provide background services for the client of the target application.

[0101] In the character recognition method in the character image provided by the embodiment of the present application, the execution subject of each step can be a computer device, which refers to an electronic device with data calculation, processing and storage capabilities. Figure 1 Taking the implementation environment of the scheme shown as an example, the character recognition method in the character image can be executed by the terminal 100 (such as the client of the target application installed and running in the terminal 100 executes the character recognition method in the character image), or the character recognition method in the character image can be executed by the server 200, or the terminal 100 and the server 200 can interact and cooperate to execute it, and this application does not limit this.

[0102] Furthermore, the technical solution of this application can be combined with blockchain technology. For example, in the character recognition method disclosed in this application, some of the data involved (such as the first image, the first pixel block, and the second pixel block) can be stored on a blockchain. The terminal 100 and the server 200 can communicate via a network, such as a wired or wireless network.

[0103] Figure 2 A schematic diagram of a method for character recognition in a character image provided by an embodiment of the present application is shown.

[0104] The character image 310 is a character image including the character "Optical character recognition is receiving increasing attention, for example: optical character recognition includes three steps: image preprocessing, text detection and text recognition"; the character image 310 is cropped to obtain m sub-images; m is a positive integer greater than or equal to 2, and in one implementation of this embodiment, m is equal to 5.

[0105] Figure 2 3 shows a first sub-image 312a, a second sub-image 312b and a third sub-image 312c; it can be understood that there are more sub-images in the character image; Figure 2 Only some sub-images are shown as examples; further, the serial number of the sub-image is related to the position of the sub-image in the character image 310. For example, the first sub-image close to the left edge of the character image 310 is the first sub-image 312a, the second sub-image close to the left edge of the character image 310 is the second sub-image 312b, and so on.

[0106] There is an overlapping area between two adjacent sub-images, for example: there is an overlapping area between the first sub-image 312a and the second sub-image 312b, that is, the first sub-image 312a and the second sub-image 312b both include overlapping areas; exemplarily, in two adjacent sub-images, the sub-image close to the starting direction of the character is also called the front sub-image, and the sub-image away from the starting direction of the character is also called the back sub-image; for example, the text arrangement direction in the character image 310 is from left to right, and the starting direction of the character is the left.

[0107] Exemplarily, the image width of the overlapping area is Wc, which is smaller than the image width W of the second sub-image 312b.

[0108] Optionally, the image widths of the first sub-image 312a and the second sub-image 312b are both W.

[0109] Optionally, the image width of the overlapping areas between adjacent sub-images is Wc.

[0110] Next, a batch group 320 is constructed based on the sub-images of the character image 310. The number of batch groups 320 is usually multiple, but it is not excluded that there is only one batch group 320. Optionally, when there are multiple batch groups 320, the number of sub-images in each batch group 320 is the same.

[0111] The image processing model is called to perform autoregressive recognition processing on the batch group 320; wherein the image processing model includes an encoder 330a and an autoregressive decoder 330b.

[0112] Specifically, the encoder 330a is called to perform encoding processing on the batch group 320 to obtain a feature representation 320a, where the feature representation 320a includes m feature representations corresponding to the m sub-images.

[0113] Optionally, the dimension of the feature representation is smaller than the image width W of the sub-image; for example, if the image width of the sub-image is 500 pixels, the dimension of the feature representation is typically smaller than 500, and the product of the feature representation and the compression factor is equal to the image width of the sub-image; the compression factor is used to represent the correspondence between the dimension in the feature representation and the width of the sub-image.

[0114] The autoregressive decoder 330b is called to perform autoregressive decoding on the feature representation 320a to obtain recognition information 340 and an attention map group 350; the recognition information 340 includes characters corresponding to m sub-images, and the attention map group 350 includes a map group corresponding to m sub-images, and the recognition information 340 and the attention map group 350 correspond one to one.

[0115] According to the attention map group 350 , the tail character 362 of the preceding sub-image located in the overlapping area and the head character 364 of the succeeding sub-image located in the overlapping area are determined in two adjacent recognition information in the recognition information 340 .

[0116] Based on the repetition of the tail character 362 and the head character 364, at least two pieces of recognition information are fused 340 to obtain a recognition result 366 for the character in the character image. The recognition result 366 includes part or all of the characters in each piece of recognition information 340. Exemplarily, the corresponding pieces of recognition information 340 are fused based on the positions of the m sub-images in the character image 310.

[0117] Next, we will further introduce the attention graph group:

[0118] Figure 3 A schematic diagram of a method for character recognition in a character image provided by an embodiment of the present application is shown.

[0119] For example, a sub-image 370 is used for illustration. The sub-image 370 is a character image of the characters "ontaneously pro". After the batch group containing the sub-image 370 is subjected to autoregressive recognition processing by the image processing model, recognition information and an attention map group corresponding to the sub-image 370 are obtained. The recognition information includes the characters in the sub-image 370: "ontaneously pro". Here, a space is counted as a character for example, and a total of 15 characters are included. The attention map group corresponds to 15 attention maps, and each attention map is used to indicate the position of a character in the recognition information in the sub-image 370.

[0120] The first attention map 372a is used to indicate the position of the first character "o" in the recognition information in the sub-image 370; the second attention map 372b is used to indicate the position of the second character "n" in the recognition information in the sub-image 370; the third attention map 372c is used to indicate the position of the third character "t" in the recognition information in the sub-image 370; the fifteenth attention map 372d is used to indicate the position of the fifteenth character "o" in the recognition information in the sub-image 370; it can be understood that there are 15 attention maps in the attention map group. Figure 3 The first attention map 372a, the second attention map 372b, the third attention map 372c, and the fifteenth attention map 372d are shown only for exemplary purposes.

[0121] Furthermore, the first attention map that meets the target condition is searched in the attention map group; the target condition includes that the position of the pixel point exceeding the target threshold in the attention map belongs to the overlapping area; the overlapping area is the overlapping area of ​​sub-image 370 and a sub-image after sub-image 370.

[0122] The character corresponding to the first attention map that meets the target condition and the characters after this character are determined as the tail characters.

[0123] For example, the eleventh attention map in the attention map group corresponding to sub-image 370 is the first attention map that meets the target condition; the eleventh attention map corresponds to the eleventh character "y" in the recognition information; the character "ypro" in the recognition information is determined as the tail character, and the tail character includes 5 characters.

[0124] The first five characters in the identification information corresponding to the sub-image following the sub-image 370 are determined as the head characters.

[0125] In one example, when there are repeated characters in the tail character and the head character, the output information includes first splicing information, and the first splicing information includes first sub-information and second sub-information.

[0126] The first sub-information includes characters other than the characters after the repeated characters in the identification information corresponding to the sub-image 370 ; the second sub-information includes characters after the repeated characters in the identification information corresponding to a sub-image after the sub-image 370 .

[0127] For example, the last character and the first character have a repeated character "pr", and the character after the repeated character in the identification information of the sub-image 370 is "o".

[0128] The first sub-information includes the characters in the identification information “ontaneously pro” except the characters after the repeated characters, that is, “ontaneously pr”; the second sub-information includes the characters after the repeated characters “pr” in the identification information corresponding to a sub-image after sub-image 370 .

[0129] In another example, when there is no repeated character in the tail character and the head character, the output information includes second concatenation information, and the second concatenation information includes third sub-information and fourth sub-information.

[0130] The third sub-information includes the characters in the identification information corresponding to the sub-image 370 excluding the tail character, ie, “ontaneous1”. The fourth sub-information includes all the information in the identification information corresponding to the sub-image following the sub-image 370 .

[0131] Next, a character recognition method in a character image will be introduced through the following embodiments.

[0132] Figure 4 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. The method includes:

[0133] Step 510: cropping the character image to obtain at least two sub-images;

[0134] There is an overlapping area between two adjacent sub-images of the at least two sub-images, and the subsequent sub-image of the two adjacent sub-images is located behind the preceding sub-image in the character arrangement direction; exemplarily, the direction of the cropping line of the cropping process is perpendicular to the character arrangement direction in the character image, that is, the cropping direction of the character image is perpendicular to the character arrangement direction. In one example, the length of the at least two sub-images along the character arrangement direction is less than the length of the character image along the character arrangement direction.

[0135] The two adjacent sub-images are used to indicate that the positions of the two sub-images in the character image are adjacent. In one example, the length of the overlapping area between the two adjacent sub-images is greater than half of the width of a character.

[0136] The character arrangement direction is used to indicate the direction in which characters in a character image are arranged sequentially. The character arrangement direction is usually from left to right, but it does not exclude the case where the character arrangement direction is from right to left or from top to bottom, such as ancient Chinese characters.

[0137] It should be noted that a character image generally has a row or column of characters, but multiple rows or columns of characters are also possible. Optionally, if the characters in the character image are arranged from left to right, the character image has a row of characters. If the characters in the character image are arranged from top to bottom, the character image has a column of characters.

[0138] Step 520: performing autoregressive recognition processing on at least two sub-images to obtain at least two pieces of recognition information;

[0139] The at least two pieces of recognition information respectively include recognition results of characters in corresponding sub-images in the at least two sub-images; illustratively, the i-th piece of recognition information in the at least two pieces of recognition information includes the recognition result of characters in the i-th sub-image.

[0140] Exemplarily, autoregressive recognition processing is used to indicate that the subsequent character in the recognition information is obtained by auxiliary recognition with dependence on the previous character in the recognition information. Taking the i-th recognition information as an example, in the i-th recognition information, the subsequent character is the a-th character in the i-th recognition information, and the a-th character is obtained by auxiliary recognition with dependence on the character before the a-th character in the i-th recognition information; for example, based on the semantic information of the character before the a-th character, the a-th character is obtained by auxiliary recognition.

[0141] It should be noted that the preceding character can be all or part of the character preceding the following character; any subsequent character recognition process that relies on the preceding character is considered autoregressive recognition. For example, the following character in a sub-image is recognized with the aid of the preceding character in the recognition information; in multiple sub-images, the autoregressive recognition of different sub-images is independent of each other.

[0142] Step 530: determining the tail character identified in the overlapping area of ​​the front sub-image from the two adjacent sub-images, and determining the head character identified in the overlapping area of ​​the back sub-image from the two adjacent sub-images;

[0143] The two adjacent sub-images are used to indicate that the positions of the two sub-images in the character image are adjacent, and the position of the front sub-image in the character image is located before the rear sub-image.

[0144] Exemplarily, the tail character is the result of character recognition in the overlapping area of ​​the previous sub-image. The tail character can be obtained by identifying and processing the overlapping area of ​​the previous sub-image, or by selecting from the previous recognition information corresponding to the previous sub-image. This embodiment does not make any restrictive provisions; similarly, the first character is the result of character recognition in the overlapping area of ​​the rear sub-image, and no restrictive provisions are made on the method of determining the first character.

[0145] Step 540: Based on whether there are repeated characters in the tail character and the head character, at least two pieces of recognition information are fused to obtain a recognition result of the character in the character image;

[0146] The recognition result includes all characters in the character image, and the recognition result includes part or all characters of each of the at least two recognition information; the fusion processing usually includes trimming at least one of the at least two recognition information, and splicing the trimmed recognition information; but it does not rule out the situation where the fusion processing includes splicing at least two recognition information.

[0147] To sum up, by cropping the character image, the number of previously generated characters that the subsequent characters in the recognition information rely on is reduced, and by fusing adjacent recognition information, the integrity of the recognition results obtained by autoregressive recognition is ensured; the possibility of error accumulation of characters during the autoregressive recognition process is reduced, and the recognition efficiency of character images is improved.

[0148] Figure 5 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 In the illustrated embodiment, step 540 may be implemented as steps 542 and 544:

[0149] Step 542: based on whether there are repeated characters in the tail character and the head character, at least one of the preceding identification information and the following identification information is trimmed to obtain trimmed preceding identification information and trimmed following identification information;

[0150] The preceding identification information is identification information corresponding to the preceding sub-image, and the following identification information is identification information corresponding to the following sub-image.

[0151] Both the tail character and the head character include repeated characters; the repeated character is one character or a plurality of characters that are adjacent in sequence; illustratively, in a preferred embodiment, the repeated character includes two characters.

[0152] Optionally, when there are multiple repeated parts in the tail character and the head character, one of the repeated parts is determined as a repeated character; further optionally, the repeated character is determined based on at least one of the position of the repeated part, the character length, and the character content.

[0153] In one implementation, the prior identification information or the subsequent identification information is pruned, and the pruned prior identification information and the pruned prior identification information obtained are the same as the prior identification information, or the pruned subsequent identification information are the same as the subsequent identification information.

[0154] Step 544: splicing the trimmed front recognition information and the trimmed back recognition information to obtain a recognition result of the character in the character image;

[0155] The trimmed preceding recognition information and the trimmed following recognition information are spliced ​​according to the positions of the corresponding preceding sub-image and following sub-image in the character image.

[0156] Exemplarily, the recognition result includes part or all of the characters of each piece of recognition information in the recognition information corresponding to all sub-images obtained by cropping the character image.

[0157] To sum up, by trimming the two adjacent recognition information based on the tail characters and the head characters, and splicing the trimmed recognition information, the integrity of the recognition results is guaranteed; the trimmed tail characters and the head characters are limited to the characters corresponding to the overlapping area, which ensures that the output information correctly indicates the corresponding characters in the character image.

[0158] Next, step 542 in the above embodiment is further described, that is, the process of trimming at least one of the preceding identification information and the following identification information is described in detail:

[0159] There are at least two implementations of step 542:

[0160] Implementation method 1: There are repeated characters between the tail character and the first character;

[0161] Implementation method 2: There are no repeated characters between the tail character and the first character.

[0162] The following two examples are used to illustrate:

[0163] Implementation method 1: There are repeated characters between the tail character and the first character;

[0164] In implementation mode 1, step 542 can be implemented as sub-step 1:

[0165] Sub-step 1: in the case where there are repeated characters between the tail character and the head character, determining the first sub-information as the trimmed preceding identification information, and determining the second sub-information as the trimmed following identification information;

[0166] The first sub-information includes the characters before the repeated character and the repeated character in the front recognition information, and the second sub-information includes the characters after the repeated character in the back recognition information.

[0167] For example, the front identification information includes "The online experiments demonstro", and the tail characters include "monstro"; the back identification information includes "nonstrate the effectiveness of our work", and the first and last characters include "nonstra"; it can be understood that there is a repeated character "onstr" between the tail characters and the first characters.

[0168] The first sub-information is determined as the pruned previous recognition information, the first sub-information including the characters "The online experiments dem" and the repeated characters "onstr" preceding the repeated characters in the previous recognition information.

[0169] The second sub-information is determined as the pruned post-recognition information, the second sub-information including the characters “ate the effectiveness of our work” located after the repeated characters in the post-recognition information.

[0170] It can be understood that in another optional implementation, the first sub-information does not include repeated characters, and the second sub-information includes repeated characters.

[0171] To sum up, when there are repeated characters between the tail character and the head character, the repeated characters are deduplicated to construct the recognition result; this avoids the appearance of repeated content in the overlapping area of ​​the characters in the recognition result; and ensures that the recognition result correctly indicates the corresponding characters in the character image, thereby improving the recognition efficiency of the character image.

[0172] Implementation method 2: There are no repeated characters between the tail character and the first character.

[0173] In the second implementation, step 542 can be implemented as sub-step 2 or sub-step 3:

[0174] Sub-step 2: if there is no repeated character between the tail character and the head character, determine the third sub-information as the trimmed preceding identification information, and determine the fourth sub-information as the trimmed following identification information;

[0175] The third sub-information includes the characters in the front recognition information except the tail character, and the fourth sub-information includes all the characters in the back recognition information.

[0176] For example, the front identification information includes "The online experiments denature", and the tail characters include "nature"; the back identification information includes "monstrate the effectiveness of our work", and the first and last characters include "monstr"; it can be understood that there are no repeated characters between the tail characters and the first characters.

[0177] For example, a recognition error occurs when generating the first character "n" of the tail character in the previous recognition information, and errors accumulate in subsequent characters in the tail character; in one example, the recognition error is caused by combining the semantic information in the previous recognition information; in the subsequent recognition information, the first character is the first six characters in the subsequent recognition information, and the first character is generated only by the shape features in the character image; it will not be affected by the semantic information to cause recognition errors; compared with the first character, the tail character has a lower confidence.

[0178] The third sub-information is determined as the trimmed previous identification information, and the third sub-information includes the characters "The online experiments de" excluding the tail characters in the previous identification information.

[0179] The fourth sub-information is determined as the pruned post-recognition information, and the fourth sub-information includes all characters "monstrate the effectiveness of our work" in the post-recognition information.

[0180] Sub-step 3: if there is no repeated character between the tail character and the head character, determine the fifth sub-information as the trimmed preceding identification information, and determine the sixth sub-information as the trimmed following identification information;

[0181] The fifth sub-information includes all characters in the front identification information, and the sixth sub-information includes characters in the back identification information excluding the first character.

[0182] For example, the front identification information includes "The online experiments demonstr", and the tail characters include "monstr"; the back identification information includes "camrenate the effectiveness of our work", and the first and last characters include "camren". It can be understood that there are no repeated characters between the tail characters and the first characters.

[0183] Optionally, the clarity of the character image does not exceed a clarity threshold, and the tail character in the preceding recognition information is obtained by auxiliary recognition based on the characters preceding the tail character in the preceding recognition information, i.e., semantic information is incorporated into the generation of the tail character. In the subsequent recognition information, the first character is the first six characters in the subsequent recognition information, and the first character is generated solely based on shape features in the character image; compared to the first character, the tail character has a higher confidence level.

[0184] The fifth sub-information is determined as the pruned previous recognition information, and the fifth sub-information includes all characters "The online experiments demonstr" in the previous recognition information.

[0185] The sixth sub-information is determined as the pruned subsequent identification information, and the sixth sub-information includes the characters "ate the effectiveness of our work" excluding the first character in the subsequent identification information.

[0186] To sum up, when there are no repeated characters between the tail character and the head character, the tail character or the head character is selected to construct the output information; this avoids the occurrence of erroneous content in the overlapping area of ​​the characters in the recognition result; and ensures that the recognition result correctly indicates the corresponding character in the character image, thereby improving the recognition efficiency of the character image.

[0187] Figure 6 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 5 In the illustrated embodiment, step 544 may be implemented as step 544a, step 544b, or step 544c:

[0188] Step 544a: sequentially concatenate the trimmed front recognition information and the trimmed back recognition information according to the arrangement order of at least two pieces of recognition information to obtain a recognition result of the character in the character image;

[0189] Exemplarily, in this embodiment, after the recognition information is trimmed, the recognition information is immediately spliced. After the recognition information is spliced, the next recognition information is trimmed, and the trimming process is performed in sequence according to the position of the sub-image corresponding to the recognition information in the character image.

[0190] For example, identification information includes first identification information, second identification information, and third identification information.

[0191] First, the first identification information and the second identification information are pruned to obtain pruned first identification information and pruned second identification information; and the pruned first identification information and the pruned second identification information are spliced ​​to obtain first spliced ​​information.

[0192] The first splicing information and the third identification information are trimmed to obtain trimmed first splicing information and trimmed third identification information; the trimmed first splicing information and the trimmed third identification information are spliced ​​to obtain second splicing information; the second splicing information is a recognition result of the character in the character image.

[0193] Step 544b: splicing the trimmed front recognition information and the trimmed back recognition information as a whole according to the arrangement order of at least two pieces of recognition information to obtain a recognition result of the character in the character image;

[0194] Illustratively, in this embodiment, a plurality of identification information corresponding to a plurality of sub-images in at least two sub-images is trimmed, and then the trimmed plurality of identification information is integrally spliced.

[0195] For example, identification information includes first identification information, second identification information, and third identification information.

[0196] The first identification information and the second identification information are trimmed according to the repetition of the tail character in the first identification information and the head character in the second identification information; the second identification information and the third identification information are trimmed according to the repetition of the tail character in the second identification information and the head character in the third identification information; and the trimmed first identification information, the trimmed second identification information and the trimmed third identification information are obtained.

[0197] The trimmed first recognition information, the trimmed second recognition information, and the trimmed third recognition information are integrally spliced ​​to obtain a recognition result of the character in the character image.

[0198] Step 544c: Group and splice the trimmed front recognition information and the trimmed back recognition information according to the arrangement order of at least two recognition information to obtain at least two group splicing results; merge and splice the at least two group splicing results according to the arrangement order to obtain the recognition result of the character in the character image.

[0199] Illustratively, in this embodiment, a plurality of identification information corresponding to a plurality of sub-images in at least two sub-images is trimmed, and then the trimmed plurality of identification information is grouped and spliced.

[0200] For example, the identification information includes first identification information, second identification information, third identification information, and fourth identification information.

[0201] The first identification information and the second identification information are trimmed according to the repetition of the tail character in the first identification information and the head character in the second identification information; the second identification information and the third identification information are trimmed according to the repetition of the tail character in the second identification information and the head character in the third identification information; and so on to obtain the trimmed first identification information, the trimmed second identification information, the trimmed third identification information and the trimmed fourth identification information.

[0202] The trimmed first identification information and the trimmed second identification information are spliced ​​together to obtain a first group splicing result; the trimmed third identification information and the trimmed fourth identification information are spliced ​​together to obtain a second group splicing result; the first group splicing result and the second group splicing result are spliced ​​together to obtain a recognition result of the character in the character image.

[0203] It should be noted that at least one of step 544a, step 544b and step 544c in this embodiment can be split or combined to form a new embodiment with other steps in this embodiment.

[0204] In summary, the recognition results are obtained by sequential splicing, overall splicing or group splicing, which expands the specific methods of obtaining the recognition results; the influence of the splicing process on character recognition is fully considered, and the recognition efficiency of the character image is guaranteed.

[0205] Figure 7 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 The embodiment shown further includes step 550:

[0206] Step 550: When the tail character is a blank character, concatenate the preceding recognition information and the following recognition information to obtain a recognition result of the character in the character image;

[0207] The null character is used to indicate that there is no corresponding character in the overlapping area of ​​the previous sub-image. For example, when the overlapping area between two adjacent sub-images is small, or the overlapping area does not include an image of a complete character, resulting in the inability to recognize the character, the trailing character is a null character.

[0208] Figure 8 A schematic diagram of a character image provided by an exemplary embodiment of the present application is shown; the character image 610 is a character image including the characters "Optical character recognition is gaining increasing attention"; the character image 610 is cropped to obtain a first sub-image 612 and a second sub-image 614; there is an overlapping area 610a between the first sub-image 612 and the second sub-image 614; exemplarily, since the overlapping area 610a does not include a complete character, the tail character of the first sub-image 612 is a blank character.

[0209] To sum up, when the tail character is a blank character, the two adjacent recognition information are spliced ​​to construct the recognition result, which avoids the impact of the cropping line passing through the same character on the recognition information, ensures the continuity of the recognition result, and improves the recognition efficiency of the character image.

[0210] Figure 9 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 In the illustrated embodiment, step 520 may be implemented as step 522; step 530 may be implemented as step 532:

[0211] Step 522: performing autoregressive recognition processing on at least two sub-images to obtain at least two pieces of recognition information and at least two attention map groups;

[0212] The i-th attention map group is used to indicate the position of the character of the i-th recognition information in the at least two recognition information in the i-th sub-image, where i is a positive integer less than or equal to the number of images of the at least two sub-images.

[0213] Exemplarily, the attention map group includes at least one attention map that indicates the position information of the characters in the recognition information; optionally, at least one of the length or width of the attention map and the sub-image in the attention map group is different; taking the example that the width of the sub-image is r times the width of the attention map, one pixel in the attention map corresponds to r pixels in the sub-image.

[0214] Step 532: determining the tail character and the head character according to the previous attention map group corresponding to the previous sub-image in the at least two attention map groups, the previous recognition information and the following recognition information corresponding to the two adjacent sub-images;

[0215] Exemplarily, the tail character and the head character are determined in the previous recognition information and the subsequent recognition information according to the previous attention map group.

[0216] Optionally, the tail character and the head character are determined in the preceding recognition information and the following recognition information respectively according to the preceding attention map group and the following attention map group.

[0217] Among them, the front attention map group is the attention map group corresponding to the front sub-image, and the back attention map group is the attention map group corresponding to the back sub-image.

[0218] In summary, the position of the characters in the recognition information in the sub-image is indicated by the attention map group, the tail character and the head character are determined, and a connection is established between the attention map group and the tail character and the head character, which lays the foundation for constructing the recognition result, ensures the correct fusion between the two adjacent recognition information, and improves the recognition efficiency of the character image.

[0219] Figure 10 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 9 In the illustrated embodiment, step 532 may be implemented as steps 532a and 532b:

[0220] Step 532a: determining the tail character of the previous sub-image located in the overlapping area in the previous recognition information according to the previous attention map group;

[0221] Exemplarily, the previous attention map group is used to indicate the position of the characters in the previous recognition information in the previous sub-image. According to the previous attention map group, the characters located in the overlapping area in the previous sub-image are determined in the previous recognition information, and the characters located in the overlapping area are used as tail characters.

[0222] Optionally, in one implementation, step 532a may be implemented as the following two sub-steps:

[0223] Sub-step 1: Determine the target attention map in the previous attention map group. The target attention map is the first attention map in the previous attention map group that meets the target condition.

[0224] The previous attention map group includes a attention maps, where a is the number of characters in the previous recognition information; exemplarily, an attention map in the attention group map is used to indicate the position of a character in the recognition information in the sub-image.

[0225] The target condition includes that the positions of the pixel points in the attention map that exceed the target threshold belong to the region corresponding to the overlapping region in the attention map. Exemplarily, the sub-image pixel points corresponding to the pixel points in the first attention map that exceed the target threshold are the positions of the first character in the sub-image.

[0226] Exemplarily, the brightness of the pixel points in the attention map is positively correlated with the confidence of the character position; in one example, the target condition includes that the positions of all pixel points in the attention map that exceed the target threshold belong to the region corresponding to the overlapping region in the attention map; as Figure 11 shown, there is an overlapping region 620a between the sub-image 620 and the sub-images after the sub-image 620; in the sub-image 620, only the right half of the character "益" is located in the overlapping region; for the pixel points in the attention map corresponding to the character "益" that exceed the target threshold, only the right half belongs to the region corresponding to the overlapping region in the attention map.

[0227] In the sub-image 620, all of the characters "受" after the character "益" are located in the overlapping region; for the pixel points in the attention map corresponding to the character "受" that exceed the target threshold, they all belong to the region corresponding to the overlapping region in the attention map. The attention map corresponding to the character "受" is the first attention map that meets the target condition.

[0228] It can be understood that the above description is an exemplary example, and different first attention maps that meet the target condition can be determined by configuring the target condition. In another example, the target condition includes that there are positions of pixel points in the attention map that exceed the target threshold and belong to the region corresponding to the overlapping region in the attention map. As Figure 11 shown, only the right half of the character "益" is located in the overlapping region; for the positions of the pixel points in the attention map corresponding to the character "益" that exceed the target threshold, they belong to the region corresponding to the overlapping region in the attention map; the attention map corresponding to the character "益" is the first attention map that meets the target condition.

[0229] Sub-step 2: Determine the first character corresponding to the target attention map and the characters after the first character in the previous recognition information as the trailing characters;

[0230] In the previous recognition information, determine the first character according to the target attention map, where the target attention map is used to indicate the position of the first character in the sub-image; in the previous recognition information, determine the first character and the characters after the first character as the trailing characters.

[0231] Step 532b: Determine the first t characters in the subsequent recognition information as the leading characters;

[0232] t is the number of characters of the trailing characters; exemplarily, the number of characters of the leading characters and the trailing characters is the same, and the leading characters are determined according to the number of characters of the trailing characters.

[0233] It can be understood that in this embodiment, the first character is determined based on the tail character, and in an optional implementation method, the tail character and the first character are determined separately; for example, based on the previous attention map group and the subsequent attention map group, the tail character and the first character are determined in the previous recognition information and the subsequent recognition information respectively.

[0234] In summary, by searching for the first attention map that meets the target conditions in the attention map group, the corresponding first character in the overlapping area is determined as the first character in the tail characters, and the tail character is determined; according to the number of characters in the tail characters, the head character is determined, ensuring the correct fusion between the two adjacent recognition information, thereby improving the recognition efficiency of the character image.

[0235] Figure 12 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 In the illustrated embodiment, step 520 may be implemented as steps 524 and 525:

[0236] Step 524: Divide the at least two sub-images into at least one batch processing group;

[0237] Each batch processing group includes at least two sub-images. Exemplarily, the at least two sub-images in a batch processing group are usually group images that are adjacent to each other in sequence, but the situation where there is no adjacent relationship between the sub-images is not excluded.

[0238] For example, taking the example of a character image corresponding to m sub-images, n sub-images among the m sub-images are divided into a batch processing group; for the m sub-images, a total of x batch processing groups are divided, where x is an integer rounded up from the quotient of m divided by n; when the number of sub-images in the x-th batch processing group is less than n, blank sub-images or sub-images of the next character image can be used to fill in the n sub-images; or, the sub-images may not be filled in and directly used as the x-th batch processing group.

[0239] Step 525: performing autoregressive recognition processing on at least one batch processing group to obtain at least one identification information group;

[0240] At least one identification information group includes at least two pieces of identification information, and the identification information group includes identification information of sub-images in the corresponding batch processing group.

[0241] For example, when there are multiple batch processing groups, the autoregressive recognition processing is usually performed on the multiple batch processing groups in sequence; however, it is not excluded that the autoregressive recognition processing is performed on multiple batch processing groups at the same time.

[0242] For example, Figure 13 A schematic diagram of character batch recognition in a character image provided by an exemplary embodiment of the present application is shown.

[0243] Exemplarily, at least one of the length or width of the sub-images in a batch group 710 is the same; in one example, the image matrix dimension constructed by a batch group 710 is (n, r, h, w); wherein n represents the number of sub-images in the batch group, r represents the number of color channels of the sub-image, h represents the height of the sub-image, and w represents the width of the sub-image.

[0244] By calling the encoder 720a to encode the batch group 710, and by calling the autoregressive decoder 720b to decode the encoded result of the batch group 710, the recognition information 730 and the attention map group 740 are obtained.

[0245] The matrix dimensions of the recognition information 730 are (n, i), where n represents the number of sub-images in the batch group and i represents the maximum number of characters in the recognition information corresponding to a sub-image. The matrix dimensions of the attention map group 740 are (n, i, Wc), where Wc can be the same as or different from w and represents the width of the attention map in the attention map group 740.

[0246] To sum up, by dividing the sub-images into batch groups, parallel recognition processing of multiple sub-images in the batch group is achieved. By performing parallel recognition processing on multiple sub-images, the unit time required to recognize a sub-image is shortened, and the recognition efficiency of character images is improved.

[0247] Figure 14 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 In the illustrated embodiment, step 520 may be implemented as steps 526 and 527:

[0248] Step 526: performing encoding processing on the at least two sub-images to obtain at least two feature representations;

[0249] Exemplarily, the representation of the feature representation includes but is not limited to at least one of the following: a feature vector, a feature matrix, and a feature value.

[0250] In an optional implementation, encoding is performed on at least two sub-images by calling an encoder; illustratively, the encoder includes at least one of the following network models: a convolutional neural network (CNN), a recurrent neural network (RNN), and a transformer network (Transformer Networks).

[0251] Step 527: performing autoregressive decoding on the at least two feature representations to obtain at least two pieces of identification information;

[0252] The autoregressive decoding process is used to decode the feature representation to obtain identification information corresponding to the feature representation.

[0253] In an optional implementation, autoregressive decoding is performed on at least two sub-images by calling an autoregressive decoder; exemplarily, the autoregressive decoder includes at least one of the following network models: a recurrent neural network (RNN), a transformer network, and a self-attention mechanism network with linear complexity (Linformer).

[0254] Further optionally, the character recognition model includes an encoder and an autoregressive decoder.

[0255] To sum up, by encoding and autoregressive decoding the sub-image, the identification information corresponding to the sub-image is obtained, which ensures that the sub-image of the image information including the characters is recognized and processed to obtain the corresponding recognition result; reduces the number of previously generated characters that the generation of subsequent characters in the recognition information depends on, reduces the possibility of error accumulation of characters during the recognition process, and improves the recognition efficiency of character images.

[0256] Figure 15 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4 In the illustrated embodiment, step 510 may be implemented as steps 512 and 514:

[0257] Step 512: determining the image between the first starting cropping line and the first ending cropping line in the character image as a first sub-image;

[0258] The first starting cropping line is located at the starting position of the character in the character image. The distance between the first starting cropping line and the first ending cropping line is a first length. The direction from the first starting cropping line to the first ending cropping line is the same as the character arrangement direction.

[0259] Figure 16 A schematic diagram of a character image provided by an exemplary embodiment of the present application is shown; the character image 630 is cropped to obtain three sub-images: a first sub-image 632 , a second sub-image 634 and a third sub-image 636 .

[0260] The first sub-image 632 is the image between the first starting cropping line 632a and the first ending cropping line 632b in the character image 630; it can be understood that the distance between the first starting cropping line 632a and the first ending cropping line 632b is a, where a is the first length; the direction from the first starting cropping line 632a to the first ending cropping line 632b is from left to right, which is the same as the character arrangement direction.

[0261] Step 514: determining the image between the mth starting cropping line and the mth ending cropping line in the character image as the mth sub-image;

[0262] The distance between the mth starting cropping line and the m-1th ending cropping line is the second length, the direction from the m-1th ending cropping line to the mth starting cropping line is opposite to the character arrangement direction, and the direction from the mth starting cropping line to the mth ending cropping line is the same as the character arrangement direction.

[0263] Wherein, m is an integer greater than 1 and less than or equal to the number of images of at least two sub-images. When the distance between the mth starting cropping line and the end position of the character is less than the first length, the mth ending cropping line is located at the end position of the character in the character image.

[0264] Taking m equal to 2 as an example, combined with Figure 16 For explanation, the second sub-image 634 is the image between the second starting cropping line 634a and the second ending cropping line 634b in the character image 630; the second starting cropping line 634a is before the first ending cropping line 632b, that is, the direction from the first ending cropping line 632b to the second starting cropping line 634a is from right to left, which is opposite to the character arrangement direction.

[0265] It can be understood that the length of the overlapping area between the first sub-image 632 and the second sub-image 634 is b, that is, the distance between the second starting cropping line 634a and the first ending cropping line 632b is b, and b is the second length.

[0266] Optionally, the length of the second sub-image 634 is equal to the length of the first sub-image 632 .

[0267] It can be understood that, in one example, the character image is cropped into two sub-images, and the second end cropping line of the second sub-image is located at the end position of the character in the character image.

[0268] The third sub-image 636 is the image between the third starting cropping line 636a and the third ending cropping line 636b in the character image 630; the third starting cropping line 636a is before the second ending cropping line 634b, that is, the direction from the second ending cropping line 634b to the third starting cropping line 636a is from right to left, which is opposite to the character arrangement direction.

[0269] It can be understood that the length of the overlapping area between the second sub-image 634 and the third sub-image 636 is b, that is, the distance between the third starting cropping line 636a and the second ending cropping line 634b is b, and b is the second length.

[0270] To sum up, by setting the cropping line to crop the target image, the number of previously generated characters that the subsequent characters in the recognition information rely on is reduced, and the integrity of the output information obtained by recognition is ensured by fusing adjacent recognition information; the possibility of error accumulation of characters during the recognition process is reduced, and the recognition efficiency of character images is improved.

[0271] Next, the updates of the first and second lengths are introduced:

[0272] Figure 17 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 15 Based on the embodiment shown, step 562 and step 564 are further included:

[0273] Step 562: receiving modification information of the recognition result;

[0274] Exemplarily, the modification information of the recognition result indicates the modification of the recognition information. It is understood that the modification of the recognition information is generally performed by comparing the recognition result with the character image to correct the recognition result. In one implementation, the modification can be performed by an artificial neural network or by manual verification.

[0275] Step 564: updating the first length used by the next character image according to the modification information;

[0276] Exemplarily, the next character image and the character image are images from the same original image or the same file.

[0277] Exemplarily, the modification information includes at least one of the number of modifications to the recognition result, the number of modified characters, and the degree of difference between the modified characters. Exemplarily, if the number of modifications exceeds a first threshold, the first length used by the next character image is greater than the first length before the update; if the number of modified characters exceeds a second threshold, the first length used by the next character image is greater than the first length before the update; and if the degree of difference between the modified characters exceeds a third threshold, the first length used by the next character image is greater than the first length before the update.

[0278] To sum up, a connection is established between the first length of the sub-image and the modification information, and the first length is updated according to the modification information, which effectively balances the use of character semantic relationships and avoids error accumulation, thereby ensuring the accuracy of the recognition results of the next character image and improving the recognition efficiency of character images.

[0279] Figure 18 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 15 The embodiment shown further includes steps 566 and 568:

[0280] Step 566: Obtaining the processing time for fusing at least two pieces of identification information;

[0281] Exemplarily, the processing time of the fusion processing indicates the time to determine the character repetition of the tail character and the first character, and the time to perform fusion processing on at least two pieces of recognition information; for example, as the number of characters in the tail character and the first character increases, the complexity of the fusion processing increases.

[0282] Step 568: Update the second length used by the next character image according to the processing time;

[0283] Exemplarily, when the processing time exceeds the event threshold, indicating that the complexity of the fusion processing is high, the second length is shortened to reduce the number of tail characters and head characters.

[0284] To sum up, a connection is established between the second length of the sub-image and the processing time of the fusion processing, and the second length is updated according to the processing time of the fusion processing, which effectively balances the recognition speed and avoids error accumulation, thereby ensuring the accuracy of the recognition result of the next character image and improving the recognition efficiency of the character image.

[0285] Figure 19 A flowchart of a method for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The method can be executed by a computer device. Figure 4Based on the embodiment shown, step 502 is further included:

[0286] Step 502: cropping the original image according to the character arrangement direction in the original image to obtain at least one character image;

[0287] Exemplarily, the original image includes at least one row or column of characters perpendicular to the character arrangement direction.

[0288] Optionally, in the at least one character image obtained by cropping, characters are arranged in a row or a column.

[0289] Figure 20 A schematic diagram of an original image provided by an exemplary embodiment of the present application is shown.

[0290] By calling the character detection model 652, the original image 642 is cropped to obtain three character images: a first character image 642a, a second character image 642b and a third character image 642c. A row of characters is arranged in the character image.

[0291] Furthermore, the character recognition model 654 is called to perform autoregressive recognition on the three character images to obtain a recognition result 644 , which includes recognition results corresponding to the three character images.

[0292] To sum up, by cropping the original image, a character image that can be used for character recognition is obtained. By cropping the target image, the number of previously generated characters that are dependent on when generating subsequent characters in the recognition information is reduced; the possibility of error accumulation of characters during the recognition process is reduced, and the recognition efficiency of character images is improved.

[0293] Those skilled in the art will appreciate that the above embodiments may be implemented independently, or the above embodiments may be freely combined to form new embodiments to implement the character recognition method in a character image of the present application.

[0294] Figure 21 A block diagram of a device for character recognition in a character image provided by an exemplary embodiment of the present application is shown. The device includes:

[0295] a cropping module 810 configured to crop the character image to obtain at least two sub-images, wherein two adjacent sub-images of the at least two sub-images have an overlapping area, and the latter sub-image of the two adjacent sub-images is located behind the former sub-image in the character arrangement direction;

[0296] a recognition module 820 configured to perform autoregressive recognition processing on the at least two sub-images to obtain at least two pieces of recognition information, wherein the at least two pieces of recognition information respectively include recognition results of characters in corresponding sub-images in the at least two sub-images;

[0297] a determination module 830 configured to determine a tail character identified in the overlapping region of the preceding sub-image from among the two adjacent sub-images, and to determine a head character identified in the overlapping region of the following sub-image from among the two adjacent sub-images;

[0298] The processing module 840 is configured to perform fusion processing on the at least two pieces of recognition information based on whether there are repeated characters in the tail character and the head character, so as to obtain a recognition result of the character in the character image.

[0299] In an optional design of the embodiment, the processing module 840 is further configured to:

[0300] Based on whether there are repeated characters between the tail character and the head character, at least one of the preceding identification information and the following identification information is trimmed to obtain trimmed preceding identification information and trimmed following identification information;

[0301] splicing the trimmed front recognition information and the trimmed back recognition information to obtain a recognition result of the character in the character image;

[0302] The preceding identification information is identification information corresponding to the preceding sub-image, and the following identification information is identification information corresponding to the following sub-image.

[0303] In an optional design of the embodiment, the processing module 840 is further configured to:

[0304] In the case where there is a repeated character between the tail character and the head character, determining the first sub-information as the trimmed preceding identification information, and determining the second sub-information as the trimmed following identification information;

[0305] The first sub-information includes the character before the repeated character and the repeated character in the previous recognition information, and the second sub-information includes the character after the repeated character in the subsequent recognition information.

[0306] In an optional design of the embodiment, the processing module 840 is further configured to:

[0307] If there is no repeated character between the tail character and the head character, determining the third sub-information as the trimmed preceding identification information, and determining the fourth sub-information as the trimmed following identification information;

[0308] The third sub-information includes the characters in the preceding identification information excluding the tail character, and the fourth sub-information includes all the characters in the following identification information;

[0309] or, if there is no repeated character between the tail character and the head character, determining the fifth sub-information as the trimmed preceding identification information, and determining the sixth sub-information as the trimmed following identification information;

[0310] The fifth sub-information includes all characters in the preceding identification information, and the sixth sub-information includes characters in the following identification information excluding the first character.

[0311] In an optional design of the embodiment, the processing module 840 is further configured to:

[0312] Sequentially splicing the trimmed front recognition information and the trimmed back recognition information according to the arrangement order of the at least two recognition information to obtain a recognition result of the character in the character image;

[0313] Alternatively, the trimmed preceding recognition information and the trimmed following recognition information are integrally spliced ​​according to the arrangement order of the at least two pieces of recognition information to obtain a recognition result of the character in the character image;

[0314] Alternatively, the trimmed front recognition information and the trimmed back recognition information are grouped and spliced ​​according to the arrangement order of the at least two recognition information to obtain at least two group splicing results; the at least two group splicing results are merged and spliced ​​according to the arrangement order to obtain the recognition result of the character in the character image.

[0315] In an optional design of the embodiment, the processing module 840 is further configured to:

[0316] In the case where the tail character is a blank character, the preceding recognition information and the following recognition information are concatenated to obtain a recognition result of the character in the character image;

[0317] The empty character is used to indicate that there is no corresponding character in the previous sub-image in the overlapping area.

[0318] In an optional design of the embodiment, the identification module 820 is further configured to:

[0319] performing autoregressive recognition processing on the at least two sub-images to obtain the at least two pieces of recognition information and at least two attention map groups, wherein the i-th attention map group is used to indicate a position of a character of the i-th piece of recognition information in the at least two pieces of recognition information in the i-th sub-image, where i is a positive integer less than or equal to the number of images of the at least two sub-images;

[0320] The determining module 830 is further configured to:

[0321] The tail character and the head character are determined according to the previous attention map group corresponding to the previous sub-image in the at least two attention map groups, the previous recognition information and the subsequent recognition information corresponding to the two adjacent sub-images.

[0322] In an optional design of the embodiment, the determining module 830 is further configured to:

[0323] determining, in the previous recognition information, the tail character of the previous sub-image located in the overlapping area according to the previous attention map group;

[0324] The first t characters in the subsequent identification information are determined as the head characters, and t is the number of the tail characters.

[0325] In an optional design of the embodiment, the previous attention map group includes a attention maps, where a is the number of characters in the previous recognition information;

[0326] The determining module 830 is further configured to: determine a target attention map in the previous attention map group, wherein the target attention map is the first attention map in the previous attention map group that meets a target condition;

[0327] The first character corresponding to the target attention map and the character following the first character in the previous recognition information are determined as the tail character; wherein, the target condition includes that the position of the pixel point exceeding the target threshold in the attention map belongs to the area corresponding to the overlapping area in the attention map.

[0328] In an optional design of the embodiment, the identification module 820 is further configured to:

[0329] Dividing the at least two sub-images into at least one batch processing group, each of the batch processing group includes at least two sub-images;

[0330] Autoregressive recognition processing is performed on the at least one batch processing group to obtain at least one identification information group, where the at least one identification information group includes the at least two identification information.

[0331] In an optional design of the embodiment, the identification module 820 is further configured to:

[0332] performing encoding processing on the at least two sub-images to obtain at least two feature representations;

[0333] Autoregressive decoding is performed on the at least two feature representations to obtain the at least two pieces of identification information.

[0334] In an optional design of the embodiment, the cropping module 810 is further configured to:

[0335] determining an image between a first starting cropping line and a first ending cropping line in the character image as a first sub-image, wherein the first starting cropping line is located at a starting position of a character in the character image, a distance between the first starting cropping line and the first ending cropping line is a first length, and a direction from the first starting cropping line to the first ending cropping line is the same as a character arrangement direction;

[0336] Determine the image between the mth starting cropping line and the mth ending cropping line in the character image as the mth sub-image, the distance between the mth starting cropping line and the m-1th ending cropping line being the second length, the direction from the m-1th ending cropping line to the mth starting cropping line being opposite to the character arrangement direction, and the direction from the mth starting cropping line to the mth ending cropping line being the same as the character arrangement direction;

[0337] Wherein, m is an integer greater than 1 and less than or equal to the number of images of the at least two sub-images. When the distance between the mth starting cropping line and the end position of the character is less than the first length, the mth ending cropping line is located at the end position of the character in the character image.

[0338] In an optional design of the embodiment, the device further includes:

[0339] An acquisition module 850 is configured to receive modification information of the recognition result;

[0340] An updating module 860 is configured to update the first length used by the next character image according to the modification information;

[0341] The modification information includes at least one of the number of modifications to the recognition result, the number of modified characters, and the degree of difference between the modified characters.

[0342] In an optional design of the embodiment, the device further includes:

[0343] An acquisition module 850 is configured to acquire a processing time for fusing the at least two pieces of identification information;

[0344] The updating module 860 is configured to update the second length used by the next character image according to the processing time.

[0345] In an optional design of the embodiment, the cropping module 810 is further configured to:

[0346] The original image is cropped according to the character arrangement direction in the original image to obtain at least one character image, in which a row or a column of characters are arranged.

[0347] It should be noted that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0348] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method; the technical effects achieved by each module performing operations are the same as the technical effects in the embodiment of the method, and will not be elaborated here.

[0349] An embodiment of the present application also provides a computer device, which includes: a processor and a memory, wherein a computer program is stored in the memory; the processor is used to execute the computer program in the memory to implement the character recognition method in the character image provided by the above-mentioned method embodiments.

[0350] Optionally, the computer device is a server. For example, Figure 22 This is a structural block diagram of a server provided by an exemplary embodiment of the present application.

[0351] Typically, the server 2300 includes a processor 2301 and a memory 2302 .

[0352] The processor 2301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 2301 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 2301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 2301 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 2301 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0353] The memory 2302 may include one or more computer-readable storage media, which may be non-transitory. The memory 2302 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 2302 is used to store at least one instruction, which is used to be executed by the processor 2301 to implement the character recognition method in the character image provided by the method embodiment of the present application.

[0354] In some embodiments, the server 2300 may further optionally include an input interface 2303 and an output interface 2304. The processor 2301, the memory 2302, and the input interface 2303 and the output interface 2304 may be connected via a bus or signal lines. Each peripheral device may be connected to the input interface 2303 and the output interface 2304 via a bus, a signal line, or a circuit board. The input interface 2303 and the output interface 2304 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 2301 and the memory 2302. In some embodiments, the processor 2301, the memory 2302, and the input interface 2303 and the output interface 2304 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2301, the memory 2302, the input interface 2303, and the output interface 2304 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.

[0355] Those skilled in the art will understand that the structure shown above does not constitute a limitation on the server 2300, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0356] In an exemplary embodiment, a chip is also provided, which includes a programmable logic circuit and / or program instructions. When the chip is run on a computer device, it is used to implement the character recognition method in the character image described in the above aspects.

[0357] In an exemplary embodiment, a computer program product is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, reads the computer instructions from the computer-readable storage medium, and executes the computer instructions to implement the character recognition method in a character image provided by each of the above method embodiments.

[0358] In an exemplary embodiment, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the character recognition method in a character image provided by each of the above method embodiments.

[0359] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0360] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0361] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for character recognition in a character image, characterized in that: The method comprises: performing cropping processing on the character image to obtain at least two sub-images, wherein there is an overlapping area between two adjacent sub-images of the at least two sub-images, and the latter sub-image of the two adjacent sub-images is located behind the former sub-image in the character arrangement direction; performing autoregressive recognition processing on the at least two sub-images to obtain the at least two pieces of identification information and at least two attention map groups, wherein the i-th attention map group is used to indicate positions of characters of the i-th identification information in the at least two pieces of identification information in the i-th sub-image, the number of attention maps included in the i-th attention map group is the number of characters of the i-th identification information, and i is a positive integer less than or equal to the number of images of the at least two sub-images; determining a tail character and a head character according to a preceding attention map group corresponding to the preceding sub-image in the at least two attention map groups, preceding recognition information and following recognition information corresponding to the two adjacent sub-images; If there are no repeated characters between the tail character and the head character, and the clarity of the character image does not exceed a clarity threshold, trimming the preceding recognition information and the following recognition information, determining the fifth sub-information as the trimmed preceding recognition information, and determining the sixth sub-information as the trimmed following recognition information; wherein the fifth sub-information includes all characters in the preceding recognition information, and the sixth sub-information includes characters in the following recognition information excluding the head character; splicing the trimmed front recognition information and the trimmed back recognition information to obtain a recognition result of the character in the character image; The preceding identification information is identification information corresponding to the preceding sub-image, and the following identification information is identification information corresponding to the following sub-image.

2. The method according to claim 1, characterized in that The method further comprises: In the case where there is a repeated character between the tail character and the head character, determining the first sub-information as the trimmed preceding identification information, and determining the second sub-information as the trimmed following identification information; The first sub-information includes the character before the repeated character and the repeated character in the previous recognition information, and the second sub-information includes the character after the repeated character in the subsequent recognition information.

3. The method according to claim 1, characterized in that The method further comprises: If there is no repeated character between the tail character and the head character, determining the third sub-information as the trimmed preceding identification information, and determining the fourth sub-information as the trimmed following identification information; The third sub-information includes the characters in the preceding identification information excluding the tail character, and the fourth sub-information includes all the characters in the following identification information.

4. The method according to claim 1, wherein The step of splicing the trimmed front recognition information and the trimmed back recognition information to obtain a recognition result of the character in the character image includes: Sequentially splicing the trimmed front recognition information and the trimmed back recognition information according to the arrangement order of the at least two recognition information to obtain a recognition result of the character in the character image; or, The trimmed front recognition information and the trimmed back recognition information are integrally spliced ​​according to the arrangement order of the at least two recognition information to obtain a recognition result of the character in the character image; or, The trimmed front recognition information and the trimmed back recognition information are grouped and spliced ​​according to the arrangement order of the at least two recognition information to obtain at least two group splicing results; the at least two group splicing results are merged and spliced ​​according to the arrangement order to obtain the recognition result of the character in the character image.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In the case where the tail character is a blank character, the preceding recognition information and the following recognition information are concatenated to obtain a recognition result of the character in the character image; The empty character is used to indicate that there is no corresponding character in the previous sub-image in the overlapping area.

6. The method according to any one of claims 1 to 4, characterized in that: The determining of the tail character and the head character according to the preceding attention map group corresponding to the preceding sub-image in the at least two attention map groups, the preceding recognition information and the following recognition information corresponding to the two adjacent sub-images, comprises: determining, in the previous recognition information, the tail character of the previous sub-image located in the overlapping area according to the previous attention map group; The first t characters in the subsequent identification information are determined as the head characters, and t is the number of the tail characters.

7. The method according to claim 6, characterized in that The previous attention map group includes a attention maps, where a is the number of characters in the previous recognition information; The step of determining, in the previous recognition information, the tail character of the previous sub-image located in the overlapping area according to the previous attention map group comprises: Determining a target attention map in the group of previous attention maps, wherein the target attention map is the first attention map in the group of previous attention maps that meets a target condition; Determine the first character corresponding to the target attention map and the character following the first character in the previous recognition information as the tail character; The target condition includes that the position of the pixel point exceeding the target threshold in the attention map belongs to the area corresponding to the overlapping area in the attention map.

8. The method according to any one of claims 1 to 4, characterized in that: The performing autoregressive recognition processing on the at least two sub-images to obtain at least two pieces of recognition information includes: Dividing the at least two sub-images into at least one batch processing group, each of the batch processing group includes at least two sub-images; Autoregressive recognition processing is performed on the at least one batch processing group to obtain at least one identification information group, where the at least one identification information group includes the at least two identification information.

9. The method according to any one of claims 1 to 4, characterized in that: The performing autoregressive recognition processing on the at least two sub-images to obtain at least two pieces of recognition information includes: performing encoding processing on the at least two sub-images to obtain at least two feature representations; Autoregressive decoding is performed on the at least two feature representations to obtain the at least two pieces of identification information.

10. The method according to any one of claims 1 to 4, characterized in that: The step of cropping the character image to obtain at least two sub-images includes: determining an image between a first starting cropping line and a first ending cropping line in the character image as a first sub-image, wherein the first starting cropping line is located at a starting position of a character in the character image, a distance between the first starting cropping line and the first ending cropping line is a first length, and a direction from the first starting cropping line to the first ending cropping line is the same as a character arrangement direction; Determine an image between an mth starting cropping line and an mth ending cropping line in the character image as an mth sub-image, wherein a distance between the mth starting cropping line and an m-1th ending cropping line is a second length, a direction from the m-1th ending cropping line to the mth starting cropping line is opposite to a direction in which the characters are arranged, and a direction from the mth starting cropping line to the mth ending cropping line is the same as a direction in which the characters are arranged; Wherein, m is an integer greater than 1 and less than or equal to the number of images of the at least two sub-images. When the distance between the mth starting cropping line and the end position of the character is less than the first length, the mth ending cropping line is located at the end position of the character in the character image.

11. The method according to claim 10, characterized in that The method further comprises: receiving modification information of the recognition result; updating the first length used by the next character image according to the modification information; The modification information includes at least one of the number of modifications to the recognition result, the number of modified characters, and the degree of difference between the modified characters.

12. The method according to claim 10, characterized in that The method further comprises: Obtaining a processing time for fusing the at least two pieces of identification information; The second length used by the next character image is updated according to the processing time.

13. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The original image is cropped according to the character arrangement direction in the original image to obtain at least one character image, in which a row or a column of characters are arranged.

14. A device for character recognition in a character image, characterized in that: The device comprises: a cropping module configured to crop the character image to obtain at least two sub-images, wherein there is an overlapping area between two adjacent sub-images of the at least two sub-images, and the latter sub-image of the two adjacent sub-images is located behind the former sub-image in the character arrangement direction; a recognition module, configured to perform autoregressive recognition processing on the at least two sub-images to obtain the at least two pieces of recognition information and at least two attention map groups, wherein the i-th attention map group is configured to indicate positions of characters of the i-th recognition information in the at least two pieces of recognition information in the i-th sub-image, the number of attention maps included in the i-th attention map group being the number of characters of the i-th recognition information, and i being a positive integer less than or equal to the number of images of the at least two sub-images; a determination module, configured to determine a tail character and a head character according to a preceding attention map group corresponding to the preceding sub-image in the at least two attention map groups, and preceding recognition information and following recognition information corresponding to the two adjacent sub-images; a processing module configured to, if there are no repeated characters between the tail character and the head character and the clarity of the character image does not exceed a clarity threshold, perform trimming processing on the preceding recognition information and the following recognition information, determine the fifth sub-information as the trimmed preceding recognition information, and determine the sixth sub-information as the trimmed following recognition information; wherein the fifth sub-information includes all characters in the preceding recognition information, and the sixth sub-information includes characters in the following recognition information excluding the head character; splicing the trimmed front recognition information and the trimmed back recognition information to obtain a recognition result of the character in the character image; The preceding identification information is identification information corresponding to the preceding sub-image, and the following identification information is identification information corresponding to the following sub-image.

15. A computer device, characterized in that: The computer device includes: a processor and a memory, wherein the memory stores at least one program; the processor is used to execute the at least one program in the memory to implement the character recognition method in the character image described in any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that The readable storage medium stores executable instructions, which are loaded and executed by a processor to implement the character recognition method in a character image described in any one of claims 1 to 13.

17. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor reads and executes the computer instructions from the computer-readable storage medium to implement the character recognition method in a character image described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • Digital picture recognizing method and device and crawler server

    CN102385707A

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

    CN113903036A

  • Adaptive sliding windows for text recognition

    US9501708B1