An electronic signature acquisition method and device, an electronic device, and a storage medium

By using a neural network model to recognize and correct the pattern of the physical signature, the problems of large differences between electronic signatures and physical signatures and the cumbersome generation process in the existing technology are solved, and the correct and consistent electronic signatures can be generated quickly and efficiently.

CN115690503BActive Publication Date: 2025-10-17GUANGDONG CERTIFICATE AUTHORITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211369151.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2025-10-17
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

The existing electronic signature generation method is very different from the physical signature, and the generation process is cumbersome, making it difficult to quickly and efficiently obtain a correct and consistent electronic signature.

Method used

A neural network model is used to recognize and automatically correct the signature pattern of the physical signature image. The direction and angle category of the signature are determined through the trained classification model, and the signature pattern is adjusted to generate an electronic signature that is correct and consistent with the physical signature.

Benefits of technology

It enables the rapid and efficient generation of correct electronic signatures that are consistent with physical signatures, reduces manual intervention, and improves the efficiency and consistency of the generation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115690503B_ABST
    Figure CN115690503B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing, and specifically to an electronic signature acquisition method and device, electronic equipment and storage medium. The electronic signature acquisition method comprises the steps of: obtaining the graphic information of the entity signature, the graphic information comprising a first signature pattern and a first signature shape; inputting the first signature pattern into a first classification model that has been trained to obtain the direction category to which the first signature pattern belongs; the direction category comprising a positive class and a negative class; adjusting the first signature pattern according to the direction category to obtain a second signature pattern; inputting the second signature pattern into a second classification model that has been trained to obtain the angle category to which the second signature pattern belongs; and adjusting the second signature pattern according to the angle category and the first signature shape to obtain an electronic signature. The present application can quickly and efficiently obtain an electronic signature that is correct and consistent with the entity signature.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, in particular to an electronic seal acquisition method and device, electronic equipment and storage medium. BACKGROUND

[0002] Seals include seals and signatures. Existing electronic seals are generally automatically generated by a system (for electronic seals), handwritten based on a touch screen (for electronic signatures), or extracted from a picture in a retouching manner. However, the electronic seals obtained by automatic generation by a system and handwriting based on a touch screen often have great differences from physical seals, for example, in terms of font type, font spacing, anti-forgery lines, special patterns, and the like, and cannot accurately correspond to physical seals. In order to reflect the seriousness of the document, the electronic seal is required to be placed upright, and therefore manual image rotation correction needs to be performed using retouching software (such as Photoshop). Whether the corrected image is upright depends entirely on personal perception, and the final effect is greatly affected by human factors and the processing process is cumbersome and inefficient.

[0003] Therefore, the prior art needs to be improved and developed. SUMMARY

[0004] The purpose of the present application is to provide an electronic seal acquisition method, device, electronic equipment and storage medium, which can quickly and efficiently obtain an electronic seal that is upright and consistent with a physical seal.

[0005] In a first aspect, the present application provides an electronic seal acquisition method applied to an image processing system, the electronic seal acquisition method comprising the following steps:

[0006] S1. Obtain graphical information of a physical seal, the graphical information comprising a first seal pattern and a first seal shape;

[0007] S2. Input the first seal pattern into a first classification model that has been trained to obtain a direction category to which the first seal pattern belongs; the direction category comprising a positive category and a negative category;

[0008] S3. Adjust the first seal pattern according to the direction category to obtain a second seal pattern;

[0009] S4. Input the second seal pattern into a second classification model that has been trained to obtain an angle category to which the second seal pattern belongs;

[0010] S5. Adjust the second seal pattern according to the angle category and the first seal shape to obtain an electronic seal.

[0011] The application utilizes a neural network model to accurately extract a seal pattern in an entity seal image and automatically correct the placement angle of the seal pattern, thereby quickly and efficiently obtaining an electronic seal that is upright and consistent with the entity seal.

[0012] Further, the specific steps in step S1 include:

[0013] S11. Obtain a seal area image; the seal area is an area where the entity seal is signed;

[0014] S12. Input the seal area image into a trained seal detection model to obtain the graphic information of all entity seals in the seal area.

[0015] Only effective entity seals will be subjected to subsequent analysis and processing, thereby standardizing the signing requirements of entity seals and facilitating the reduction of the recognition difficulty of the image processing system for entity seals.

[0016] Further, the specific steps in step S11 include:

[0017] S111. Obtain a seal report form image, wherein the seal report form image includes a seal box;

[0018] S112. Obtain the corner point coordinates of the four corner points of the seal box;

[0019] S113. Cut the seal box as a first image according to the corner point coordinates;

[0020] S114. Calculate a rotation angle according to the corner point coordinates;

[0021] S115. Correct the first image according to the rotation angle to obtain the seal area image.

[0022] This is conducive to reducing the recognition difficulty of the image processing system for entity seals.

[0023] Further, the seal detection model is a model based on a Yolo-v5 neural network algorithm;

[0024] The seal detection model is trained by the following steps:

[0025] A1. Obtain corpus data, wherein the corpus data includes a plurality of third seal patterns;

[0026] A2. Manually label the second seal shape of each third seal pattern in the corpus data using a LabelMe labeling tool, wherein the second seal shape includes a circular shape, a square shape, a rectangular shape, an oval shape, and an irregular shape;

[0027] A3. training the signature detection model by using the annotated corpus data, to obtain the trained signature detection model.

[0028] The signature detection model can be used to conveniently and quickly obtain the graphic information of the entity signature.

[0029] Further, the specific steps in step S3 include:

[0030] S31. If the direction category is positive, the first signature pattern is taken as the second signature pattern; if the direction category is negative, the first signature pattern is rotated by 180° to obtain the second signature pattern.

[0031] Further, the first classification model and the second classification model are both models based on the mobilenet-v2 neural network algorithm.

[0032] Further, the specific steps in step S5 include:

[0033] S51. obtaining the graphic size of the second signature pattern;

[0034] S52. obtaining a correction angle according to the angle category;

[0035] S53. obtaining a clipping box according to the correction angle, the first signature shape and the graphic size;

[0036] S54. clipping a fourth signature pattern from the second signature pattern according to the clipping box;

[0037] S55. rotating the fourth signature pattern according to the correction angle to obtain the electronic signature.

[0038] In a second aspect, the present application further provides an electronic signature obtaining device applied to an image processing system, the electronic signature obtaining device comprising:

[0039] an obtaining module, configured to obtain graphic information of an entity signature, the graphic information comprising a first signature pattern and a first signature shape;

[0040] a first classification module, configured to input the first signature pattern into a trained first classification model to obtain a direction category to which the first signature pattern belongs; the direction category comprising a positive category and a negative category;

[0041] a first adjusting module, configured to adjust the first signature pattern according to the direction category to obtain a second signature pattern;

[0042] a second classification module configured to input the second signature pattern into a second trained classification model to obtain an angle category to which the second signature pattern belongs;

[0043] a second adjustment module configured to adjust the second signature pattern according to the angle category and the first signature shape to obtain an electronic signature.

[0044] The first and second trained classification models are used to quickly and accurately correct the pattern, so as to obtain an electronic signature that is properly placed and consistent with the physical signature.

[0045] In a third aspect, the present application provides an electronic device including a processor and a memory, the memory storing computer readable instructions that, when executed by the processor, perform the steps of the electronic signature obtaining method described above.

[0046] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, the computer program, when executed by a processor, performing the steps of the electronic signature obtaining method described above.

[0047] As can be seen from the above, the present application classifies signature patterns by using a neural network model and automatically corrects them according to the classification results, so as to obtain a properly placed electronic signature from an image, effectively ensures that the electronic signature is consistent with the physical signature, eliminates a series of complex operations by using photo editing software, and makes the generation process more efficient and fast. Meanwhile, the present application can also eliminate the influence of human factors and make all electronic signatures uniform in appearance. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 A flowchart of the electronic signature obtaining method provided by the embodiments of the present application.

[0049] Figure 2 A schematic diagram of a signature region image in the embodiments of the present application.

[0050] Figure 3 A schematic diagram of a clipping box for a physical signature with a circular first signature shape in the embodiments of the present application.

[0051] Figure 4 A schematic diagram of a clipping box for a physical signature with a rectangular first signature shape in the embodiments of the present application.

[0052] Figure 5 A schematic diagram of a clipping box for a physical signature with a square first signature shape in the embodiments of the present application.

[0053] Figure 6 A schematic diagram of a clipping box for a physical signature with an elliptical first signature shape in the embodiments of the present application.

[0054] Figure 7 A structure schematic diagram of an electronic signature acquisition device provided by an embodiment of the present application.

[0055] Figure 8 A structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0057] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0058] In real life, when attaching an electronic signature to an electronic official document, people often adjust the placement angle of the signature to make the signature placed properly, so as to reflect the seriousness of the document. In the prior art, there are generally two kinds of algorithms for automatically correcting pictures:

[0059] 1. Correction algorithm based on contour extraction, which is mainly aimed at images with obvious pattern edges;

[0060] 2. Correction algorithm based on Hough straight line detection, which is mainly aimed at text images with non-obvious pattern edges but arranged in order.

[0061] Among them, the method for implementing image correction of the correction algorithm based on contour extraction generally includes the following steps:

[0062] A1. Picture gray scale, binarization;

[0063] A2. Detecting contour and screening out target contour (removing interference contour through horizontal and vertical ratio or area);

[0064] A3. Obtaining the minimum circumscribed rectangle of the target contour;

[0065] A4. Get the four vertices of the minimum circumscribed rectangle, and define the four vertices of the corrected image;

[0066] A5. Perspective transformation (four-point transformation).

[0067] It can be known that the core idea of the method is to extract the target contour, calculate the angle of rotation required by the target and the shape of the clipping according to the four vertex coordinates of the target contour, so as to realize image correction. However, the premise of all this is to clearly and accurately extract the target contour. For patterns with unclear target contours or irregular contour shapes, the method cannot be effectively applied.

[0068] The correction algorithm based on Hough line detection is to detect all straight lines in the image by Hough line transformation, calculate the inclination angle of each straight line, find the average inclination angle and rotate the correction, so as to realize image correction.

[0069] However, for the seal pattern, the edge of part of the seal pattern is not obvious, and the text in the seal is not arranged in a straight line (for example, oval seal, round seal, irregular stamp, etc.), so the above method cannot be used to obtain an electronic seal placed in the correct position.

[0070] Therefore, the embodiment proposes an electronic seal acquisition method applied to an image processing system, which comprises the following steps:

[0071] S1. Obtain the graphic information of the physical seal, which includes a first seal pattern and a first seal shape;

[0072] S2. Input the first seal pattern into a first classification model that has been trained to obtain the direction category to which the first seal pattern belongs; the direction category includes a positive class and a negative class;

[0073] S3. Adjust the first seal pattern according to the direction category to obtain a second seal pattern;

[0074] S4. Input the second seal pattern into a second classification model that has been trained to obtain the angle category to which the second seal pattern belongs;

[0075] S5. Adjust the second seal pattern according to the angle category and the first seal shape to obtain an electronic seal.

[0076] In this embodiment, after obtaining the first seal pattern and identifying the first seal shape, the first classification model is used for first classification to determine whether the placement angle of the first seal pattern exceeds 180°, and the first seal pattern with a placement angle not exceeding 180° is classified as positive, and the first seal pattern with a placement angle exceeding 180° is classified as negative, so as to determine all the first seal patterns that need to be corrected for the first time; for the negative first seal pattern, the second seal pattern is obtained after correction according to the preset rule, and the second seal pattern is input into the second classification model for second classification to determine the specific correction angle of the second seal pattern. Specifically, the second classification model analyzes and classifies the second seal pattern based on the preset classification category, for example, the preset classification category is specifically 181 categories (180° is divided into one category every 1°, i.e. -90°, -89°…0°, 89°, 90°), and after analysis, if it is determined that the second seal pattern is classified as -89°, it means that the second seal pattern can be corrected by rotating 89° counterclockwise, and if it is determined that the second seal pattern is classified as 89°, it means that the second seal pattern can be corrected by rotating 89° clockwise. In this embodiment, the idea of classification is used, without complex calculation, the prediction and calculation of the correction angle are converted into the classification of the seal, which greatly reduces the calculation amount and simplifies the model architecture, and realizes the effect of an error of only 1° (based on the above example, the accuracy is determined when each category is divided, the more detailed the classification, the higher the accuracy, but the calculation amount will also increase, generally, controlling the seal error within 1° can meet the daily requirement for the correctness of the seal signature).

[0077] At the same time, when a large number of electronic seals are generated, the unified classification rule can effectively ensure the consistency of the appearance of the batch electronic seals and avoid the uneven placement of the seals caused by human factors.

[0078] It should be noted that for the seal with text, if the placement angle of the first seal pattern exceeds 180°, most of the text in the first seal pattern will be reversed, so that the effective font cannot be recognized. In some embodiments, the first classification model can use the rule to classify the first seal pattern with effective text and the first seal pattern without effective text based on the recognition algorithm (the image recognition algorithm is a prior art and will not be described here) to determine whether the placement angle of the first seal pattern exceeds 180°.

[0079] In addition, for the seal with symmetry, the symmetry axis can be determined by text and graphics, and if the second seal pattern is not placed correctly, the symmetry axis of the second seal pattern and the vertical direction of the image form an angle, and the second classification model can use the rule to determine the angle category of the second seal pattern according to the angle size based on the recognition algorithm (the image recognition algorithm is a prior art and will not be described here).

[0080] In some preferred embodiments, the first classification model and the second classification model are both models based on the mobilenet-v2 neural network algorithm.

[0081] In this embodiment, the use of the mobilenet-v2 neural network algorithm (which is prior art and will not be described here) can more accurately analyze the rules of various signatures, which is conducive to the classification of various types of signatures, especially irregular patterns such as handwritten signatures and finger prints.

[0082] It should be noted that a plurality of fifth signature patterns (for example, 250 flipped patterns and 250 upright patterns) can be manually selected and labeled with the direction category to which each fifth signature pattern belongs, so as to obtain labeled corpus data for training the first classification model. The training process is similar to the existing neural network model iterative training method, which will not be described here.

[0083] Similarly, a plurality of sixth signature patterns (for example, 50 each of circular, elliptical, square, rectangular, etc.) can be manually selected and labeled with the angle category of each sixth signature pattern, so as to obtain labeled corpus data for training the second classification model (specifically, for example, a plurality of upright seventh signature patterns are manually selected, each seventh signature pattern is arbitrarily selected with an angle category, and then each seventh signature pattern is rotated to obtain a sixth signature pattern using a retouching software, the rotation angle is the correct angle corresponding to the selected angle category; it can be understood that the manually selected sixth signature pattern can be placed upright after being rotated according to the labeled angle category, the corpus data contains the correct angle category, and after the corpus data is input into the second classification model, the second classification model outputs the predicted angle category. Compare the correct angle category in the corpus data, if the error is small enough, it is considered that the second classification model has been trained, otherwise it needs to be iteratively trained), the training process is similar to the existing neural network model iterative training method, which will not be described here.

[0084] In some embodiments, the specific steps in step S1 include:

[0085] S11. Obtain a signature area image; the signature area is the area where the signing entity signs;

[0086] S12. Input the signature area image into the trained signature detection model to obtain the graphical information of all entity signatures in the signature area (refer to FIG. 2B). Figure 2 The signature area image is input into the trained signature detection model, and the trained signature detection model can mark the graphical information of all entity signatures.

[0087] In this embodiment, the entity signature requirement is signed in the signature area to be regarded as a valid entity signature, and only the valid entity signature is subjected to subsequent analysis and processing, so as to standardize the signing requirement of the entity signature and facilitate to reduce the recognition difficulty of the image processing system on the entity signature.

[0088] In some embodiments, the specific steps in step S11 include:

[0089] S111. Obtain a signature form image, and the signature form image includes a signature box;

[0090] S112. Obtain corner point coordinates of four corner points of the signature box;

[0091] S113. Cut the signature box as a first image according to the corner point coordinates;

[0092] S114. Calculate a rotation angle according to the corner point coordinates;

[0093] S115. Correct the first image according to the rotation angle to obtain a signature area image.

[0094] In actual application, if a user has a demand for generating an electronic signature, the user needs to sign in the signature box of the signature form with an entity signature, and the image processing system only obtains an image in the signature box area as a signature area image through the processing manner in this embodiment, and an image outside the signature box area is rejected. It can be understood that the entity signature in the signature box area is a valid entity signature, and the entity signature outside the signature box area is an invalid entity signature, so as to reduce the recognition difficulty of the image processing system on the entity signature.

[0095] Specifically, the corner point coordinates of the four corner points of the signature box can be accurately obtained through a linear regression model and an image matching algorithm of opencv, then a first image is obtained according to the four corner point coordinates, a rotation angle is calculated according to the slope of the edge line of the fitted rectangle, and then the first image is corrected to obtain a signature area image after alignment.

[0096] It should be noted that considering that most official document background colors are pure white, the color in the signature box area is also specified to be pure white. Of course, for official documents with other background colors, the color in the signature box area can be adjusted accordingly, so as to achieve color unification, facilitate to reduce the work difficulty of subsequent image processing, and improve the accuracy of the generated electronic signature.

[0097] In addition, the entity signatures in the signature box should be independent and complete, and the missing and overlapped entity signatures are regarded as invalid signatures and are rejected.

[0098] In some embodiments, the signature detection model is a model based on a Yolo-v5 neural network algorithm.

[0099] The signature detection model is trained by the following steps:

[0100] A1. Obtain corpus data, which includes a plurality of third signature patterns;

[0101] A2. Manually label the second signature shape of each third signature pattern in the corpus data using the LabelMe labeling tool. The second signature shape includes a circle, a square, a rectangle, an ellipse, and an irregular shape (for reference, see FIG. 1). Figure 2 The circle is labeled as circle, the square is labeled as square, the rectangle is labeled as rectangle, the ellipse is labeled as ellipse, and the irregular shape (e.g., handwritten signature) is labeled as signature.

[0102] A3. Train the signature detection model using the labeled corpus data to obtain a trained signature detection model.

[0103] Specifically, the signature area images are manually cut from a plurality of signature reporting form images (e.g., 200 images), and the second signature shape of each third signature pattern in the signature area is labeled respectively to obtain the labeled corpus data. The signature detection model in this embodiment can conveniently and quickly obtain the graphical information of the entity signature.

[0104] In some embodiments, the specific steps in step S3 include:

[0105] S31. If the direction category is positive, the first signature pattern is taken as the second signature pattern; if the direction category is negative, the first signature pattern is rotated by 180° to obtain the second signature pattern.

[0106] In this embodiment, the first signature pattern is classified once to reduce the number of categories in the second classification of the second signature pattern. For example, if 1° is classified as a category, only 181 categories are needed, instead of 361 categories, greatly reducing the computational load of the second classification model and the amount of corpus data required to train the second classification model.

[0107] In some embodiments, the specific steps in step S5 include:

[0108] S51. Obtain the graphical size of the second signature pattern;

[0109] S52. Obtain the correction angle according to the angle category.

[0110] S53. Obtain the clipping box according to the correction angle, the first signature shape, and the graphical size.

[0111] S54. Cutting out a fourth signature pattern from the second signature pattern according to the cutting frame;

[0112] S55. Rotating the fourth signature pattern according to the correction angle to obtain the electronic signature.

[0113] The embodiment does not require the signature pattern to have obvious pattern edges or the signature pattern to have straightly arranged characters. The size of the cutting frame is calculated after the correction angle of the signature pattern is obtained by using the first classification model and the second classification model, the fourth signature pattern is cut out from the second signature pattern, and the electronic signature is obtained by rotating the fourth signature pattern according to the correction angle.

[0114] The following specific embodiments are referred to:

[0115] (1) Refer to the attached Figure 3 For the entity signature with the first signature shape being a circle, the cutting frame is calculated according to the following formula:

[0116] ;

[0117] wherein, D is the diameter of the entity signature with the first signature shape being a circle, W is the width of the second signature pattern, L is the length of the second signature pattern.

[0118] In fact, because the first signature shape is a circle, and are equal, at this time, the shape of the cutting frame is a square, the fourth signature pattern is cut out after the cutting frame is determined according to the correction angle, and the electronic signature is obtained by rotating the fourth signature pattern according to the correction angle (i.e. Figure 3 in the attached ) again.

[0119] (2) Refer to the attached Figure 4 For the long-shaped seal and the approximate handwritten signature, the cutting frame is calculated according to the following formula:

[0120] ;

[0121] ;

[0122] ;

[0123] ;

[0124] wherein, is the correction angle, is the complementary angle of the correction angle, is the length of the second signature pattern, is the width of the second signature pattern, is the length of the adjacent side of the first angle (i.e. the angle of ) in one of the right-angled triangles formed by the second signature pattern and the cutting frame, is the length of the adjacent side of the first angle (i.e. the angle of ) in the other of the right-angled triangles formed by the second signature pattern and the cutting frame, is the width of the cutting frame, is the length of the cutting frame.

[0125] It should be noted that after obtaining the correction angle and the graphic size of the second signature pattern, the maximum inscribed rectangle (i.e. the cutting frame) of the second signature pattern can be constructed, and the values of and can be obtained by calculating the distance between the corner point of the cutting frame and the adjacent corner point of the second signature pattern based on the pixel points.

[0126] In addition, because the cutting frame is placed obliquely, the values of and obtained by calculation are more rapid and accurate than those obtained based on the pixel points (each pixel point is approximately a square, the edge line of the cutting frame is a diagonal line in the pixel points, not horizontal or vertical, and if the image recognition algorithm is not accurate, the values of and obtained by calculation are also not accurate; if the image recognition algorithm is accurate, the operation amount of calculating and is also large, and the processing speed is slow); the processing after obtaining the cutting frame is the same as (1) above, and will not be described here.

[0127] (3) Referring to the attached drawings, Figure 5 for a square seal and an approximate handwritten signature, the cutting frame is calculated according to the following formula:

[0128] ;

[0129] ;

[0130] ;

[0131] ;

[0132] wherein is the correction angle, is the complementary angle of the correction angle, is the width of the second signature pattern, is the length of the second signature pattern, The second corner of one of the right triangles formed by the cutting frame of the second signature pattern (i.e., the angle is The length of the side adjacent to the angle, The second corner of one of the right triangles formed by the cutting frame of the second signature pattern (i.e., the angle is The length of the side opposite the angle), The side length of the cropping box.

[0133] In fact, because the first signature is square, and Equal, at this time the shape of the cropping box is a square and is the largest inscribed square of the second signature pattern. After determining the cropping box according to the correction angle, the fourth signature pattern can be cropped out, and finally the fourth signature pattern is rotated again according to the correction angle to obtain the electronic signature.

[0134] (4) Reference Figure 6 For oval seals, approximate handwritten signatures, and fingerprints, the cropping box is calculated according to the following formula:

[0135] ;

[0136] ;

[0137] ;

[0138] ;

[0139] ;

[0140] ;

[0141] ;

[0142] ;

[0143] ;

[0144] in, To correct the angle, is the complementary angle of the correction angle, It is half the width of the second signature pattern. The third angle of the right triangle is constructed with half the width of the second signature pattern as the right angle side (i.e., the angle is The length of the side opposite the angle), is the length of the hypotenuse of the right triangle constructed with half the width of the second signature pattern as the right angle side, a horizontal coordinate value of a first intersection point of the largest inscribed ellipse in the second signature pattern based on the correction angle and the second signature pattern, a vertical coordinate value of the first intersection point, half of a length of the clipping box, half of a width of the clipping box, a slope, a width of the clipping box, a length of the clipping box.

[0145] It should be noted that after the correction angle and the graphic size of the second signature pattern are obtained, the largest inscribed ellipse of the second signature pattern can be constructed, and the position coordinates of the first intersection point can be calculated based on the pixel points.

[0146] It should also be noted that the patterns and images of the embodiments herein are all size-determined pictures, and the graphic size (length and width) of the pictures can be obtained by a computer, or can be calculated according to the number of pixels in the vertical and horizontal directions of the picture combined with the unit pixel distance (i.e., the distance and coordinates based on the pixel points are calculated as described above, which is a prior art and will not be described again here).

[0147] In actual application, if the obtained electronic signature has a background matching the background color of the official document, the background of the electronic signature can be integrated with the background of the official document and can also be normally used, but if there is a difference between the background color of the electronic signature and the background color of the official document, the background color of the electronic signature needs to be adjusted to be consistent with the background color of the official document before it can be used (color difference will bring an uncoordinated visual effect, affecting the seriousness of the official document).

[0148] In some preferred embodiments, the specific steps in step S55 further include:

[0149] S551. removing the background in the fourth signature pattern to obtain an electronic signature.

[0150] In this embodiment, by setting a threshold value (for example, taking the brightness value 224), and converting the fourth signature pattern into a grayscale image, removing the pixel points greater than the threshold value, calculating a mask according to the grayscale image, and extracting the eighth signature pattern from the fourth signature pattern according to the mask, the background color of the eighth signature pattern at this time has been removed (which can be understood as a transparent background), and further performing erosion and Gaussian blur processing on the eighth signature pattern to remove edge jaggies, to obtain the final electronic signature. The electronic signature obtained in this way has no background color, so it can be used on various official documents with background colors at any time, and there is no need to adjust according to the background color of the official document when used.

[0151] Please refer to Figure 7 , Figure 7The electronic signature acquisition device is applied to an image processing system, and is integrated in a back-end control device of the electronic signature acquisition device in the form of a computer program. The electronic signature acquisition device comprises:

[0152] The acquisition module 100 is configured to acquire graphical information of the entity signature, and the graphical information comprises a first signature pattern and a first signature shape.

[0153] The first classification module 200 is configured to input the first signature pattern into a first classification model that has been trained to obtain a direction category to which the first signature pattern belongs; and the direction category comprises a positive category and a negative category.

[0154] The first adjustment module 300 is configured to adjust the first signature pattern according to the direction category to obtain a second signature pattern.

[0155] The second classification module 400 is configured to input the second signature pattern into a second classification model that has been trained to obtain an angle category to which the second signature pattern belongs.

[0156] The second adjustment module 500 is configured to adjust the second signature pattern according to the angle category and the first signature shape to obtain an electronic signature.

[0157] In some embodiments, the following steps are performed when the acquisition module 100 is configured to acquire graphical information of the entity signature, and the graphical information comprises a first signature pattern and a first signature shape:

[0158] S11. An image of a signature region is acquired; the signature region is a region in which the entity signature is signed.

[0159] S12. The image of the signature region is input into a signature detection model that has been trained to obtain graphical information of all entity signatures in the signature region.

[0160] In some embodiments, the following steps are performed when the acquisition module 100 is configured to acquire an image of a signature region; the signature region is a region in which the entity signature is signed:

[0161] S111. An image of a signature form is acquired, and the image of the signature form comprises a signature box.

[0162] S112. Corner point coordinates of four corner points of the signature box are acquired.

[0163] S113. The signature box is cropped as a first image according to the corner point coordinates.

[0164] S114. A rotation angle is calculated according to the corner point coordinates.

[0165] S115. The first image is corrected according to the rotation angle to obtain the image of the signature region.

[0166] In some embodiments, the signature detection model used in the acquisition module 100 is a model based on the Yolo-v5 neural network algorithm;

[0167] The signature detection model is trained by the following steps:

[0168] A1. Obtain corpus data, which includes a plurality of third signature patterns;

[0169] A2. Manually label the second signature shape of each third signature pattern in the corpus data using the LabelMe labeling tool, the second signature shape including a circle, a square, a rectangle, an ellipse, and an irregular shape;

[0170] A3. Train the signature detection model using the labeled corpus data to obtain a trained signature detection model.

[0171] In some embodiments, the following is performed when the first adjustment module 300 is used to adjust the first signature pattern according to the direction category to obtain the second signature pattern:

[0172] S31. If the direction category is positive, the first signature pattern is taken as the second signature pattern; if the direction category is negative, the first signature pattern is rotated by 180° to obtain the second signature pattern.

[0173] In some embodiments, the first classification model used in the first classification module 200 and the second classification model used in the second classification module 400 are both models based on the mobilenet-v2 neural network algorithm.

[0174] In some embodiments, the following is performed when the second adjustment module 500 is used to adjust the second signature pattern according to the angle category and the first signature shape to obtain the electronic signature:

[0175] S51. Obtain the graphic size of the second signature pattern;

[0176] S52. Obtain the correction angle according to the angle category;

[0177] S53. Obtain the clipping box according to the correction angle, the first signature shape, and the graphic size;

[0178] S54. Clip the fourth signature pattern from the second signature pattern according to the clipping box;

[0179] S55. Rotate the fourth signature pattern according to the correction angle to obtain the electronic signature.

[0180] Please refer to Figure 8 , Figure 8A structural schematic diagram of an electronic device provided by an embodiment of the present application, the present application provides an electronic device, comprising: a processor 1301 and a memory 1302, the processor 1301 and the memory 1302 are interconnected and communicate with each other through a communication bus 1303 and / or other forms of connection mechanism (not marked), the memory 1302 stores computer readable instructions executable by the processor 1301, when the electronic device runs, the processor 1301 executes the computer readable instructions to execute the electronic signature acquisition method in any optional implementation manner of the embodiment of the first aspect, to realize the following functions: obtaining the graphic information of the entity signature, the graphic information includes the first signature pattern and the first signature shape; input the first signature pattern into the first classification model which has completed training to obtain the direction category to which the first signature pattern belongs; the direction category includes positive class and negative class; adjust the first signature pattern according to the direction category, obtain the second signature pattern; input the second signature pattern into the second classification model which has completed training to obtain the angle category to which the second signature pattern belongs; adjust the second signature pattern according to the angle category and the first signature shape, obtain the electronic signature.

[0181] The embodiment of the present application provides a storage medium, which stores a computer program, and the computer program is executed by a processor to execute the electronic signature acquisition method in any optional implementation manner of the embodiment of the first aspect, to realize the following functions: obtaining the graphic information of the entity signature, the graphic information includes the first signature pattern and the first signature shape; input the first signature pattern into the first classification model which has completed training to obtain the direction category to which the first signature pattern belongs; the direction category includes positive class and negative class; adjust the first signature pattern according to the direction category, obtain the second signature pattern; input the second signature pattern into the second classification model which has completed training to obtain the angle category to which the second signature pattern belongs; adjust the second signature pattern according to the angle category and the first signature shape, obtain the electronic signature.

[0182] The storage medium can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0183] In the embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic, for example, the division of the units is merely a logical function division, and another division mode can be used in actual implementation, and for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.

[0184] In addition, the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiments.

[0185] Furthermore, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0186] In this paper, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations.

[0187] The above merely provides an example of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for obtaining an electronic signature, applied to an image processing system, characterized in that: Including steps: S1 obtains graphic information of the physical signature, the graphic information includes a first signature pattern and a first signature shape; S2. The first signature pattern is input into the first classification model that has been trained to obtain the direction category to which the first signature pattern belongs; The direction categories include positive and negative categories; S3 adjust the first signature pattern according to the direction category to obtain a second signature pattern; S4. The second signature pattern is input into the trained second classification model to obtain the angle category to which the second signature pattern belongs; S5. Adjust the second signature pattern according to the angle category and the shape of the first signature to obtain an electronic signature; The specific steps in step S3 include: S31. If the direction category is positive, the first signature pattern is used as the second signature pattern; if the direction category is negative, the first signature pattern is rotated 180° to obtain the second signature pattern; The specific steps in step S5 include: S51. Get the graphic size of the second signature pattern; S52. Obtaining the correction angle according to the angle category; S53 obtains a cropping box based on the correction angle, the shape of the first signature and the size of the graphic; S54. Cut out a fourth signature pattern from the second signature pattern according to the cutting box; S55. Rotate the fourth signature pattern according to the correction angle to obtain the electronic signature; The specific steps in step S55 also include: S551. removing the background of the fourth signature pattern to obtain an electronic signature; When the first signature is a circular physical signature, the cropping box in step S53 is obtained according to the following formula: ; in, is the diameter of the physical signature whose first signature shape is circular, is the width of the second signature pattern, is the length of the second signature pattern; When the first signature is in the shape of a rectangular handwritten signature, the cropping box in step S53 is obtained according to the following formula: ; ; ; ; in, To correct the angle, is the complementary angle of the correction angle, is the width of the second signature pattern, is the length of the second signature pattern, The second signature pattern is divided by the cutting box, and the angle is equal to one of the right triangles with the long side of the cutting box as the hypotenuse. The length of the right angle side adjacent to the angle, The second signature pattern is divided by the cutting box, forming a right triangle with the wide side of the cutting box as the hypotenuse and an angle equal to The length of the right angle side adjacent to the angle, is the width of the cropping box, The length of the cutting box; When the first signature is a square handwritten signature, the cropping box in step S53 is obtained according to the following formula: ; ; ; ; in, To correct the angle, is the complementary angle of the correction angle, is the width of the second signature pattern, is the length of the second signature pattern, The second signature pattern is divided by the cutting frame to form a right triangle with an angle equal to The length of the right angle side adjacent to the angle, The second signature pattern is divided by the cutting frame to form a right triangle with an angle equal to The length of the right angle side opposite to the angle, The side length of the cropping box.

2. The method for obtaining an electronic signature according to claim 1, wherein: The specific steps in step S1 include: S11 obtains the signature area image; the signature area is the area where the entity signature is signed; S12. Input the signature area image into a trained signature detection model to obtain the graphic information of all the entity signatures in the signature area.

3. The method for obtaining an electronic signature according to claim 2, wherein: The specific steps in step S11 include: S111 obtains a signature form image, wherein the signature form image includes a signature box; S112. Obtain the coordinates of the four corner points of the signature box; S113. Capture the signature box as the first image according to the corner coordinates; S114. Calculate the rotation angle according to the corner point coordinates; S115. Correct the first image according to the rotation angle to obtain the signature area image.

4. The method for obtaining an electronic signature according to claim 2, wherein: The signature detection model is a model based on the Yolo-v5 neural network algorithm; The signature detection model is trained through the following steps: A1 obtain corpus data, the corpus data includes a plurality of third signature patterns; A2. Using LabelMe annotation tools to manually mark out the second signature shape of each of the third signature patterns in the corpus data, the second signature shape includes a circle, square, rectangle, oval and irregular shape; A3. Use the annotated corpus data to train the signature detection model to obtain the trained signature detection model.

5. The method for obtaining an electronic signature according to claim 1, wherein: Both the first classification model and the second classification model are models based on the MobileNet-V2 neural network algorithm.

6. An electronic signature acquisition device, applied to an image processing system, characterized in that: The electronic signature acquisition device includes: An acquisition module, configured to acquire graphic information of a physical signature, wherein the graphic information includes a first signature pattern and a first signature shape; a first classification module, configured to input the first signature pattern into a trained first classification model to obtain a direction category to which the first signature pattern belongs; the direction category includes a positive category and a negative category; a first adjustment module, configured to adjust the first signature pattern according to the direction category to obtain a second signature pattern; a second classification module, configured to input the second signature pattern into a trained second classification model to obtain an angle category to which the second signature pattern belongs; A second adjustment module for adjusting the second signature pattern according to the angle category and the shape of the first signature to obtain an electronic signature; When the first adjustment module is used to adjust the first signature pattern according to the direction category to obtain the second signature pattern, the first adjustment module specifically performs the following steps: S31. If the direction category is positive, the first signature pattern is used as the second signature pattern; if the direction category is negative, the first signature pattern is rotated 180° to obtain the second signature pattern; The second adjustment module is used to adjust the second signature pattern according to the angle category and the shape of the first signature, and executes the following when obtaining the electronic signature: S51 obtains the graphic size of the second signature pattern; S52. Get the correction angle according to the angle category; S53. Get the cropping box based on the correction angle, the shape and size of the first signature; S54. Cut out the fourth signature pattern from the second signature pattern according to the cutting box; S55. According to the correction angle, rotate the fourth signature pattern to obtain an electronic signature; The second adjustment module is used to rotate the fourth signature pattern according to the correction angle to obtain the electronic signature. The specific steps in step S55 also include: S551. removing the background of the fourth signature pattern to obtain an electronic signature; When the first signature is a circular physical signature, the clipping box is obtained according to the following formula: ; in, is the diameter of the physical signature whose first signature shape is circular, is the width of the second signature pattern, is the length of the second signature pattern; When the first signature is a rectangular handwritten signature, the cropping box is obtained according to the following formula: ; ; ; ; in, To correct the angle, is the complementary angle of the correction angle, is the width of the second signature pattern, is the length of the second signature pattern, The second signature pattern is divided by the cutting box, forming a right triangle with the long side of the cutting box as the hypotenuse and an angle equal to The length of the right angle side adjacent to the angle, The second signature pattern is divided by the cutting box, forming a right triangle with the wide side of the cutting box as the hypotenuse and an angle equal to The length of the right angle side adjacent to the angle, is the width of the cropping box, The length of the cutting box; When the first signature is a square handwritten signature, the cropping box is obtained according to the following formula: ; ; ; ; in, To correct the angle, is the complementary angle of the correction angle, is the width of the second signature pattern, is the length of the second signature pattern, The second signature pattern is divided by the cutting frame to form a right triangle with an angle equal to The length of the right angle side adjacent to the angle, The second signature pattern is divided by the cutting frame to form a right triangle with an angle equal to The length of the right angle side opposite to the angle, The side length of the cropping box.

7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps of the method for obtaining an electronic signature according to any one of claims 1 to 5 are executed.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program executes the steps of the method for obtaining an electronic signature according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for correcting inclination angle of circular electronic seal

    CN113469888A

  • Seal recognition method and system based on deep learning and storage medium

    CN113901883A