Handwritten signature set construction method and system based on protocol and computer equipment
By using OCR technology and automated signature recognition methods, the problem of low efficiency in constructing handwritten signature datasets has been solved, and automated annotation and error correction have been achieved, thereby improving the efficiency and accuracy of handwritten signature dataset construction.
Patent Information
- Application Number
- CN202511016003.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies suffer from low efficiency in manually supplementing and verifying annotations when constructing large-scale handwritten signature datasets, which affects the overall annotation efficiency.
By using OCR technology to identify text regions and character positions in protocol image files, concatenating the text content, recognizing printed names and handwritten signatures, forming a set of name pairs, and traversing and verifying the position of signature characters, automatic annotation is achieved.
It has enabled the automated construction of handwritten signature sets, improving annotation efficiency and accuracy while reducing manual intervention.
Smart Images

Figure CN120932311A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition and processing, and specifically relates to a method, system, electronic device, computer program product, and computer-readable storage medium for constructing a protocol-based handwritten signature set. Background Technology
[0002] Existing intelligent annotation methods mainly include pre-annotation, human-computer collaborative annotation, and human-computer collaborative verification. Pre-annotation primarily utilizes text detection and recognition algorithms to annotate text images; human-computer collaborative annotation involves manual annotation of content that cannot be pre-annotated; and human-computer collaborative verification uses positioning tools to locate the annotated positions based on the pre-annotated results, combined with manual verification. However, when constructing large-scale handwritten signature datasets, manual annotation and collaborative verification of handwritten signatures significantly impact overall annotation efficiency. Therefore, automating annotation without manual intervention and improving the annotation efficiency of handwritten signature datasets is a pressing issue that needs to be addressed. Summary of the Invention
[0003] To address the aforementioned problems in the prior art, namely, how to improve the efficiency of constructing handwritten signature datasets, this application proposes a protocol-based method for constructing handwritten signature datasets, the method comprising:
[0004] The protocol image file is subjected to text content recognition to obtain text region blocks, the positions of the text region blocks, and the characters and their positions within the text region blocks;
[0005] Extract characters from each text region block and concatenate them to obtain the text content;
[0006] Identify the printed name in the upper part of the text content and the handwritten signature in the lower part, and match the printed name and the handwritten signature to obtain a set of name pairs, wherein the upper part is the content area of the protocol including the printed name, and the lower part is the content area of the protocol including the handwritten signature;
[0007] The name pair set is traversed and verified to obtain the annotation result of the handwritten signature. The annotation result includes the signature characters contained in the handwritten signature and the position of the signature characters.
[0008] Optionally, in the protocol-based handwritten signature set construction method, the output format of the name pairs in the name pair set is that the handwritten signature comes first and the printed name comes last.
[0009] Optionally, the set of name pairs is denoted as RL = {P(1), P(2), ..., P(i)}, where P(i) = (sign_name, print_name), P(i) is a name pair, i is the number of name pairs, sign_name is a handwritten signature, and print_name is the printed name. In the protocol-based handwritten signature set construction method, the step of traversing and verifying the set of name pairs includes:
[0010] Determine whether the lengths of sign_name and print_name in P(i) are the same. If the lengths are not the same, end the verification of P(i).
[0011] If the lengths are consistent, scan the text region blocks forward to find the first text region block containing "print_name", record the first index number m of the first text region block, and record the starting position of "print_name" in the first text region block; and...
[0012] The text region block is scanned in reverse to find the second text region block containing sign_name. The second index number n of the second text region block is recorded, and the starting position of sign_name in the second text region block is also recorded.
[0013] If m≥n, the verification of P(i) ends;
[0014] If m < n, then the verification passes.
[0015] Optionally, in the protocol-based handwritten signature set construction method, the step of traversing the name pair set and verifying it to obtain the annotation result of the handwritten signature includes:
[0016] If the verification passes, iterate through each character of sign_name and each character of print_name in P(i);
[0017] If the characters of sign_name are the same as the characters of print_name, the positions of each signature character of sign_name are obtained according to the starting position of sign_name in the second text area block, and the signature characters of sign_name and the positions of each signature character are saved.
[0018] If the characters in sign_name are inconsistent with the characters in print_name, the characters in print_name are used as the signature characters of sign_name. The actual positions of each character in sign_name are obtained according to the starting position of sign_name in the second text area block. The actual positions are used as the positions of the corresponding signature characters and saved.
[0019] A second aspect of this application proposes a protocol-based handwritten signature set construction system, the system comprising:
[0020] The OCR module is used to perform text content recognition on protocol image files to obtain text region blocks, the position of the text region blocks, and the characters and their positions within the text region blocks.
[0021] The concatenation module is used to extract characters from each text region block and concatenate them to obtain the text content.
[0022] The name recognition module is used to recognize the printed name in the upper part of the text content and the handwritten signature in the lower part, and match the printed name and the handwritten signature to obtain a set of name pairs, wherein the upper part is the content area of the protocol including the printed name, and the lower part is the content area of the protocol including the handwritten signature;
[0023] The annotation module is used to traverse the set of name pairs and verify them to obtain the annotation result of the handwritten signature. The annotation result includes the signature characters contained in the handwritten signature and the position of the signature characters.
[0024] Optionally, in the system, the name recognition module outputs the name pairs in the name pair set in the format of handwritten signature first and printed name last. The name pair set is denoted as RL={P(1),P(2),...,P(i)}, P(i)=(sign_name,print_name), where P(i) is a name pair, i is the number of name pairs, sign_name is the handwritten signature, and print_name is the printed name.
[0025] Accordingly, the annotation module includes: a character length verification module, used to determine whether the lengths of sign_name and print_name in P(i) are consistent; if the lengths are inconsistent, the verification of P(i) ends.
[0026] A forward scanning module is used to scan the text region blocks forward if the lengths are consistent, find the first text region block containing "print_name", record the first index number "m" of the first text region block, and record the starting position of "print_name" in the first text region block; and,
[0027] The reverse scanning module is used to reverse scan the text region block, find the second text region block containing sign_name, record the second index number n of the second text region block, and record the starting position of sign_name in the second text region block;
[0028] The position verification module is used to end the verification of P(i) if m≥n; otherwise, the verification passes.
[0029] Optionally, in the system, the annotation module further includes:
[0030] The character traversal module is used to traverse each character of sign_name and each character of print_name in P(i) if the verification passes.
[0031] The first annotation module is used to obtain the position of each signature character of sign_name based on the starting position of sign_name in the second text area block if the characters of sign_name are the same as the characters of print_name, and save the signature characters of sign_name and the position of each signature character.
[0032] The second annotation module is used to, if the characters of sign_name are inconsistent with the characters of print_name, take the characters of print_name as each signature character of sign_name, obtain the actual position of each character of sign_name according to the starting position of sign_name in the second text area block, and save the actual position as the position of each signature character.
[0033] A third aspect of this application discloses a computer device comprising:
[0034] At least one processor; and
[0035] A memory communicatively connected to at least one of the processors; wherein,
[0036] The memory stores instructions that can be executed by the processor to implement the above-described protocol-based handwritten signature set construction method.
[0037] In a fourth aspect, this application proposes a computer program product containing instructions that, when executed by a computer device, cause the computer device to perform the above-described protocol-based handwritten signature set construction method.
[0038] In a fifth aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for execution by the computer to implement the above-described protocol-based handwritten signature set construction method.
[0039] The protocol-based handwritten signature set construction method and system proposed in this application are applicable to protocols containing printed names and handwritten signatures located in different areas. First, text content recognition is performed on the protocol image file, i.e., OCR (Optical Character Recognition) technology is used to recognize the text in the image, completing the image-to-text conversion and obtaining text region blocks and their positions, as well as the positions of characters within those blocks. Next, the characters in the text region blocks are concatenated to reconstruct the protocol's text content. Then, the printed names and handwritten signatures are identified, and each printed name and each handwritten signature is matched to form a set of name pairs. Subsequently, each name pair is traversed and verified. Based on the verified name pairs, each character of the handwritten signature and its position are recorded, completing the handwritten signature annotation. The handwritten signature annotations for multiple protocols constitute a handwritten signature set. The protocol-based handwritten signature set construction method provided in this application automatically recognizes the handwritten signature of the protocol image and automatically verifies and annotates the handwritten signature by verifying the printed name and the handwritten signature. The entire process does not require manual intervention, which greatly improves the efficiency of handwritten signature annotation, that is, improves the efficiency of handwritten signature set construction; and by comparing the printed name and the handwritten signature, the accuracy of handwritten signature annotation is improved. Attached Figure Description
[0040] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0041] Figure 1 This is a flowchart of the method for constructing a handwritten signature set based on the protocol in this application;
[0042] Figure 2 This is a flowchart of one implementation of step S014 in the protocol-based handwritten signature set construction method of this application;
[0043] Figure 3 This is an example of a protocol image file;
[0044] Figure 4 This is a schematic diagram of the system for constructing a handwritten signature set based on the protocol in this application;
[0045] Figure 5 This is a schematic diagram of the annotation module in the protocol-based handwritten signature set construction system of this application;
[0046] Figure 6 This is a schematic diagram of the structure of a computer system used to implement the methods, systems, and devices of this application. Detailed Implementation
[0047] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0048] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0049] This application provides a method for constructing a handwritten signature set based on a protocol. The method is applicable to protocols containing printed names and handwritten signatures, where the printed names and handwritten signatures are located in different parts of the protocol. Since the handwritten signature is usually located at the end of the signed agreement, and the printed name precedes the handwritten signature, the area containing the printed name is called the "preceding part," and the area containing the handwritten signature is called the "following part." For example, in a journal transfer agreement, the upper part contains the printed names of the parties to the agreement, and the lower part contains the handwritten signatures of the parties to the agreement. Before executing the method for constructing a handwritten signature set based on a protocol provided in this application, an image file of the protocol is obtained through scanning and photographing. After obtaining the protocol image file, as follows... Figure 1 As shown, the method includes:
[0050] Step S101: Perform text content recognition on the protocol image file to obtain text region blocks, the position of the text region blocks, and the characters and their positions in the text region blocks;
[0051] Specifically, OCR technology (such as existing OCR algorithms) is used to perform text content recognition on the protocol image file, completing the image-to-text conversion. After OCR recognition, the text region block, the position of the text region block, and the characters in the text region block and their corresponding positions are automatically obtained. The recognition result can be represented as: RO={Z(1),Z(2),...,Z(i)}, where Z(i) represents the text region block.
[0052]
[0053] in,
[0054] Step S102: Extract characters from each text region block and concatenate them to obtain the text content;
[0055] Specifically, the content within a text region block can be concatenated according to its positional order to obtain the text content. The text region block content is the character set within that block, that is, all the characters in the text region block. Alternatively, characters can be extracted from the text region blocks, concatenated according to their positional order to obtain the corresponding text content, and then the text content of each text region block can be concatenated according to its positional order to obtain the complete text content corresponding to the protocol.
[0056] Step S103: Identify the printed name in the upper part of the text content and the handwritten signature in the lower part, and match the printed name and the handwritten signature to obtain a set of name pairs, wherein the upper part is the content area of the protocol including the printed name, and the lower part is the content area of the protocol including the handwritten signature.
[0057] Specifically, a large model (such as Baidu's intelligent platform) can be used to recognize the concatenated text content. A first region corresponding to the preceding part of the protocol and a second region corresponding to the following part of the protocol are set in the text content. The large model recognizes the printed name in the first region and the name and handwritten signature in the second region, and then matches the printed name with the handwritten signature. In one implementation, each name in the printed name section and each signature in the handwritten signature section of the protocol corresponds one-to-one in a prescribed order. The large model can match printed names and handwritten signatures with the same order based on the order of the recognized printed names in the text content and the order of the handwritten signatures in the text content, forming name pairs. In another implementation, the large model can compare the recognized printed names with the handwritten signatures; if the number of identical characters between them is greater than a set threshold, then the two are matched to form a name pair. Existing large model technology can be used to complete the recognition and matching of printed names and handwritten signatures in the text content. Multiple matched name pairs form a name pair set.
[0058] In one implementation, the output format of name pairs in the name pair set is set to handwritten signature first, followed by printed name. The name pair set can be represented as follows:
[0059] RL = {P(1), P(2), ..., P(i)}, P(i) = (sign_name, print_name), where P(i) represents name pairs, i is the number of name pairs, sign_name is the handwritten signature, and print_name is the printed name. Placing the handwritten signature first and the printed name last is advantageous when traversing the set of name pairs. When searching for a handwritten signature, the text content is scanned backwards to find the handwritten signature; when searching for a printed name, the text content is scanned forwards to find the printed name. This is because the printed name is usually located at the beginning of the text content, and forward scanning reduces scanning time and the amount of content scanned. Similarly, the handwritten signature is usually located at the end of the text content, and backward scanning also reduces scanning time and the amount of content scanned, thus improving scanning efficiency and accuracy.
[0060] Step S104: Traverse the set of name pairs and verify them to obtain the annotation result of the handwritten signature. The annotation result includes the signature characters contained in the handwritten signature and the position of the signature characters.
[0061] Specifically, such as Figure 2 As shown, step S104 may include:
[0062] Step S1041: Determine whether the lengths of sign_name and print_name in name pair P(i) are consistent. If the lengths are inconsistent, end the verification of P(i).
[0063] Step S1042: If the lengths are consistent, scan the text region blocks forward to find the first text region block containing "print_name", record the first index number m of the first text region block, and record the starting position pos_p of "print_name" in the first text region block; and,
[0064] Step S1043: Reverse scan the text region block, find the second text region block containing sign_name, record the second index number n of the second text region block, and record the starting position pos_s of sign_name in the second text region block;
[0065] Step S1044: Determine whether m is greater than or equal to n. If m ≥ n, end the verification of P(i); if m < n, the verification passes.
[0066] Specifically, the process iterates through the name pairs in the name pair set. First, it checks whether the character lengths of the handwritten signature and the printed signature in the name pair are the same. If they are not the same, it indicates that the name pair is an incorrect recognition result. The name pair is then discarded, the verification of the name pair ends, and an error message for the name pair can be displayed.
[0067] If the lengths are consistent, scan the text area blocks forward to find the text area block containing the printed name, record the index number m of the text area block, and record the starting position of the printed name in the text area block, that is, the starting position of the first character of the printed name; and scan the text area blocks backward to find the text area block containing the handwritten signature, record the index number n of the text area block, and record the starting position of the handwritten signature in the text area block, that is, the starting position of the first character of the handwritten signature.
[0068] If m ≥ n, that is, the index of the text area block containing the printed name is greater than or equal to the index of the text area block containing the handwritten signature, it means that there is an error in the search or the previous match. In this case, the verification fails, the name pair is abandoned, the verification of the name pair ends, and an error message can be displayed. If m < n, it means that the search and match are correct, and the verification passes.
[0069] Understandably, the output format for name pairs can be printed name first, followed by handwritten signature. It is also possible to scan the text area block in reverse to find the printed name, or scan the text area block in forward to find the handwritten signature, but the efficiency and accuracy will be slightly inferior.
[0070] Furthermore, step S104 also includes:
[0071] Step S1045: If the verification passes, iterate through each character of sign_name and each character of print_name in name pair P(i) and determine whether the characters of sign_name and print_name are consistent.
[0072] Step S1046: If the characters of sign_name are the same as the characters of print_name, obtain the position of each signature character of sign_name according to the starting position of sign_name in the second text area block, save the signature characters of sign_name and the position of each signature character, and obtain the annotation result;
[0073] Step S1047: If the characters of sign_name are inconsistent with the characters of print_name, take each character of print_name as each signature character of sign_name, obtain the actual position of each character of sign_name according to the starting position of sign_name in the second text area block, take the actual position as the position of each signature character and save it to obtain the annotation result.
[0074] Specifically, if the verification of the name pair passes, traverse each character of the handwritten signature and the printed name in the name pair, compare each character of the handwritten signature with each character of the printed name. If the characters of the handwritten signature are consistent with those of the printed name, it indicates that the handwritten signature is accurately recognized. According to the position of the first character of the handwritten signature, obtain the positions of each signature character of the handwritten signature in sequence, save the signature characters in the handwritten signature and the corresponding positions of the signature characters, and complete the annotation of the handwritten signature.
[0075] If the characters of the handwritten signature are inconsistent with those of the printed name, it indicates that there is an error in the recognition of the handwritten signature, and there are characters that are not accurately recognized. For example, due to the cursive writing when the protocol party signs, there are errors in the recognized characters. In this case, still obtain the positions of each signature character of the handwritten signature in sequence according to the position of the first character of the handwritten signature, and save the positions of each signature character as the positions of the signature characters in the annotation result; at the same time, since there are no problems such as unclear connected strokes caused by handwriting in the printed name, the recognized printed name is clear. Therefore, use each corresponding character in the printed name as each signature character of the handwritten signature, save it as the signature characters of the handwritten signature in the annotation result, and complete the correction of the handwritten signature.
[0076] Among them, the position of the character in the handwritten signature can also use the character position in the handwritten signature recognition result, but scanning and searching for positioning can prevent the character position error during recognition and make the marked character position more accurate.
[0077] Next, take a copyright transfer agreement as an example to illustrate the implementation and effect of the method for constructing a handwritten signature set based on the agreement provided by this application. Figure 3 It is an example of a copyright transfer agreement image file. The upper part of the agreement includes the author's printed name, and the lower part includes the author's handwritten signature. After performing OCR recognition, character splicing, and large model recognition and matching on the agreement image file, a name pair set is obtained:
[0078] {("Yu Jianghu", "Yu Jianghu"), ("Li Hongcheng", "Li Jiacheng")}. Through traversing and verifying the name pair set, correct the misrecognized "Li Hongcheng" in the handwritten signature to "Li Jiacheng". Finally, the annotation result is expressed as:
[0079] {"char": "Li", "location": {"top": 868, "left": 413, "width": 46, "height": 66}}
[0080] {"char": "Jia", "location": {"top": 868, "left": 464, "width": 34, "height": 66}}
[0081] {"char":"Cheng","location":{"top":869,"left":503,"width":47,"height":65}}
[0082] Among them, the position of the signature character is represented by (top, left, width, height). top and left refer to the starting coordinates of the position, representing the distances from the topmost and leftmost sides of the image respectively, and width and height refer to the distances to the right and down from the starting coordinates, with the distance unit being pixels. Thus, the annotation results of multiple handwritten signatures are obtained, constituting a handwritten signature dataset.
[0083] The method for constructing a handwritten signature set based on a protocol provided by this application realizes automatic text recognition, verification, and annotation throughout the process, without the need for manual assistance, greatly improving the efficiency of constructing the handwritten signature set; and through the matching verification of the printed name and the handwritten signature, automatic error correction of the handwritten signature is achieved, further improving the efficiency of constructing the handwritten signature set and effectively improving the accuracy of constructing the handwritten signature set.
[0084] Although the various steps are described in the above order in the above embodiments, those skilled in the art can understand that in order to achieve the effects of this embodiment, different steps do not have to be executed in such an order, and they can be executed simultaneously (in parallel) or in a reversed order, and these simple changes are all within the protection scope of this invention.
[0085] In the second aspect of this application, as Figure 4 shown, a system for constructing a handwritten signature set based on a protocol is provided. The system includes:
[0086] An OCR module for performing text content recognition on the protocol image file to obtain text region blocks, the positions of the text region blocks, and the characters and character positions in the text region blocks;
[0087] A splicing module for extracting and splicing the characters in each text region block to obtain the text content;
[0088] A name recognition module for recognizing the printed name in the upper part and the handwritten signature in the lower part of the text content, and matching the printed name with the handwritten signature to obtain a set of name pairs, where the upper part is the content region of the protocol including the printed name, and the lower part is the content region of the protocol including the handwritten signature;
[0089] An annotation module for traversing and verifying the set of name pairs to obtain the annotation result of the handwritten signature, where the annotation result includes the signature characters included in the handwritten signature and the positions of the signature characters.
[0090] In one implementation, the name recognition module outputs the name pair set in the format of the handwritten signature first and the printed name last. The name pair set is denoted as RL={P(1),P(2),...,P(i)}, P(i)=(sign_name,print_name), where P(i) is a name pair, i is the number of name pairs, sign_name is the handwritten signature, and print_name is the printed name.
[0091] Accordingly, in one implementation, such as Figure 5 As shown, the annotation module includes:
[0092] The character length verification module is used to determine whether the lengths of sign_name and print_name in P(i) are consistent. If the lengths are inconsistent, the verification of P(i) ends.
[0093] A forward scanning module is used to scan the text region blocks forward if the lengths are consistent, find the first text region block containing "print_name", record the first index number "m" of the first text region block, and record the starting position of "print_name" in the first text region block; and,
[0094] The reverse scanning module is used to reverse scan the text region block, find the second text region block containing sign_name, record the second index number n of the second text region block, and record the starting position of sign_name in the second text region block;
[0095] The position verification module is used to end the verification of P(i) if m≥n; otherwise, the verification passes.
[0096] The character traversal module is used to traverse each character of sign_name and each character of print_name in P(i) if the verification passes.
[0097] The first annotation module is used to obtain the position of each signature character of sign_name based on the starting position of sign_name in the second text area block if the characters of sign_name are the same as the characters of print_name, and save the signature characters of sign_name and the position of each signature character.
[0098] The second annotation module is used to, if the characters of sign_name are inconsistent with the characters of print_name, take the characters of print_name as each signature character of sign_name, obtain the actual position of each character of sign_name according to the starting position of sign_name in the second text area block, and save the actual position as the position of each signature character.
[0099] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the system described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0100] The protocol-based handwritten signature set construction system provided in this application can automatically complete the entire process of text recognition, verification and annotation, and can automatically correct handwritten signature errors, which greatly improves the efficiency and accuracy of handwritten signature set construction.
[0101] It should be noted that the protocol-based handwritten signature set construction system provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiments can be merged into one module, or further split into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the various modules or steps and are not considered as an improper limitation of the present invention.
[0102] A third aspect of this application discloses a computer device comprising:
[0103] At least one processor; and
[0104] A memory communicatively connected to at least one of the processors; wherein,
[0105] The memory stores instructions that can be executed by the processor to implement the aforementioned protocol-based handwritten signature set construction method.
[0106] In a fourth aspect, this application proposes a computer program product containing instructions that, when executed by a computer device, cause the computer device to perform the aforementioned protocol-based handwritten signature set construction method.
[0107] A fifth aspect of this application proposes a computer-readable storage medium storing computer instructions for execution by the computer to implement the aforementioned protocol-based handwritten signature set construction method.
[0108] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the storage device and processing device described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0109] Those skilled in the art will recognize that the modules and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. The programs corresponding to the software modules and method steps can be placed in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art. To clearly illustrate the interchangeability of electronic hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the invention.
[0110] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system for implementing the methods, systems, and devices of this application. Figure 6 The server shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0111] like Figure 6 As shown, the computer system includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in Read Only Memory (ROM) 602 or programs loaded from storage section 608 into Random Access Memory (RAM) 603. The RAM 603 also stores various programs and data required for system operation. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An Input / Output (I / O) interface 605 is also connected to the bus 604.
[0112] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.
[0113] Specifically, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined in the methods of this application. It should be noted that the computer-readable medium described above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0114] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0116] The terms “first”, “second”, etc., are used to distinguish similar objects, not to describe or indicate a specific order or sequence.
[0117] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent in such process, method, article, or apparatus / device.
[0118] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for constructing a protocol-based handwritten signature set, characterized in that, include: The protocol image file is subjected to text content recognition to obtain text region blocks, the positions of the text region blocks, and the characters and their positions within the text region blocks; Extract characters from each text region block and concatenate them to obtain the text content; Identify each printed name in the upper part of the text content and each handwritten signature in the lower part, and match the printed name and the handwritten signature to obtain a set of name pairs, wherein the upper part is the content area of the protocol including the printed name, and the lower part is the content area of the protocol including the handwritten signature; The name pair set is traversed and verified to obtain the annotation result of the handwritten signature. The annotation result includes the signature characters contained in the handwritten signature and the position of the signature characters.
2. The method according to claim 1, characterized in that, The output format of the name pairs in the name pair set is that the handwritten signature comes first and the printed name comes last.
3. The method according to claim 2, characterized in that, The set of name pairs is denoted as RL = {P(1), P(2), ..., P(i)}, where P(i) = (sign_name, print_name), P(i) is a name pair, i is the number of name pairs, sign_name is the handwritten signature, and print_name is the printed name. The step of traversing and verifying the set of name pairs includes: Determine whether the lengths of sign_name and print_name in name pair P(i) are the same. If the lengths are not the same, end the verification of P(i). If the lengths are consistent, scan the text region blocks forward to find the first text region block containing "print_name", record the first index number m of the first text region block, and record the starting position of "print_name" in the first text region block; and... The text region block is scanned in reverse to find the second text region block containing sign_name. The second index number n of the second text region block is recorded, and the starting position of sign_name in the second text region block is also recorded. If m≥n, the verification of P(i) ends; If m < n, then the verification passes.
4. The method according to claim 3, characterized in that, Traverse and verify the set of name pairs to obtain the annotation result of the handwritten signature, including: If the verification passes, iterate through each character of sign_name and each character of print_name in name pair P(i); If the characters of sign_name are the same as the characters of print_name, the positions of each signature character of sign_name are obtained according to the starting position of sign_name in the second text area block, and the signature characters of sign_name and the positions of each signature character are saved. If the characters in sign_name are inconsistent with the characters in print_name, the characters in print_name are used as the signature characters of sign_name. The actual positions of each character in sign_name are obtained according to the starting position of sign_name in the second text area block. The actual positions are used as the positions of the corresponding signature characters and saved.
5. A protocol-based handwritten signature set construction system, characterized in that, include: The OCR module is used to perform text content recognition on protocol image files to obtain text region blocks, the position of the text region blocks, and the characters and their positions within the text region blocks. The concatenation module is used to extract characters from each text region block and concatenate them to obtain the text content. The name recognition module is used to recognize each printed name in the upper part of the text content and each handwritten signature in the lower part, and match the printed name and the handwritten signature to obtain a set of name pairs, wherein the upper part is the content area of the protocol including the printed name, and the lower part is the content area of the protocol including the handwritten signature. The annotation module is used to traverse the set of name pairs and verify them to obtain the annotation result of the handwritten signature. The annotation result includes the signature characters contained in the handwritten signature and the position of the signature characters.
6. The system according to claim 5, characterized in that, The name recognition module outputs name pairs in the name pair set in the format of handwritten signature first, followed by printed name. The name pair set is denoted as RL = {P(1), P(2), ..., P(i)}, where P(i) = (sign_name, print_name), where P(i) is a name pair, i is the number of name pairs, sign_name is the handwritten signature, and print_name is the printed name. The annotation module includes: The character length verification module is used to determine whether the lengths of sign_name and print_name in name pair P(i) are consistent. If the lengths are inconsistent, the verification of P(i) ends. A forward scanning module is used to scan the text region blocks forward if the lengths are consistent, find the first text region block containing "print_name", record the first index number "m" of the first text region block, and record the starting position of "print_name" in the first text region block; and, The reverse scanning module is used to reverse scan the text region block, find the second text region block containing sign_name, record the second index number n of the second text region block, and record the starting position of sign_name in the second text region block; The position verification module is used to end the verification of P(i) if m≥n; otherwise, the verification passes.
7. The system according to claim 6, characterized in that, The annotation module also includes: The character traversal module is used to traverse each character of sign_name and each character of print_name in P(i) if the verification passes. The first annotation module is used to obtain the position of each signature character of sign_name based on the starting position of sign_name in the second text area block if the characters of sign_name are the same as the characters of print_name, and save the signature characters of sign_name and the position of each signature character. The second annotation module is used to, if the characters of sign_name are inconsistent with the characters of print_name, take the characters of print_name as each signature character of sign_name, obtain the actual position of each character of sign_name according to the starting position of sign_name in the second text area block, and save the actual position as the position of each signature character.
8. A computer device, characterized in that, include: At least one processor; as well as A memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor to implement the protocol-based handwritten signature set construction method according to any one of claims 1-4.
9. A computer program product containing instructions, characterized in that, When the instructions are executed by a computer device, the computer device performs the protocol-based handwritten signature set construction method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are executed by the computer to implement the protocol-based handwritten signature set construction method according to any one of claims 1-4.