Seal identification method, device, equipment, storage medium and computer program product
Through the method of viewing angle alignment processing and feature extraction, the comparison is combined with text distribution, feature point position and shape contour similarity, the problem of low accuracy of existing seal identification methods is solved, and higher identification accuracy and forgery recognition capabilities are achieved.
Patent Information
- Application Number
- CN202411722112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-08
AI Technical Summary
The existing seal identification methods are not accurate and it is difficult to effectively identify complex fraudulent behaviors, especially when faced with copying or local tampering of high-quality imitation seal images.
By obtaining the seal image to be identified and its corresponding seal base mold, and after performing the perspective alignment process, the features of the image and the base mold are extracted, including the text distribution similarity, the position similarity of feature points and the shape contour similarity, and these feature similarities are compared with the corresponding passing conditions to determine the identification results of the seal image.
By capturing the difference between the seal image and the seal base mold in multiple dimensions, the accuracy of the seal identification results is improved and the ability to identify forged seals is significantly enhanced.
Smart Images

Figure CN119785190A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of seal identification, and in particular to a seal identification method, device, equipment, storage medium and computer program product. Background Art
[0002] With the advancement of informatization, electronic contracts and electronic documents have become an important part of the daily business of enterprises, government departments and individuals. As the iconic symbol of electronic contracts and documents, electronic seals have legal effect, and their authenticity and legality directly affect the validity of documents.
[0003] Unlike traditional paper seals, electronic seals are easy to copy or tamper with. It is easy to bypass existing simple anti-counterfeiting measures by copying high-imitation seal images or partially tampering with them, making it difficult for related seal authentication methods that rely on security codes and digital signatures to provide sufficient authentication guarantees. Summary of the invention
[0004] The embodiments of the present application provide a seal identification method, device, equipment, storage medium and computer program product to at least solve the problem of low accuracy of existing seal identification.
[0005] In order to solve the above technical problems, this application is implemented as follows: In the first aspect, an embodiment of the present application provides a seal identification method, comprising: obtaining a seal image to be identified and a seal base mold corresponding to the seal image; performing perspective alignment processing on the seal image and the seal base mold to obtain a preprocessed seal image; extracting features of the preprocessed seal image and the seal base mold, and determining multiple feature similarities between the preprocessed seal image and the seal base mold based on the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity; comparing the multiple feature similarities with their respective corresponding passing conditions to determine the identification result of the seal image.
[0006] In the second aspect, an embodiment of the present application provides a seal identification device, comprising: a seal acquisition module, used to obtain a seal image to be identified and a seal base mold corresponding to the seal image; a seal alignment module, used to perform perspective alignment processing on the seal image and the seal base mold to obtain a preprocessed seal image; a feature extraction module, used to extract features of the preprocessed seal image and the seal base mold, and determine multiple feature similarities between the preprocessed seal image and the seal base mold based on the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity; a seal comparison module, used to compare the multiple feature similarities with their respective corresponding passing conditions to determine the identification result of the seal image.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect above are implemented.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the method described in the first aspect above.
[0010] In an embodiment of the present application, a seal image to be identified and a seal base mold corresponding to the seal image are obtained; the seal image and the seal base mold are aligned to obtain a pre-processed seal image; the features of the pre-processed seal image and the seal base mold are extracted, and multiple feature similarities between the pre-processed seal image and the seal base mold are determined based on the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity, and shape contour similarity; the multiple feature similarities are compared with the corresponding passing conditions to determine the identification result of the seal image. In this way, through the text distribution similarity, feature point position similarity, and shape contour similarity, the difference between the seal image and the seal base mold can be captured from multiple dimensions, and then the identification result of the seal image can be determined based on the multiple feature similarities, which can improve the accuracy of the identification result.
[0011] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0013] Figure 1 A schematic diagram of the flow of a seal identification method provided in an embodiment of the present application is shown; Figure 2 A schematic diagram showing a flow chart of a viewing angle alignment processing method provided in an embodiment of the present application is shown; Figure 3 A schematic diagram of the flow of the seal detection and text recognition method provided in the embodiment of the present application is shown; Figure 4 A schematic diagram of a flow chart of a method for determining an identification result provided in an embodiment of the present application is shown; Figure 5 A schematic diagram of the structure of a seal identification device provided in an embodiment of the present application is shown; Figure 6 Shows Figure 5 An example diagram of the workflow of the Chinese seal identification device; Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0014] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0015] Traditional seal authentication methods usually rely on manual operations, and relevant personnel judge the authenticity of the seal by observing the details, outlines, colors and other visible features of the seal. However, this method has significant limitations. First, the manual verification process is time-consuming and laborious, especially when faced with a large number of documents, the efficiency is extremely low, and it cannot meet the demand for speed in a modern office environment. Secondly, manual judgment is highly subjective, and the expert's experience, mood at the time, and even the working environment will affect the authentication results, resulting in misjudgment or inconsistent results. More importantly, with the continuous upgrading of counterfeiting methods, especially the use of image processing software to copy and modify seals, traditional manual authentication appears to be inadequate in dealing with these sophisticated counterfeiting techniques and it is difficult to accurately identify complex counterfeiting behaviors.
[0016] Existing electronic seal authentication technologies usually rely on means such as security codes or digital signatures. Although these technologies have improved the anti-counterfeiting of seals to a certain extent, they also have significant limitations. First, a single anti-counterfeiting technology is stretched to its limits when dealing with increasingly complex counterfeiting methods. Modern counterfeiting techniques can bypass simple anti-counterfeiting measures by copying high-imitation seal images, partially tampering, etc., resulting in these technologies being unable to provide sufficient authentication guarantees. Secondly, security codes and digital signatures mainly rely on the encryption and decryption process, lacking direct verification based on the seal image itself. This means that the system cannot effectively identify the visual details of the seal, especially when there are subtle differences in the appearance of the seal, which are difficult to detect with existing authentication methods. This limitation of lack of visual verification makes the authentication accuracy of security codes and digital signatures low when facing complex seal counterfeiting.
[0017] Figure 1 The flowchart of the seal identification method provided in the embodiment of the present application is shown. The execution subject of the method may be a terminal device or a server, wherein the terminal device may be a device such as a personal computer, or a mobile terminal device such as a mobile phone or a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server, or a server cluster composed of multiple servers, and the server may be a background server of a certain business, or a background server of a certain platform or application (for example, a seal identification tool, a seal identification system, an electronic contract platform, etc.). In the embodiment of the present application, the background server of the seal identification system as the execution subject is used as an example for explanation. For the case of the terminal device, it can be processed according to the following relevant content, which will not be repeated here. As shown in the figure, the method 100 may include the following steps: Step 101: Obtain a seal image to be authenticated and a seal base mold corresponding to the seal image.
[0018] The seal image to be identified may be a seal image input by a user, or a seal image identified from a document to be detected; the seal base is a standardized template image reserved and corresponding to the seal image.
[0019] In a specific implementation, the server can obtain the seal image to be identified by scanning or taking a photo, or can identify and extract the seal image in the document to be detected by a pre-trained seal detection model. The seal detection model can be built based on the YOLOv5 framework, and the YOLOv5 model is trained by a large amount of sample data to optimize its parameters, and finally a seal detection model for seal detection is obtained. After obtaining the seal image to be identified, the seal base mold corresponding to the seal image can be determined according to the text in the seal image.
[0020] Step 102: performing perspective alignment processing on the seal image and the seal base mold to obtain a pre-processed seal image.
[0021] In the specific implementation, Figure 2 As shown, performing perspective alignment processing on the seal image and the seal base to obtain a pre-processed seal image may include the following steps: Step 1021: Obtain the seal image and seal base to be authenticated; Step 1022: inputting the seal image and the seal base into a feature point extraction and matching network, and determining matching point pairs through the feature point extraction and matching network; Specifically, the SuperPoint network can be used to extract feature points from the seal image and the seal base respectively, and then a SuperGlue network can be cascaded to perform feature point matching to obtain matching point pairs.
[0022] In this way, compared with traditional feature point extraction and matching schemes, the neural network-based method used is more robust, has fewer mismatched points, and performs better in weak texture areas.
[0023] Step 1023: Determine a homography matrix according to the matching point pairs; Specifically, after obtaining the matching point pairs, the RANSAC method is used to calculate the homography matrix between the extracted seal image and the seal base.
[0024] Step 1024: transform the image's viewing angle using the homography matrix to accurately align the acquired seal image onto the seal base mold; Step 1025: Obtain a pre-processed seal image.
[0025] The seal image and the seal base may have inconsistent perspectives due to shooting angles, deformation, etc. By aligning the perspectives of the seal image and the seal base, the seal image and the seal base can be made more consistent in space, so as to maintain consistency during subsequent feature extraction and comparison.
[0026] Step 103: extracting features of the preprocessed seal image and the seal base, and determining multiple feature similarities between the preprocessed seal image and the seal base based on the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity.
[0027] In a specific implementation, the features of the pre-processed seal image and the seal base are extracted, such as text, shape, texture, etc., and multiple feature similarities between them are calculated, wherein the multiple similarities include text distribution similarity, feature point position similarity and shape contour similarity. The text distribution similarity is used to indicate the matching degree between the distribution of the text in the pre-processed seal image and the distribution of the text in the seal base; the feature point position similarity is used to indicate the matching degree between the feature points in the pre-processed seal image and the feature points in the seal base; the shape contour similarity is used to indicate the matching degree between the seal contour of the pre-processed seal image and the seal contour of the seal base.
[0028] In this way, the differences between the seal image and the seal base can be captured from multiple dimensions through text distribution similarity, feature point position similarity and shape contour similarity.
[0029] Step 104: Compare the multiple feature similarities with their corresponding passing conditions to determine the identification result of the seal image.
[0030] In a specific implementation, the text distribution similarity, feature point position similarity and shape contour similarity are compared with the corresponding passing conditions to obtain the identification result of the seal image. For example, when it is determined that the text distribution similarity, feature point position similarity and shape contour similarity all meet the corresponding passing conditions, the seal image is determined to be a genuine seal image, otherwise, the seal image is determined to be a fake seal image.
[0031] In this way, determining the identification result of the seal image based on the similarity of multiple features can reduce the situation where inaccurate identification is caused by insufficient or error in a single feature, and improve the accuracy of the identification result.
[0032] In a possible implementation, in the above step 101, obtaining the seal image to be identified and the seal base corresponding to the seal image includes: Acquire a seal image to be identified; determine the seal category of the seal image; acquire a target base mold corresponding to the seal type from multiple base molds in a seal and imprint library, and determine the target base mold as the seal base mold corresponding to the seal image.
[0033] In an embodiment of the present application, after obtaining the seal image to be identified, the seal text content in the seal image can be identified by a pre-trained seal text recognition network to obtain a text sequence. For example, the obtained text sequence is "ABC Technology Company", wherein a seal text recognition network for efficiently and accurately identifying the seal text content can be obtained by training an end-to-end Img2Seq network model. Furthermore, the seal category of the seal image is determined according to the text sequence, wherein the seal category can be classified according to purpose, text content, etc., for example, company seal, contract seal, financial seal, etc. According to the text sequence "ABC Technology Company", it can be determined that the seal type of the seal image is a company seal, and according to the seal category, a seal base mold matching the seal category is found in the seal and seal library.
[0034] In an exemplary embodiment, if Figure 3 As shown in , the seal detection and text recognition method mentioned above may include the following steps: Step 1011: Obtain the document to be detected; Step 1012: inputting the document to be detected into the seal detection network, and identifying the seal image to be identified in the document to be detected through the seal detection network; Step 1013: obtaining a seal image to be authenticated; Step 1014: inputting the seal image to be identified into the seal character recognition network, and identifying the character sequence in the seal image through the seal character recognition network; Step 1015: Obtain the text sequence in the seal image.
[0035] In a possible implementation, in the above step 103, the method of obtaining the text distribution similarity includes: Obtain a first wrapping angle between any two adjacent text center points and the geometric center point in the preprocessed seal image, and obtain a second wrapping angle between any two adjacent text center points and the geometric center point in the seal base; determine the text distribution similarity based on the first wrapping angle and the second wrapping angle.
[0036] In the embodiment of the present application, the difference in text arrangement can be detected by analyzing the angle distribution of the surrounding text on the seal image relative to the center. If the text surrounding angle of the seal image to be identified is significantly different from the reserved seal bottom mold, it may be a counterfeit seal.
[0037] For example, the seal text detection model trained with actual samples can be used based on the YOLOv5 framework to locate the text on the seal image. Subsequently, the center of the seal is located using Hough transform, and the text wrapping angle is determined by calculating the relative position between the center coordinates of the text detection frame and the center coordinates of the circle. The above operations are performed on the obtained pre-processed seal image and the seal base mold respectively. If there is a significant deviation in the text wrapping angles of the two, the seal image is a fake seal image, and an alarm is triggered.
[0038] Specifically, suppose that K The characters can be connected to the center of the circle to form K -1 angle. The first wrap angle in the pre-processed stamp image is recorded as The second wrap angle in the stamp base is recorded as The similarity between the two can be compared by the angle difference, and the formula is as follows: ; in: S 1 is the text distribution similarity, and the value range is [0,1]; and Represents the pre-processed seal image and the seal base mold i The corresponding angles; is the normalization coefficient used to normalize the angle difference to between 0 and 1. When the angles are different, it indicates that they are completely consistent and the similarity is 1; when the angle difference is large, the similarity decreases.
[0039] The above formula can effectively evaluate the similarity of the wrapping angle between the pre-processed seal image and the seal base in the text arrangement. S 1 is lower than a certain set similarity threshold, it can be considered that there is a large deviation in the text arrangement between the seal image to be identified and the seal base mold.
[0040] In a possible implementation, in the above step 103, the method for obtaining the feature point position similarity includes: The first feature points of the preprocessed seal image and the seal base are extracted by a first extraction method; the second feature points of the preprocessed seal image and the seal base are extracted by a second extraction method, and the first extraction method and the second extraction method use different feature point extraction strategies to extract feature points; the first difference between the first feature point of the preprocessed seal image and the first feature point of the seal base, and the second difference between the second feature point of the preprocessed seal image and the second feature point of the seal base are determined; and the similarity of the feature point positions is determined based on the first difference and the second difference.
[0041] In the embodiment of the present application, feature points in the pre-processed seal image and the seal base can be extracted, and then the geometric position consistency of the detail features of the two can be compared by matching these feature points. If the position differences of many feature points are too large, it indicates that the seal may be forged in terms of structural details.
[0042] Exemplarily, the first feature points of the preprocessed seal image and the seal base, namely, the SIFT feature points, can be extracted through the Scale-Invariant Feature Transform (SIFT) algorithm; the second feature points of the preprocessed seal image and the seal base, namely, the ORB feature points, can be extracted through the ORB (Oriented FASTand Rotated BRIEF) algorithm based on Features from Accelerated Segment Test (FAST) and Binary Robust Independent Elementary Features (BRIEF); and the comparison results of the two are combined to improve the reliability of the similarity measurement.
[0043] In order to reduce the impact of noise on the matching process, the feature point pairs with the top 20% matching scores can be further screened out as the basis for similarity calculation. This can ensure that the feature point pairs involved in the similarity calculation have high matching reliability and can effectively reduce the interference caused by image noise or feature point mismatching.
[0044] The SIFT feature points matched on the pre-processed seal image and the seal base are recorded as and ; The matched ORB feature points are recorded as and , the feature point position similarity can be obtained by the following formula:
[0045] in, D sift It is the difference based on SIFT feature point comparison; D orb It is the difference based on ORB feature point comparison; Represents the Euclidean distance between two pixels; represents the unit step function, ; is the position difference threshold. If the position difference of the feature point exceeds this threshold, it is judged as a position error. S 2 is the similarity of feature point positions, and its value range is [0,1]; w 1 and w 2 are D sift and D orb The sum of the two is 1. Since SIFT feature points have better stability and accuracy, SIFT feature point comparison can be used as the main method in similarity measurement, and ORB feature point comparison can be used as a supplement. S 2 is lower than a certain set similarity threshold, it can be considered that there is a large deviation between the detailed structural features of the seal image to be identified and the seal base mold.
[0046] In a possible implementation, in the above step 103, the method of obtaining the shape contour similarity includes: Acquire a first mask pixel set of the preprocessed seal image and a second mask pixel set of the seal base; determine a difference between the first mask pixel set and the second mask pixel set, and determine the ratio of the number of pixels in the difference to the number of pixels in the second mask pixel set as a mask difference; and determine the shape contour similarity based on the mask difference.
[0047] In an embodiment of the present application, the seal mask can be extracted from the preprocessed seal image and the seal base mold respectively, and then the similarity of their shape contours can be measured by calculating the overlap between the two. If the overlap is low, it means that there is a large difference between the contour or edge shape of the seal and the base mold, and it may be a fake seal image.
[0048] For example, the OTSU (Otsu's Method) algorithm can be used to perform adaptive binarization on the preprocessed seal image and the seal base, where the pixel value of the seal area is set to 1 and the pixel value of the background area is set to 0. The first mask pixel set of the preprocessed seal image is A, and the second mask pixel set of the seal base is B. Considering that in the actual seal extraction process, some pixels may be missing or incomplete due to too light color or other reasons, a mask comparison method based on set difference is proposed to measure the difference between the two. The formula is as follows:
[0049] in, S 3 is the shape contour similarity, with a value range of [0,1]; is a difference set, representing the set of elements in the first mask pixel set A but not in the second mask pixel set B; Represents the size of the set, that is, the number of pixels. By calculating the difference between A and B, the ratio of the difference to the number of pixels in B is used to determine the mask difference, and then the shape contour similarity is determined based on the mask difference. If S 3 If the similarity is lower than a certain set threshold, it can be considered that the shape contour of the seal to be identified and the base mold is too different.
[0050] In a possible implementation, in the above step 104, comparing the plurality of feature similarities with the corresponding passing conditions to determine the identification result of the seal image includes: When the multiple feature similarities all satisfy their respective corresponding passing conditions, the seal image is determined to be a genuine seal image; when any feature similarity among the multiple feature similarities fails to satisfy the corresponding passing condition, the seal image is determined to be a fake seal image.
[0051] In an exemplary embodiment, if Figure 4 As shown, the identification result determination method may include the following steps: Step 1041: Obtain the seal image and seal base to be authenticated; Step 1042: performing perspective alignment processing on the seal image and the seal base to obtain a pre-processed seal image, extracting features of the pre-processed seal image and the seal base, and determining the text distribution similarity between the pre-processed seal image and the seal base according to the features; Step 1043: compare the text distribution similarity with the corresponding pass condition. If it passes, proceed to step 1044; if it fails, the seal image is a fake seal image, triggering an alarm; Step 1044: determining the similarity of the feature point positions between the pre-processed seal image and the seal base mold according to the features; Step 1045: Compare the feature point position similarity with the corresponding pass condition. If it passes, proceed to step 1046; if it fails, the seal image is a fake seal image, triggering an alarm; Step 1046: determining the shape contour similarity between the pre-processed seal image and the seal base mold according to the features; Step 1047: Compare the shape contour similarity with the corresponding passing condition. If it passes, the seal image is a genuine seal image and the process ends; if it fails, the seal image is a fake seal image and an alarm is triggered.
[0052] In this way, in order to address the common flaws in counterfeit seals, the embodiments of the present application propose three comparison schemes: text distribution comparison, feature point position comparison, and shape contour comparison, to obtain text distribution similarity, feature point position similarity, and shape contour similarity, respectively. If any of the comparison schemes fails, the seal identification system determines that the seal image may be suspected of counterfeiting and triggers an alarm. Through the text distribution similarity, feature point position similarity, and shape contour similarity, the differences between the seal image and the seal base can be captured from multiple dimensions, significantly improving the recognition rate of counterfeit seals, and thus effectively meeting the needs of identifying the vast majority of counterfeit seals.
[0053] Figure 5 The structure diagram of the seal identification device provided in the embodiment of the present application is shown. The seal identification device can be implemented as follows: Figure 1 In the embodiment shown in the figure, the seal identification device 500 comprises: A seal acquisition module 510 is used to acquire a seal image to be identified and a seal base mold corresponding to the seal image; A seal alignment module 520 is used to perform perspective alignment processing on the seal image and the seal base to obtain a pre-processed seal image; A feature extraction module 530 is used to extract features of the pre-processed seal image and the seal base, and determine multiple feature similarities between the pre-processed seal image and the seal base according to the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity; The seal comparison module 540 is used to compare the multiple feature similarities with the corresponding passing conditions to determine the identification result of the seal image.
[0054] In a possible implementation, the seal acquisition module 510, when used to acquire the seal image to be identified and the seal base corresponding to the seal image, is specifically used to: Acquire the seal image to be authenticated; Determining the seal category of the seal image; A target base mold corresponding to the seal type is obtained from a plurality of base molds in a seal and imprint library, and the target base mold is determined as the seal base mold corresponding to the seal image.
[0055] In a possible implementation, the method of obtaining the text distribution similarity includes: Obtaining a first wrapping angle between any two adjacent character center points and a geometric center point in the preprocessed seal image, and obtaining a second wrapping angle between any two adjacent character center points and a geometric center point in the seal bottom mold; The text distribution similarity is determined according to the first surrounding angle and the second surrounding angle.
[0056] In a possible implementation, the method for obtaining the feature point position similarity includes: Extracting first feature points of the pre-processed seal image and the seal bottom mold by a first extraction method; extracting second feature points of the pre-processed seal image and the seal bottom mold by a second extraction method, wherein the first extraction method and the second extraction method use different feature point extraction strategies to extract feature points; Determine a first difference between a first feature point of the preprocessed seal image and a first feature point of the seal bottom mold, and a second difference between a second feature point of the preprocessed seal image and a second feature point of the seal bottom mold; The feature point position similarity is determined according to the first difference and the second difference.
[0057] In a possible implementation, the method for obtaining the shape contour similarity includes: Acquire a first mask pixel set of the preprocessed seal image and a second mask pixel set of the seal bottom mold; Determine a difference set between the first mask pixel set and the second mask pixel set, and determine a ratio of the difference set to the number of pixels in the second mask pixel set as a mask difference; The shape contour similarity is determined according to the mask difference.
[0058] In a possible implementation, the seal comparison module 540, when used to compare the plurality of feature similarities with the corresponding passing conditions to determine the identification result of the seal image, is specifically used to: In the case where the plurality of feature similarities all satisfy the corresponding passing conditions, determining that the seal image is a genuine seal image; When any feature similarity among the plurality of feature similarities fails to satisfy a corresponding passing condition, the seal image is determined to be a fake seal image.
[0059] In an exemplary embodiment, if Figure 6 As shown, the workflow of the seal identification device 500 is as follows: Step 601: input the document to be detected into the seal acquisition module 510; Step 6021: the seal acquisition module 510 acquires the seal image to be identified in the document to be detected; Step 6022: the seal acquisition module 510 determines the seal type of the seal image; obtains a target base mold corresponding to the seal type from multiple base molds in the seal and imprint library, and determines the target base mold as the seal base mold corresponding to the seal image. If the seal base mold is not retrieved, an alarm is triggered; Step 603: inputting the seal image to be identified into the seal alignment module 520, and performing perspective alignment processing on the seal image and the seal base through the seal alignment module 520 to obtain a pre-processed seal image; Step 604: inputting the pre-processed seal image and the seal base mold into the feature extraction module 530, extracting features of the pre-processed seal image and the seal base mold through the feature extraction module 530, and determining multiple feature similarities between the pre-processed seal image and the seal base mold according to the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity; Step 605: Input multiple feature similarities into the seal comparison module 540, and compare the multiple feature similarities with their corresponding passing conditions through the seal comparison module 540. If the comparison passes, the process ends; if the comparison fails, an alarm is triggered.
[0060] In this way, through the similarity of text distribution, feature point position similarity and shape contour similarity, the difference between the seal image and the seal base can be captured from multiple dimensions, and then the identification result of the seal image can be determined based on multiple feature similarities, which can improve the accuracy of the identification result.
[0061] Figure 7 The hardware structure diagram of the electronic device provided by the embodiment of the present application is shown. Referring to the figure, at the hardware level, the electronic device 700 includes a processor 710, and optionally, includes an internal bus 720, a network interface 730, and a memory 740. Among them, the memory 740 may include a memory 741, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory 742 (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device 700 may also include hardware required for other services.
[0062] The processor 710, the network interface 730 and the memory may be interconnected via an internal bus 720, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0063] The memory 740 stores programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions. The memory 740 may include a memory 741 and a non-volatile memory 742, and provide instructions and data to the processor 710.
[0064] The processor 710 reads the corresponding computer program from the non-volatile memory 742 into the memory and then runs it, forming a device for locating the target user at the logical level. The processor 710 executes the program stored in the memory and specifically performs: Figure 1 or Figure 6 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0065] The above application Figure 1 or Figure 6The method disclosed in the illustrated embodiment can be applied to the processor 710 or implemented by the processor 710. The processor 710 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 710. The above processor 710 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0066] The computer device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0067] Of course, in addition to software implementation, the electronic device 700 of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0068] The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 1 or Figure 6 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0069] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0070] Furthermore, an embodiment of the present application also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following process is implemented: Figure 1 or Figure 6 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0071] The embodiments of the present application can be applied to various electronic device collaboration or interconnection scenarios, including: collaboration and interconnection between mobile phones and laptops / tablet computers; collaboration and interconnection between mobile terminals and smart TVs / displays; collaboration and interconnection between mobile phones or tablet computers and in-car entertainment systems; collaboration and interconnection between mobile terminals and smart conference systems, etc., so as to meet the needs of users in various scenarios such as smart homes, smart offices, and smart travel.
[0072] In short, the above is only a preferred embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0073] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0074] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0075] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0076] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A seal identification method, characterized in that: include: Obtaining a seal image to be authenticated and a seal base mold corresponding to the seal image; Performing visual angle alignment processing on the seal image and the seal base mold to obtain a pre-processed seal image; Extracting features of the preprocessed seal image and the seal base, and determining multiple feature similarities between the preprocessed seal image and the seal base according to the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity; The plurality of feature similarities are compared with the corresponding passing conditions to determine the identification result of the seal image.
2. The method according to claim 1, characterized in that The step of obtaining the seal image to be identified and the seal base mold corresponding to the seal image comprises: Acquire a seal image to be authenticated; Determining the seal category of the seal image; A target base mold corresponding to the seal type is obtained from a plurality of base molds in a seal and imprint library, and the target base mold is determined as the seal base mold corresponding to the seal image.
3. The method according to claim 1, characterized in that The method for obtaining the text distribution similarity includes: Obtaining a first wrapping angle between any two adjacent character center points and a geometric center point in the preprocessed seal image, and obtaining a second wrapping angle between any two adjacent character center points and a geometric center point in the seal bottom mold; The text distribution similarity is determined according to the first surrounding angle and the second surrounding angle.
4. The method according to claim 1, characterized in that The method for obtaining the feature point position similarity includes: Extracting first feature points of the pre-processed seal image and the seal bottom mold by a first extraction method; extracting second feature points of the pre-processed seal image and the seal bottom mold by a second extraction method, wherein the first extraction method and the second extraction method use different feature point extraction strategies to extract feature points; Determine a first difference between a first feature point of the preprocessed seal image and a first feature point of the seal bottom mold, and a second difference between a second feature point of the preprocessed seal image and a second feature point of the seal bottom mold; The feature point position similarity is determined according to the first difference and the second difference.
5. The method according to claim 1, characterized in that The method for obtaining the shape contour similarity includes: Acquire a first mask pixel set of the preprocessed seal image and a second mask pixel set of the seal bottom mold; Determine a difference set between the first mask pixel set and the second mask pixel set, and determine a ratio of the difference set to the number of pixels in the second mask pixel set as a mask difference; The shape outline similarity is determined according to the mask difference.
6. The method according to any one of claims 1 to 5, characterized in that: The step of comparing the plurality of feature similarities with the corresponding passing conditions to determine the identification result of the seal image includes: When the plurality of feature similarities all satisfy the corresponding passing conditions, determining that the seal image is a genuine seal image; When any feature similarity among the plurality of feature similarities fails to satisfy a corresponding passing condition, the seal image is determined to be a fake seal image.
7. A seal identification device, characterized in that: include: A seal acquisition module, used to acquire a seal image to be identified and a seal base mold corresponding to the seal image; A seal alignment module, used for performing perspective alignment processing on the seal image and the seal base mold to obtain a pre-processed seal image; A feature extraction module, used for extracting features of the pre-processed seal image and the seal base, and determining multiple feature similarities between the pre-processed seal image and the seal base according to the features, wherein the multiple feature similarities include text distribution similarity, feature point position similarity and shape contour similarity; The seal comparison module is used to compare the multiple feature similarities with the corresponding passing conditions to determine the identification result of the seal image.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer is caused to perform the steps of the method according to any one of claims 1 to 6.