An OCR labeling method, device, equipment and storage medium

By drawing the target coordinates of curved strings in OCR and receiving the labeled strings, the problem of recognizing curved strings is solved, improving the accuracy of labeling and the effect of model training.

CN116012852BActive Publication Date: 2026-07-10SUZHOU MEGAROBO TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU MEGAROBO TECH CO LTD
Filing Date
2022-12-16
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively recognize curved strings, increasing the difficulty for OCR recognition devices.

Method used

By receiving the target labeled image, the system draws a preset number of target coordinate points for each character of the string, generates multiple target coordinate point information, and receives the labeled string to determine the target coordinate point information corresponding to each labeled character as the OCR labeling result.

Benefits of technology

This approach enables effective annotation of curved strings, improves annotation accuracy, and provides accurate training samples for subsequent training of curved character recognition models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012852B_ABST
    Figure CN116012852B_ABST
Patent Text Reader

Abstract

The application discloses an OCR labeling method and device, equipment and a storage medium. The method comprises the following steps: receiving a target labeling image, responding to the operation of drawing a preset number of target coordinate points for each character of a string on the target labeling image, obtaining a plurality of target coordinate point information, receiving an input labeling string corresponding to the string, determining the target coordinate point information corresponding to each labeling character of the labeling string as an OCR labeling result according to the plurality of target coordinate point information and the labeling string. Wherein, by drawing target coordinate points for each character in the string, then responding to obtain a plurality of target coordinate point information, determining the OCR labeling result according to the received labeling string and the target coordinate point information, effective labeling of the curved string is realized, and because the coordinate point drawing is performed for each character, the character form can be better met, the accuracy of labeling is ensured, and accurate training samples are provided for subsequent model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of OCR technology, and in particular to an OCR annotation method, apparatus, device and storage medium. Background Technology

[0002] With the development of science and technology, OCR (Optical Character Recognition) technology has gradually become one of the popular technologies for extracting character content from image files or paper documents, as people need to extract character content from them.

[0003] In existing technologies, taking characters on paper documents as an example, optical methods are generally used to convert the paper document into a black-and-white dot matrix image file, and then recognition software converts the text in the image into text format. However, because some paper documents may design normal strings as curved strings for aesthetic purposes, this greatly increases the difficulty for OCR recognition devices to recognize characters in curved strings.

[0004] Therefore, how to achieve character recognition of curved strings is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] To address the aforementioned issues, this application provides an OCR annotation method, apparatus, device, and storage medium to enable character recognition of curved strings.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] In a first aspect, embodiments of this application provide an OCR annotation method, the method comprising:

[0008] Receive the target labeled image;

[0009] In response to the operation of drawing a preset number of target coordinate points for each character of the string on the target labeled image, multiple target coordinate point information is obtained;

[0010] Receive the input annotation string corresponding to the string;

[0011] Based on the multiple target coordinate point information and the annotation string, the target coordinate point information corresponding to each annotation character in the annotation string is determined as the OCR annotation result.

[0012] Optionally, determining the target coordinate point information corresponding to each annotation character in the annotation string includes:

[0013] Determine the first number of the annotation characters in the annotation string based on the annotation string;

[0014] Determine whether the total number of target coordinate points in the plurality of target coordinate point information is a multiple of the preset number of the first number;

[0015] If so, then determine the target coordinate point information corresponding to each annotation character in the annotation string.

[0016] Optionally, the response involves drawing a preset number of target coordinate points for each character of the string on the target-annotated image, resulting in multiple target coordinate point information, including:

[0017] The response performs the first operation of drawing the target coordinate point for each character in the string according to the character order, thereby obtaining multiple target coordinate point information with an ordered relationship;

[0018] Determining the target coordinate point information corresponding to each annotation character in the annotation string includes:

[0019] Based on the sequential relationship among the multiple target coordinate point information with sequential relationship and the order of the annotation characters in the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string.

[0020] Optionally, the response involves drawing a preset number of target coordinate points for each character of the string on the target-annotated image, resulting in multiple target coordinate point information, including:

[0021] The response involves drawing a preset number of target coordinate points for each character in the string and connecting the target coordinate points in a clockwise or counterclockwise direction according to the character order in the string, thereby obtaining multiple target coordinate point information with a sequential relationship.

[0022] Determining the target coordinate point information corresponding to each annotation character in the annotation string includes:

[0023] Based on the sequential relationship among multiple target coordinate point information with an ordered relationship and the order of the annotation characters in the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string.

[0024] Optionally, the second operation includes:

[0025] While drawing target coordinate points for each character in the string according to the character order, connect the target coordinate points along the clockwise or counterclockwise direction of the string.

[0026] Optionally, the second operation includes:

[0027] The first sub-operation involves drawing a preset number of target coordinate points for each character in the string, and the second sub-operation involves connecting all target coordinate points in clockwise or counterclockwise order according to the character order in the string.

[0028] Optionally, the method further includes:

[0029] In response to the second operation, an input interface for the labeled string is generated; the second operation is to draw a preset number of target coordinate points for each character in the string and to connect the target coordinate points in a clockwise or counterclockwise direction to form a closed shape according to the character order in the string.

[0030] Correspondingly, the received input annotation string corresponding to the string includes:

[0031] The annotation string corresponding to the string is received from the input interface.

[0032] Optionally, it also includes:

[0033] In response to the third operation, an input interface for the labeled string is generated;

[0034] Correspondingly, the received input annotation string corresponding to the string includes:

[0035] The annotation string corresponding to the string is received from the input interface.

[0036] Optionally, the method further includes: sending a quantity error message if the target total quantity is not a multiple of the preset quantity of the character quantity.

[0037] Optionally, the preset quantity is greater than or equal to 4.

[0038] Optionally, when the preset number is 4, the 4 target coordinate points corresponding to each character are the 4 vertices of the circumscribed quadrilateral corresponding to the character.

[0039] Secondly, embodiments of this application provide an OCR annotation device, the device comprising: a receiving module, a target coordinate point information generation module, an annotation string receiving module, and an annotation module;

[0040] The receiving module is used to receive the target labeled image;

[0041] The target coordinate point information generation module is used to respond to the operation of drawing a preset number of target coordinate points for each character of the string on the target labeled image, and to obtain multiple target coordinate point information;

[0042] The annotation string receiving module is used to receive the input annotation string corresponding to the string;

[0043] The annotation module is used to determine the target coordinate point information corresponding to each annotation character in the annotation string based on the multiple target coordinate point information and the annotation string, and use it as the annotation result of OCR.

[0044] Thirdly, embodiments of this application provide a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the OCR annotation method as described in the first aspect.

[0045] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the OCR annotation method as described in the first aspect.

[0046] Compared to existing technologies, this application has the following advantages: This application receives a target-annotated image, responds to the operation of drawing a preset number of target coordinate points for each character of the string on the target-annotated image, obtains multiple target coordinate point information, receives the input annotation string corresponding to the string, and determines the target coordinate point information corresponding to each annotation character of the annotation string based on the multiple target coordinate point information and the annotation string, as the OCR annotation result. Specifically, by drawing target coordinate points for each character in the string, and then responding to obtain multiple target coordinate point information, and further determining the OCR annotation result based on the received annotation string and target coordinate point information, effective annotation of curved strings is achieved. Furthermore, since a preset number of coordinate points are drawn for each character, it better conforms to the shape of the character, thus ensuring the accuracy of the annotation and providing accurate training samples for subsequent model training. Therefore, it is beneficial for training curved character recognition models. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 A flowchart illustrating an OCR annotation method provided in this application embodiment;

[0049] Figure 2This is a schematic diagram of step S102 provided in the embodiments of this application;

[0050] Figure 3 This is an operational diagram illustrating another step S102 provided in an embodiment of this application;

[0051] Figure 4 A schematic diagram illustrating a method for annotating overlapping strings provided in an embodiment of this application;

[0052] Figure 5 This is a schematic diagram of the structure of an OCR annotation device provided in an embodiment of this application. Detailed Implementation

[0053] As described earlier, research on OCR character recognition has revealed that, in existing technologies, taking characters on paper documents as an example, the paper document is generally converted into a black-and-white dot matrix image file using optical methods, and then the text in the image is converted into text format by recognition software. However, because some paper documents may design normal strings as curved strings for aesthetic purposes, this greatly increases the difficulty for OCR recognition devices to recognize characters in curved strings.

[0054] To address the aforementioned problems, embodiments of this application provide an OCR annotation method, apparatus, device, and storage medium. The method includes: receiving a target annotation image; responding to an operation of drawing a preset number of target coordinate points for each character of a string on the target annotation image to obtain multiple target coordinate point information; receiving an input annotation string corresponding to the string; and determining the target coordinate point information corresponding to each annotation character of the annotation string based on the multiple target coordinate point information and the annotation string, as the OCR annotation result.

[0055] In this way, by drawing target coordinate points for each character in the string and then receiving multiple target coordinate point information, the OCR annotation result is determined based on the received labeled string and target coordinate point information. This achieves effective annotation of curved strings. Furthermore, because a preset number of coordinate points are drawn for each character, it better conforms to the character's shape, thus ensuring annotation accuracy and providing accurate training samples for subsequent model training. Therefore, it is beneficial for training curved character recognition models. Although this patent focuses on solving the annotation of curved strings, it is equally applicable to the annotation of ordinary strings.

[0056] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0057] See Figure 1 The figure is a flowchart of an OCR annotation method provided in an embodiment of this application.

[0058] Combination Figure 1 As shown, the OCR annotation method provided in this application embodiment may include:

[0059] S101: Receive the target labeled image.

[0060] A target labeled image refers to an image that needs to be labeled, wherein the target labeled image may include at least one string, which may be text and / or letters and / or symbols, and the string has at least one character.

[0061] S102: In response to the operation of drawing a preset number of target coordinate points for each character of the string on the target labeled image, multiple target coordinate point information are obtained.

[0062] In this context, if a Cartesian coordinate system is established on the plane where the target labeled image is located, then the target coordinate point information refers to the coordinate information under the Cartesian coordinate system.

[0063] In practical applications, annotators can manually move to the desired position and click to generate the target coordinate point. Therefore, by responding to the manual click action, the click location is determined, thereby obtaining the target coordinate point information.

[0064] The preset quantity refers to the number of target coordinate points set in advance. The preset quantity is greater than or equal to four, for example, it can be 4, 5, 6, 8, etc. There is no specific limitation on the value of the preset quantity; it is determined based on the actual situation. It is understandable that a larger preset quantity, while providing the best representation of the character's shape, increases the workload for the annotation personnel.

[0065] Therefore, in order to achieve a better balance between the two, as an optional implementation method, the preset number is preferably 4. More specifically, the 4 target coordinate points corresponding to each character are the 4 vertices of the circumscribed quadrilateral corresponding to the character.

[0066] When the preset quantity is 4, the four vertices of the circumscribed quadrilateral corresponding to the character are used as the target coordinate points. This ensures that the character can be completely labeled without any missing parts of the character, thus guaranteeing the integrity of the labeled string.

[0067] Of course, in practical applications, the four target coordinate points do not have to be labeled according to the four vertices of the circumscribed quadrilateral corresponding to the character. For example, they can be as close to the character as possible according to its shape, thus limiting the shape of the character to the greatest extent.

[0068] It should be noted that by setting the preset number of each character to 4 or more, the shape of the character can be better matched, thus ensuring the accuracy of the annotation and providing accurate training samples for subsequent model training. Therefore, this is beneficial for training the curved character recognition model.

[0069] In step S102, by obtaining the target coordinate point information corresponding to each target coordinate point, the position of the string on the target annotation image and the outline of the string can be determined.

[0070] S103: Receive the input annotation string corresponding to the string.

[0071] The annotation string refers to the information of the string to be annotated on the target annotation image, which is confirmed by the user.

[0072] It should be noted that the specific content and number of characters of the string on the target labeled image can be determined by the labeled string.

[0073] S104: Based on the multiple target coordinate point information and the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string, and use it as the annotation result of OCR.

[0074] The position of the string on the target labeled image can be determined by using the coordinate information of multiple target points. Then, the content and number of characters of the string on the target labeled image can be determined by using the labeled string, thereby completing the labeling of the target labeled image.

[0075] In this embodiment, by receiving a target-annotated image, responding to an operation of drawing a preset number of target coordinate points for each character of the string on the target-annotated image, multiple target coordinate point information is obtained. Then, an input annotation string corresponding to the string is received. Based on the multiple target coordinate point information and the annotation string, the target coordinate point information corresponding to each annotated character of the annotation string is determined as the OCR annotation result. Specifically, by drawing target coordinate points for each character in the string, then responding to obtain multiple target coordinate point information, and further determining the OCR annotation result based on the received annotation string and target coordinate point information, effective annotation of curved strings is achieved. Furthermore, since the annotation is performed on a preset number of target coordinate points for each character, it better conforms to the shape of the character, thus ensuring the accuracy of the annotation and providing accurate training samples for subsequent model training. Therefore, it is beneficial for training the curved character recognition model.

[0076] Based on the OCR annotation method provided in the above embodiments, in order to further ensure the correctness of OCR annotation, as an implementable method, step S104 specifically includes:

[0077] Step 1: Determine the first number of the annotation characters in the annotation string based on the annotation string.

[0078] Step 2: Determine whether the total number of target coordinate points in the multiple target coordinate point information is a multiple of the preset number of the first number.

[0079] Step 3: If yes, then determine the target coordinate point information corresponding to each annotation character in the annotation string.

[0080] It should be noted that the first quantity mentioned in step 1 refers to the number of characters in the string on the target labeled image, that is, the number of characters in the labeled string.

[0081] It should be noted that in steps 1 to 3, by determining the number of characters in the labeled string, it is determined whether the target coordinate points are a multiple of the number of characters. This avoids situations where some characters in the string are not labeled during the labeling process, and also avoids situations where some characters are not labeled with the predetermined number of target coordinate points. For example, assuming the string has 5 characters and each character needs to be labeled with 4 target coordinate points, then the total number of target coordinate points should be 20. If the number of target coordinate points is 19, then there may be a character that is not labeled with one target coordinate point; if the number of target coordinate points is 16, then there may be a character that is not labeled.

[0082] It should be noted that the serial numbers in steps 1 to 3 above are only used to distinguish different steps or to distinguish the temporal relationship between different steps, and are not shown in the attached figures.

[0083] Based on the OCR annotation method provided in the above embodiments, the method may further include:

[0084] If the target total number is not a multiple of the preset number of characters, a quantity error message is sent.

[0085] By sending a quantity error message, users can redraw missing characters or coordinate points, avoiding errors in the number of target coordinate points and ensuring the correctness of the target coordinate point drawing.

[0086] Based on the OCR annotation method provided in the above embodiments, to further illustrate the process of determining target coordinate point information, this application embodiment provides a specific process for step S102, see [link to relevant documentation]. Figure 2 This figure is a schematic diagram of step S102 provided in the embodiment of this application, combined with Figure 2 As shown, step S102 may specifically include:

[0087] The response performs the first operation of drawing the target coordinate point for each character in the string according to the character order, thereby obtaining multiple target coordinate point information with an ordered relationship;

[0088] Determining the target coordinate point information corresponding to each annotation character in the annotation string includes:

[0089] Based on the sequential relationship among the multiple target coordinate point information with sequential relationship and the order of the annotation characters in the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string.

[0090] Based on this embodiment and Figure 2 Further Figure 2 For example, in Figure 2 The file contains two strings, "NICE" and "ABCD", both of which are curved. See also... Figure 2 The string "NICE" in the example is labeled with four target coordinate points for each letter according to the character order (N, I, C, E) in this embodiment. Similarly, the string is labeled from left to right, with four target coordinate points labeled for each letter. The final labeling result is... Figure 2 In the diagram, "ABCD" is used, and the black circles surrounding "NICE" and "ABCD" represent the marked target coordinate points. Therefore, based on these target coordinate points, the corresponding target coordinate information can be obtained.

[0091] It should be noted that, in this embodiment, the target coordinate points of all characters are drawn in the character order of the string, and then multiple target coordinate point information with an order relationship is obtained, and each character is drawn to avoid the problem of character omission.

[0092] It should be noted that the character order means the writing order or the reading order of the string. For example, taking "peace and happiness" as an example, if it appears on the target annotation image in the current order, and the writing and reading orders are both "peace and happiness", then the character order is peace, happiness, luck, and fortune; if it is "fortune, luck, peace, and happiness" on the target annotation image, then the character order can be defaulted to fortune, luck, peace, and happiness. If the order of the annotation string is "peace and happiness", then the character order is peace, happiness, luck, and fortune. The specific character order can be determined according to the actual scenario and is not specifically limited here.

[0093] It should be noted that the first operation can be a click operation by the user on the target annotation image.

[0094] It should be noted that through the character order of the string and all the target coordinate point information corresponding to the string determined according to the string order, the target coordinate information of each character can be determined, which is beneficial to determining the correspondence between the target coordinate points and the characters, avoiding errors in the target coordinate information, and improving the accuracy of OCR annotation.

[0095] Based on the OCR annotation method provided in the above embodiment, in order to further illustrate the determination process of the target coordinate point information, the embodiment of the present application also provides another specific process of step S102, see Figure 3 , which is an operation schematic diagram of another step S102 provided by the embodiment of the present application. Combining Figure 2 as shown, step S102 may specifically include:

[0096] Responding to the second operation of drawing a preset number of target coordinate points for each character in the string and connecting the target coordinate points in a clockwise or counterclockwise direction according to the character order in the string, to obtain multiple target coordinate point information with an order relationship;

[0097] Determining the target coordinate point information corresponding to each annotation character of the annotation string includes: [[ID=​​​It should be noted that in this embodiment, the target coordinate points are drawn sequentially according to the character order of the string, either clockwise or counterclockwise, to obtain the overall drawing result of the target string. Then, the target coordinate information of each character is determined based on the drawing result and the character order of the string.

[0100] It should be noted that, in one feasible implementation, the second operation includes:

[0101] While drawing target coordinate points for each character in the string according to the character order, connect the target coordinate points along the clockwise or counterclockwise direction of the string.

[0102] It should be noted that in this implementation, it is possible to draw coordinate points and connect them simultaneously, which makes the operation simple and feasible for the annotators.

[0103] It should be noted that, in one feasible implementation, the second operation includes:

[0104] The first sub-operation involves drawing a preset number of target coordinate points for each character in the string, and the second sub-operation involves connecting all target coordinate points in clockwise or counterclockwise order according to the character order in the string.

[0105] Based on this embodiment and Figure 3 For example, in Figure 3 Given two strings, "NICE" and "ABCD", the method in this embodiment first uses a first sub-operation to draw a preset number of target coordinate points for each character. Then, a second sub-operation connects the current target coordinate point to the previous target coordinate point along the perimeter of the string in a counter-clockwise or clockwise order, finally forming a closed shape. Figure 3 The "NICE" in the string is created by marking four target coordinates for each character in the string according to the character order (N, I, C, E), and then connecting these target coordinates sequentially in a clockwise order, resulting in a string like this. Figure 3 The closed figure “ABCD” shown represents the target string on the target labeled image.

[0106] In this example, the second operation includes: first drawing the target coordinates of all characters based on the first sub-operation of the click operation (it is not limited to drawing one character before drawing the next character, and the characters can be drawn in any order, as long as the preset number of target coordinates are drawn for all characters), and then connecting the characters according to the clockwise or counterclockwise order described above based on the second sub-operation of the connection operation.

[0107] It should be noted that the lines connecting the target coordinate points along the clockwise or counterclockwise direction do not need to form a closed shape, as long as all target coordinate points are connected. In this scenario, you can click on the user-designed control to confirm, or use other methods to confirm.

[0108] It should be noted that, in one feasible implementation, the method may further include:

[0109] In response to the second operation, an input interface for the labeled string is generated; the second operation may be to draw a preset number of target coordinate points for each character in the string and to connect the target coordinate points in a clockwise or counterclockwise direction to form a closed shape according to the character order in the string.

[0110] Correspondingly, the received input annotation string corresponding to the string includes:

[0111] The annotation string corresponding to the string is received from the input interface.

[0112] In this scheme, the second operation is preferably to draw the target coordinate point for each character in the string according to the character order, and at the same time connect the target coordinate points along the clockwise or counterclockwise direction of the string to form a closed figure. This can integrate the annotation operation and the confirmation operation into one set of operations, which makes it easier for the annotator to use.

[0113] Based on the OCR annotation method provided in the above embodiments, in one feasible implementation, the OCR annotation method may further include:

[0114] In response to the third operation, an input interface for the labeled string is generated;

[0115] Correspondingly, the received input annotation string corresponding to the string includes:

[0116] The annotation string corresponding to the string is received from the input interface.

[0117] The third operation can be a determination operation on the control; or it can be a connection operation on all target coordinate points (which can be closed or open, can be clockwise or counterclockwise, or can be in any order, as long as all target points are connected).

[0118] Based on the OCR annotation method provided in the above embodiments, this application also provides an annotation method based on overlapping strings, see [link to relevant documentation]. Figure 4 , Figure 4Schematic diagram of a method for annotating overlapping strings provided by an embodiment of the present application. In combination with Figure 4 As shown, the method for annotating overlapping strings provided by an embodiment of the present application preferably includes:

[0119] First, receive a target annotation image, which contains a string of four characters "peace and joy", and is an overlapping string. Specifically, see Figure 4 .

[0120] Second, set the preset number of target coordinate points to 4, and then annotate the target coordinate points for "peace and joy" in the clockwise direction in the order of "ping, an, xi, le". There are a total of 16 target coordinate points. And while drawing the coordinate points, connect the coordinate points. Finally, a closed figure as shown in Figure 4 is obtained. The interior of the closed figure is the target string on the target annotation image, and the drawing operation is completed at the same time.

[0121] Third, pop up a user input interface box, and the user inputs "peace and joy";

[0122] Then, determine the coordinate point information corresponding to each character according to the coordinate point information of the 16 target coordinate points and the annotation string input by the user, and generate the annotation result of OCR.

[0123] Based on this embodiment, it can be seen that when the string on the target annotation image is a string with overlapping characters, this method can still be used to annotate the target annotation image, with high applicability, and can avoid the problem of unable to annotate or inaccurate annotation caused by character overlap.

[0124] Based on the OCR annotation method provided in the above embodiment, an embodiment of the present application further provides an OCR annotation device. See Figure 5 , this figure is a schematic structural diagram of an OCR annotation device provided by an embodiment of the present application. In combination with Figure 5 As shown, the OCR annotation device 500 provided by an embodiment of the present application may include: a receiving module 501, a target coordinate point information generating module 502, an annotation string receiving module 503, and an annotation module 504;

[0125] The receiving module 501 is configured to receive a target annotation image;

[0126] The target coordinate point information generating module 502 is configured to obtain a plurality of target coordinate point information in response to an operation of drawing a preset number of target coordinate points for each character of the string on the target annotation image;

[0127] The annotation string receiving module 503 is configured to receive an input annotation string corresponding to the string;

[0128] The annotation module 504 is used to determine the target coordinate point information corresponding to each annotation character in the annotation string based on the multiple target coordinate point information and the annotation string, and use it as the annotation result of OCR.

[0129] As an example, determining the target coordinate point information corresponding to each annotation character in the annotation string includes:

[0130] Determine the first number of the annotation characters in the annotation string based on the annotation string;

[0131] Determine whether the total number of target coordinate points in the plurality of target coordinate point information is a multiple of the preset number of the first number;

[0132] If so, then determine the target coordinate point information corresponding to each annotation character in the annotation string.

[0133] As an example, the target coordinate point information generation module 502 includes:

[0134] The first operation response module is used to respond to the first operation of drawing the target coordinate point for each character in the string according to the character order, so as to obtain multiple target coordinate point information with sequential relationship;

[0135] The first target coordinate point information generation submodule is used to determine the target coordinate point information corresponding to each annotation character in the annotation string according to the order relationship among the multiple target coordinate point information with an order relationship and the order of the annotation characters in the annotation string.

[0136] As an example, the target coordinate point information generation module 502 includes:

[0137] The second response module is used to respond to the second operation of drawing a preset number of target coordinate points for each character in the string and connecting the target coordinate points in a clockwise or counterclockwise direction according to the character order in the string, so as to obtain multiple target coordinate point information with sequential relationship;

[0138] The second target coordinate point information generation submodule is used to determine the target coordinate point information corresponding to each annotation character in the annotation string according to the order relationship among multiple target coordinate point information with an ordered relationship and the order of the annotation characters in the annotation string.

[0139] As an example, the second operation includes:

[0140] While drawing target coordinate points for each character in the string according to the character order, connect the target coordinate points along the clockwise or counterclockwise direction of the string.

[0141] As an example, the second operation includes:

[0142] The first sub-operation involves drawing a preset number of target coordinate points for each character in the string, and the second sub-operation involves connecting all target coordinate points in clockwise or counterclockwise order according to the character order in the string.

[0143] As an example, the device further includes:

[0144] The second operation response submodule is used to respond to the second operation and generate the input interface of the labeled string; the second operation is to draw a preset number of target coordinate points for each character in the string and to connect the target coordinate points in a clockwise or counterclockwise direction to form a closed figure according to the character order in the string.

[0145] Correspondingly, the received input annotation string corresponding to the string includes:

[0146] The annotation string corresponding to the string is received from the input interface.

[0147] As an example, it also includes:

[0148] The third operation response module is used to respond to the third operation and generate the input interface for the labeled string;

[0149] Correspondingly, the received input annotation string corresponding to the string includes:

[0150] The annotation string corresponding to the string is received from the input interface.

[0151] As an example, the device further includes sending a quantity error message if the target total quantity is not a multiple of the preset quantity of the character quantity.

[0152] As an example, the preset quantity is greater than or equal to 4.

[0153] As an example, when the preset quantity is 4, the 4 target coordinate points corresponding to each character are the 4 vertices of the circumscribed quadrilateral corresponding to the character.

[0154] The OCR annotation device provided in this application embodiment has the same beneficial effects as the OCR annotation method provided in the above embodiments, so it will not be described again.

[0155] This application also provides corresponding devices and computer storage media for implementing the solutions provided in this application.

[0156] The device includes a memory and a processor. The memory is used to store instructions or code, and the processor is used to execute the instructions or code to enable the device to perform the OCR annotation method described in any embodiment of this application.

[0157] The computer storage medium stores code, and when the code is run, the device running the code implements the OCR annotation method described in any embodiment of this application.

[0158] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and equipment embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0159] In the embodiments of this application, the terms "first" and "second" (if they exist) are used only as name identifiers and do not represent the order of first and second.

[0160] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus a general-purpose hardware platform. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0161] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An OCR annotation method, characterized in that, The method includes: Receive the target labeled image; In response to the operation of drawing a preset number of target coordinate points for each character of the string on the target labeled image, multiple target coordinate point information is obtained; the preset number of target coordinate points is used to limit the shape of the character; Receive the input annotation string corresponding to the string; the annotation string is information about the string to be annotated on the target annotation image confirmed by the user; Based on the multiple target coordinate point information and the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string, and use it as the annotation result of OCR; The response involves drawing a preset number of target coordinate points for each character of the string on the target-annotated image, resulting in multiple target coordinate point information, including: The response performs the first operation of drawing the target coordinate point for each character in the string according to the character order, thereby obtaining multiple target coordinate point information with an ordered relationship; Determining the target coordinate point information corresponding to each annotation character in the annotation string includes: Based on the sequential relationship among the multiple target coordinate point information with sequential relationship and the order of the annotation characters in the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string.

2. The OCR annotation method according to claim 1, characterized in that, Determining the target coordinate point information corresponding to each annotation character in the annotation string includes: Determine the first number of the annotation characters in the annotation string based on the annotation string; Determine whether the total number of target coordinate points in the plurality of target coordinate point information is a multiple of the preset number of the first number; If so, then determine the target coordinate point information corresponding to each annotation character in the annotation string.

3. The OCR annotation method according to claim 1, characterized in that, The response involves drawing a preset number of target coordinate points for each character of the string on the target-annotated image, resulting in multiple target coordinate point information, including: The response involves drawing a preset number of target coordinate points for each character in the string and connecting the target coordinate points in a clockwise or counterclockwise direction according to the character order in the string, thereby obtaining multiple target coordinate point information with a sequential relationship. Determining the target coordinate point information corresponding to each annotation character in the annotation string includes: Based on the sequential relationship among multiple target coordinate point information with an ordered relationship and the order of the annotation characters in the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string.

4. The OCR annotation method according to claim 3, characterized in that, The second operation includes: While drawing target coordinate points for each character in the string according to the character order, connect the target coordinate points along the clockwise or counterclockwise direction of the string.

5. The OCR annotation method according to claim 3, characterized in that, The second operation includes: The first sub-operation involves drawing a preset number of target coordinate points for each character in the string, and the second sub-operation involves connecting all target coordinate points in clockwise or counterclockwise order according to the character order in the string.

6. The OCR annotation method according to claim 3, characterized in that, The method further includes: In response to the second operation, an input interface for the labeled string is generated; the second operation is to draw a preset number of target coordinate points for each character in the string and to connect the target coordinate points in a clockwise or counterclockwise direction to form a closed shape according to the character order in the string. Correspondingly, the received input annotation string corresponding to the string includes: The annotation string corresponding to the string is received from the input interface.

7. The OCR annotation method according to claim 1, characterized in that, Also includes: In response to the third operation, an input interface for the labeled string is generated; Correspondingly, the received input annotation string corresponding to the string includes: The annotation string corresponding to the string is received from the input interface.

8. The OCR annotation method according to claim 2, characterized in that, The method further includes sending a quantity error message if the target total quantity is not a multiple of the preset quantity of the character quantity.

9. The OCR annotation method according to claim 1, characterized in that, The preset quantity is greater than or equal to 4.

10. The OCR annotation method according to claim 9, characterized in that, When the preset quantity is 4, the 4 target coordinate points corresponding to each character are the 4 vertices of the circumscribed quadrilateral corresponding to the character.

11. An OCR annotation device, characterized in that, The device includes: a receiving module, a target coordinate point information generation module, a label string receiving module, and a labeling module; The receiving module is used to receive the target labeled image; The target coordinate point information generation module is used to respond to the operation of drawing a preset number of target coordinate points for each character of the string on the target labeled image, thereby obtaining multiple target coordinate point information; the preset number of target coordinate points is used to limit the shape of the character; The annotation string receiving module is used to receive the input annotation string corresponding to the string; the annotation string is information about the string to be annotated on the target annotation image confirmed by the user. The annotation module is used to determine the target coordinate point information corresponding to each annotation character in the annotation string based on the multiple target coordinate point information and the annotation string, and use it as the annotation result of OCR; The target coordinate point information generation module is specifically used for: The response performs the first operation of drawing the target coordinate point for each character in the string according to the character order, thereby obtaining multiple target coordinate point information with an ordered relationship; The annotation module is specifically used for: Based on the sequential relationship among the multiple target coordinate point information with sequential relationship and the order of the annotation characters in the annotation string, determine the target coordinate point information corresponding to each annotation character in the annotation string.

12. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the OCR annotation method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the OCR annotation method as described in any one of claims 1-10.