Method and system for judging consistency and authenticity of seal based on content and anti-counterfeiting line

By analyzing the image characteristics and anti-counterfeiting line details of the seal, the consistency and authenticity judgment of the seal are achieved, and the problem of low accuracy in seal identification in the existing technology is solved, and efficient and accurate judgment of the authenticity of the seal is achieved.

CN119693961APending Publication Date: 2025-03-25CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD HEBEI BRANCH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411763459.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

It is difficult for the existing technology to efficiently and accurately identify the authenticity of seals, especially when facing high-impact forgery seals, the accuracy of traditional methods has decreased and cannot meet the requirements of modern society for seal safety.

Method used

By analyzing the image characteristics of the seal, introducing the microscopic details of the seal anti-counterfeiting line for comparison, the consistency and authenticity of the seal are achieved. The method includes steps such as data preprocessing, seal detection and recognition, appearance authenticity judgment, text consistency judgment and anti-counterfeiting line comparison.

Benefits of technology

It realizes efficient and accurate seal consistency and authenticity judgment, reduces dependence on professional equipment and complex processes, reduces application costs and improves promotion, simplifies the authenticity judgment process of seals, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693961A_ABST
    Figure CN119693961A_ABST
Patent Text Reader

Abstract

The invention discloses a seal consistency and authenticity judgment method and system based on content and an anti-counterfeiting line, and relates to the technical field of image recognition. The method comprises the following steps: acquiring and preprocessing user input data, wherein the user input data comprises a to-be-analyzed seal image and reference benchmark seal information; judging the reference standard seal information; performing seal detection and identification based on a seal image in the preprocessed user input data; based on a seal image in the preprocessed user input data, carrying out authenticity judgment on the appearance of the seal, and generating a seal authenticity result; according to the text content in the seal information and the reference seal content, seal consistency judgment is carried out, and a seal consistency judgment result is generated; and performing anti-counterfeiting line detection analysis according to the preprocessed to-be-analyzed seal image and the reference seal image, generating an anti-counterfeiting line comparison result, and outputting a seal authenticity result according to a preset threshold value. According to the invention, efficient and accurate seal consistency and authenticity judgment can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a method and system for judging the consistency and authenticity of a seal based on content and a security line. Background Art

[0002] With the rapid development of my country's social economy, the importance of seals in various economic activities, administrative management and legal affairs has become increasingly prominent. As an important identification of the identity of an organization or individual, seals are widely used, including contract signing, document approval, financial reimbursement and other links. However, due to the popularization of seal production technology and the diversification of counterfeiting methods, the problem of seal authenticity identification is becoming increasingly serious, bringing many hidden dangers to social order and economic development.

[0003] At present, the common seal authenticity identification method on the market is mainly to judge by human eyes by observing the shape, color, font and other characteristics of the seal. This method is highly subjective and easily affected by human factors, and it is not effective in identifying highly simulated forged seals. With the diversification of seal forgery methods, traditional authenticity identification methods can no longer meet the requirements of modern society for seal security. Therefore, the development of an efficient and accurate seal authenticity judgment algorithm is not only an inevitable trend of technological development, but also an urgent need to safeguard national interests, maintain social order, and protect the rights and interests of the people.

[0004] Prior art 1, "A seal authenticity identification method and system", is based on the comparison of two images, the original seal pattern and the seal pattern to be compared, using a preset sampling area for local comparison screening and selecting special points on the pattern for line comparison. This method strictly relies on the original seal pattern, and in the face of the diversity of seal types, text occlusion, background interference, etc. in actual applications, this method based on the preset area and point selection operation will reduce accuracy in actual applications.

[0005] Prior art 2, "A seal authenticity identification method and system based on OCR recognition", this method matches the corresponding seal reference image according to the seal pattern features and seal text features of the target seal image, and determines the authenticity of the seal by calculating the image similarity between the target seal image and the seal reference image. This patent also strictly relies on the seal reference image, and cannot accurately identify the appearance of the replica forged seal.

[0006] Prior art three, "Seal authenticity inspection method, device, storage medium and electronic device", the patent first obtains the pixel information of the seal object, and then determines the color space characteristics, grayscale characteristics, edge sharpness and spatial characteristics, and local noise characteristics of the seal based on the seal pixel information, and finally determines the authenticity of the seal object based on the above characteristics. This method makes judgments based on the appearance of the seal, but it will misjudge electronic seals, and cannot accurately identify problems such as wrong seals. Summary of the invention

[0007] In order to overcome the above problems or at least partially solve the above problems, the present invention provides a method and system for judging the consistency and authenticity of a seal based on content and security thread. By analyzing the image features of the seal and introducing the microscopic details of the seal security thread for analysis and comparison, efficient and accurate seal consistency and authenticity judgment can be achieved.

[0008] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0009] In a first aspect, the present invention provides a method for determining the consistency and authenticity of a seal based on content and a security thread, comprising the following steps:

[0010] S1, obtaining and preprocessing user input data, wherein the user input data includes a seal image to be analyzed and reference seal information;

[0011] S2, judging the reference reference seal information, if the reference reference seal information is empty, executing steps S3 and S4; if the reference reference seal information is the reference seal content, executing steps S3 and S5; if the reference reference seal information is the reference seal image, executing steps S3, S5 and S6;

[0012] S3, based on the seal image in the pre-processed user input data, performing seal detection and recognition to determine the seal information;

[0013] S4, based on the seal image in the pre-processed user input data, judging the authenticity of the seal appearance and generating a seal authenticity result;

[0014] S5, performing seal consistency judgment based on the text content in the seal information and the reference seal content, and generating a seal consistency judgment result;

[0015] S6. Perform security thread detection and analysis based on the preprocessed seal image to be analyzed and the reference seal image, generate a security thread comparison result, and output the seal authenticity result based on a preset threshold.

[0016] The present invention compares the seal recognition content and seal features on the image to be detected with the information provided by the user, completes the seal consistency judgment and the seal authenticity analysis, ensures the accuracy and authenticity of the seal on the document to be detected, and the method can be modularly integrated into the application system, reducing the dependence on professional equipment and complex processes, reducing the application cost and improving the promotion. The present invention provides an accurate and efficient seal consistency and authenticity judgment method, simplifies the seal authenticity judgment process, improves work efficiency, and reduces the economic losses and legal risks caused by wrong stamps and fake stamps.

[0017] Based on the first aspect, further, the method for preprocessing user input data comprises the following steps:

[0018] Perform format conversion, image enhancement, and noise removal on the seal image to be analyzed;

[0019] Extracting effective text content and coded content from the reference seal content in the reference seal information;

[0020] The reference seal image in the reference seal information is subjected to various operations such as format conversion, image enhancement and noise removal.

[0021] Based on the first aspect, further, the method for seal detection and recognition based on the seal image in the preprocessed user input data comprises the following steps:

[0022] Using target detection technology to locate and detect the position information and corresponding seal shapes of all seals from the pre-processed seal image to be analyzed or the reference seal image;

[0023] According to the position information of the seal, a single seal image is cut out from the original image in sequence, each seal image is classified, and the shape and color of the seal are judged, and the seal shape and seal color information are output;

[0024] According to the position information of the seal, the seal image is segmented to separate the seal from the background to obtain a corresponding seal segmentation image;

[0025] The seal segmentation image is rotated and corrected, and the annular seal is stretched based on the polar coordinate transformation operation; the text position in the image is located, and the seal content is recognized based on the OCR algorithm to obtain the seal's annular text content, horizontal text content and coded content.

[0026] Based on the first aspect, further, the seal consistency and authenticity judgment method based on content and anti-counterfeiting thread further includes the following steps:

[0027] According to the spacing and horizontal coordinates of the text boxes of the circular text content of the seal, the text boxes are reordered, and the non-circular text is filtered out using a variety of prior information such as the height of the circular text and its position in the image;

[0028] The filtered circular text is spliced ​​to obtain the complete seal circular text recognition result.

[0029] Based on the first aspect, further, the method for judging the authenticity of the seal appearance based on the seal image in the preprocessed user input data comprises the following steps:

[0030] Binarization of the seal image is performed based on the preset seal standard color;

[0031] Use binary morphological erosion and dilation operations to fill in the uneven color details of the stamp to obtain the filled stamp image;

[0032] The connected domain analysis method is used to calculate the connected domain area boundary box of each character in the filled seal image, and analyze whether the connected domain boundary box of each character is consistent with the standard rectangular box of the preset seal standard font to generate the seal authenticity result.

[0033] Based on the first aspect, further, the method for performing seal consistency judgment based on the text content in the seal information and the reference seal content to generate a seal consistency judgment result comprises the following steps:

[0034] Extracting the characters to be detected and the codes to be detected from the text content, and extracting the reference characters and the reference codes from the reference seal content;

[0035] Calculate the edit distance between the text to be detected and the reference text, and between the code to be detected and the reference code respectively;

[0036] If any edit distance is greater than a preset distance threshold, the text content is deemed inconsistent.

[0037] Based on the first aspect, further, the method for detecting and analyzing the security thread according to the preprocessed seal image to be analyzed and the reference seal image comprises the following steps:

[0038] The seal image to be analyzed and the reference seal image are respectively subjected to image segmentation, image alignment, center interference removal, binarization, and annular block cutting operations to obtain a plurality of annular image sub-blocks corresponding to the seal image to be analyzed and the reference seal image;

[0039] Connected domain analysis is performed on each annular image sub-block, and similarity is performed based on the connected domain features to determine the similarity between the seal image to be analyzed and the reference seal image, and a security line comparison result of the seal image to be analyzed and the reference seal image is generated.

[0040] In a second aspect, the present invention provides a seal consistency and authenticity judgment system based on content and security thread, including a data preprocessing module, a reference information judgment module, a seal detection and recognition module, an appearance authenticity judgment module, a seal consistency judgment module and a security thread analysis module, wherein:

[0041] A data preprocessing module, used for acquiring and preprocessing user input data, wherein the user input data includes a seal image to be analyzed and reference base seal information;

[0042] A reference information judgment module, used to judge the reference seal information;

[0043] A seal detection and recognition module is used to perform seal detection and recognition based on the seal image in the pre-processed user input data to determine the seal information;

[0044] An appearance authenticity judgment module is used to judge the authenticity of the seal appearance based on the seal image in the pre-processed user input data and generate a seal authenticity result;

[0045] A seal consistency judgment module is used to judge the seal consistency according to the text content in the seal information and the reference seal content, and generate a seal consistency judgment result;

[0046] The security thread analysis module is used to perform security thread detection and analysis based on the preprocessed seal image to be analyzed and the reference seal image, generate security thread comparison results, and output the authenticity result of the seal according to a preset threshold.

[0047] This system, through the cooperation of multiple modules such as data preprocessing module, reference information judgment module, seal detection and recognition module, appearance authenticity judgment module, seal consistency judgment module and anti-counterfeiting line analysis module, compares the seal recognition content and seal features on the image to be detected with the information provided by the user, completes the seal consistency judgment and the seal authenticity analysis, ensures the accuracy and authenticity of the seal on the document to be detected, and the method can be modularly integrated into the application system, reducing the dependence on professional equipment and complex processes, reducing application costs and improving promotion. The present invention provides an accurate and efficient seal consistency and authenticity judgment method, simplifies the seal authenticity judgment process, improves work efficiency, and reduces the economic losses and legal risks caused by wrong seals and fake seals.

[0048] In a third aspect, the present application provides an electronic device, comprising a memory for storing one or more programs; a processor; when the one or more programs are executed by the processor, the method as described in any one of the first aspects above is implemented.

[0049] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of the first aspects above.

[0050] The present invention has at least the following advantages or beneficial effects:

[0051] 1. The user inputs information flexibly, and the seal consistency and authenticity judgment function does not rely on the user's input. When the user does not provide the reference information, the system can still effectively complete the seal authenticity identification; if the user provides the reference seal information, the system can further perform the seal consistency and authenticity dual judgment; when the user provides the reference seal image, the system can also accurately complete the seal consistency and authenticity identification.

[0052] 2. Aiming at the problems in actual scenarios such as background text interference, uneven lighting, uneven seal color, and crooked seal, the technical solution of the present invention has been optimized to improve the accuracy of seal content recognition.

[0053] 3. The design of the seal anti-counterfeiting line is highly technical and difficult to copy. Therefore, the seal to be tested and the reference seal are compared based on the seal anti-counterfeiting line to ensure the effectiveness and reliability of seal authenticity identification, thereby greatly enhancing the security of the seal.

[0054] 4. A unique corresponding relationship is established between the seal code and the seal. By adding seal code comparison, the accuracy of seal authenticity identification is further enhanced.

[0055] 5. The algorithm of the present invention has low algorithm complexity, ensures processing speed and efficiency, and provides users with a convenient service experience.

[0056] 6. Good applicability. The method of the present invention can be modularly integrated into the application system, reducing the dependence on professional equipment and complex processes, reducing application costs and improving promotion. The present invention is applicable to a variety of scenarios and needs, providing a comprehensive solution for seal management. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0058] Figure 1 This is a flow chart of a method for determining the consistency and authenticity of a seal based on content and anti-counterfeiting thread according to an embodiment of the present invention;

[0059] Figure 2 A schematic diagram of a seal detection and recognition section and its processing flow in an embodiment of the present invention;

[0060] Figure 3 A flowchart of seal image rotation correction in an embodiment of the present invention;

[0061] Figure 4 It is a principle block diagram of the seal content recognition section in an embodiment of the present invention;

[0062] Figure 5 Flow chart of security thread detection and analysis in an embodiment of the present invention;

[0063] Figure 6 A structural block diagram of an electronic device provided by an embodiment of the present invention.

[0064] Description of reference numerals: 101, memory; 102, processor; 103, communication interface. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0066] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0068] It should be noted that, in this article, relational terms such as first and second, etc. 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 these entities or operations. Moreover, the term "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0069] In the description of the embodiments of the present invention, "plurality" means at least 2.

[0070] Example:

[0071] like Figure 1-Figure 5 As shown, in the first aspect, an embodiment of the present invention provides a seal consistency and authenticity judgment method based on content and anti-counterfeiting thread, comprising the following steps:

[0072] S1, obtaining and preprocessing user input data, wherein the user input data includes a seal image to be analyzed and reference seal information;

[0073] Furthermore, it includes: performing format conversion, image enhancement, and noise removal on the seal image to be analyzed; extracting effective text content and coding content from the reference seal content in the reference seal information; and performing format conversion, image enhancement, and noise removal on the reference seal image in the reference seal information.

[0074] In some embodiments of the present invention, the user input information is preprocessed, and the user input information mainly includes two parts. The first part is an image containing the seal to be analyzed, which is a required input item; the second part is the reference seal information, which can be provided in the form of seal content text or seal image, and this part is a non-required input item. For the above-mentioned first part of the input, it is necessary to convert it into a unified input format required by the algorithm according to the user input image type: a three-channel color image in RBG format. Preprocessing operations such as image enhancement and noise removal are performed on the user input image to improve the subsequent algorithm's ability to recognize, analyze and understand the original image. For the above-mentioned second part of the input, when the user input is the content information of the reference seal, it is necessary to extract the effective text content and encoding content of the seal for subsequent seal consistency comparison work; when the user input is a reference seal image, it is necessary to perform image enhancement, noise removal, and algorithm unified input format conversion on the image.

[0075] S2, judging the reference reference seal information, if the reference reference seal information is empty, executing steps S3 and S4; if the reference reference seal information is the reference seal content, executing steps S3 and S5; if the reference reference seal information is the reference seal image, executing steps S3, S5 and S6;

[0076] S3, based on the seal image in the pre-processed user input data, performing seal detection and recognition to determine the seal information;

[0077] Furthermore, it includes: using target detection technology to locate and detect the position information and corresponding seal shapes of all seals from the pre-processed seal image to be analyzed or the reference seal image; cutting out individual seal images from the original image in sequence according to the seal position information, classifying each seal image, judging the shape and color of the seal, and outputting the seal shape and seal color information; performing image segmentation processing on the seal image according to the seal position information, segmenting the seal from the background to obtain the corresponding seal segmentation image; performing rotation correction on the seal segmentation image, and stretching the annular seal based on the polar coordinate transformation operation; locating the text position in the image, and identifying the seal content based on the OCR algorithm to obtain the annular text content, horizontal text content and encoded content of the seal.

[0078] In some embodiments of the present invention, the seal is detected and identified based on the seal detection and identification section. First, the target detection technology is used to locate the real position bounding box of the seal from the image preprocessed in step 1, and then the seal image is cropped from the original image according to the bounding box of the seal, and then classified to determine the shape type of the seal, and at the same time, the seal is segmented from the original background image, the image color space is converted, the color type of the seal is determined, and the seal color is output. Based on the bounding box obtained by the above seal detection method, the seal is segmented from the background using a combination of image segmentation algorithms such as color segmentation, region growing, and threshold processing, and the seal is rotated and corrected, and the annular seal is stretched based on polar coordinate transformation and other operations to ensure that the text is in a horizontal state, and then the text position is located and the seal content is identified based on the OCR algorithm to obtain the annular text content, horizontal text content and coded content of the seal. The seal detection and recognition module can be integrated into the application system, including seal positioning detection and shape classification module, seal image cropping and color classification module, red seal extraction module, image rotation correction module, seal content recognition module and recognition result post-processing module, such as Figure 2 shown.

[0079] Seal Positioning Detection and Shape Classification Module: It is used to locate and detect the position information and corresponding seal shapes of all seals from the input image to be detected or the reference seal image. The seal position information is represented by a bounding box composed of the coordinates x0, y0 of the upper left corner pixel of the seal and the coordinates x1, y1 of the lower right corner pixel of the seal. The seal shapes include circle, ellipse, square and other shapes. The model is trained based on the YOLO target detection algorithm using 5,000 annotated seal images. The accuracy of seal detection and shape classification in actual complex application scenarios exceeds 99%.

[0080] Seal image cropping and color classification module: According to the seal position information, the image I containing only a single seal is cropped from the original image in turn, and the image is converted from the RGB space to the HSV space for color judgment. In the HSV color space, the red range is [0,43,46]]~[10,255,255]∪156,43,46]~[180,255,255]. The proportion of pixels in the red range in the image is greater than T color , the seal color is determined to be red and the subsequent steps are continued; otherwise, the seal color is determined to be non-red and the determination result is directly returned.

[0081] Red seal extraction module: remove the background color and normalize the cropped seal image. norm =I / 255, for the normalized image I norm Mean filtering to obtain I blur , except for the background image I1=(I norm / I blur )*255. In order to avoid errors introduced by missing ink pad and image color deviation, and extract the seal as completely and accurately as possible, the red interval range of the HSV color space is adjusted to [0,10,30]~[15,255,255]∪[150,10,30]~[180,255,255]. Convert I1 to HSV space, extract the pixels in the corresponding interval, and assign the remaining pixels to 255 to obtain the red seal image I red . Will I red Convert it to grayscale and perform binary processing. According to the bounding rectangle of the largest connected domain of the image, I red The image I is cropped to get the image boundary close to the edge of the seal crop .

[0082] Image rotation correction module: Figure 3 As shown, the image rotation correction for the circular stamp includes the following steps:

[0083] 1. Image I crop Contrast enhancement, RGB color to grayscale, image denoising and image binarization are performed in sequence to obtain a binary image Ithresh .

[0084] 2. Extract the contours of the binary image and sort them according to the contour area. Remove the two contours with the largest area, i.e., the inner and outer edge contours of the seal, to obtain the internal contour set of the seal.

[0085] 3. Fill the minimum circumscribed circle of the contour with 255, set the rest to 0, and perform parameter-adaptive morphological dilation to obtain image I c , so that the adjacent areas form a large connected domain.

[0086] 4. The coordinates of the center point of the seal (x0, y0) are respectively the seal image I crop 1 / 2 of the width and height, the stamp radius r0 = (x0 + y0) / 2. Take image I c The median radius is in the interval [r min ,r max ], and get image I d The circular area should include the text area in the seal that is arranged in a circular pattern from left to right. The parameters can be set to r min =0.65×r0, r max =0.8×r0.

[0087] 5. Get image I d The minimum circumscribed rectangle R of the maximum connected domain. Find the two vertices R closest to the center of the circle from rectangle R. a , R b and the corresponding angle φ a ,φ b , the angle of the center point of the seal ring text φ=(φ a +φ b ) / 2. Rotate the image I by an angle of Δφ=φ-90°. crop Rotate Δφ clockwise to get the rotation-corrected seal image I rotate .

[0088] Seal content recognition module: Figure 4 As shown, seal content recognition includes the following steps:

[0089] a. Image area segmentation. The content of a seal generally includes a name in a circular shape from left to right, a code in a circular shape from left to right, and horizontal text from left to right. Algorithms that directly detect and recognize circular text have problems such as low accuracy and high false detection rate, which cannot meet the needs of actual scenarios. Based on prior knowledge such as seal specifications and the position of seal text, the seal image I is rotated and corrected. rotate The image I corresponding to the circular name, code, and horizontal content is cut out respectively ring , I num , I h Among them, I'ring and I' num isI rotate For the part with radius greater than 1 / 2, the radius is calculated in the same way as above; I h isI rotate The lower part after being divided into two parts in terms of height.

[0090] b. For round and oval stamps, I' ring , I' num By polar coordinate transformation, I ring and I num , convert the text from a circular arrangement to a horizontal arrangement.

[0091] c. Use the segmentation-based text detection algorithm DBNet to detect text areas. For circular and elliptical seals, detect the I ring ,I num ,I h To improve the detection accuracy; for stamps of other shapes, directly rotate the image I rotate Because DBNet supports text detection in any direction, including curved text, after fine-tuning, the detection of horizontal text can achieve higher accuracy.

[0092] d. Use an OCR text recognition algorithm based on DenseNet+GRU. Densenet is a convolutional neural network structure based on dense connections. The input of each layer is connected to the output of all subsequent layers. It can improve feature propagation and information utilization by increasing the connectivity of the network. In OCR tasks, it can more effectively extract image features and improve the accuracy of text recognition. GRU can be regarded as a variant of LSTM. Compared with the standard LSTM, the model is simpler and the training speed is faster. This method trains two models M with the same structure. text 、M num Seal text and code recognition are performed separately, and the output results are the recognized text content and recognition confidence.

[0093] Furthermore, it also includes: reordering the text boxes according to the spacing distance and horizontal coordinates of the text boxes of the circular text content of the seal, and filtering non-circular text using multiple prior information such as the height of the circular text and its position in the image; splicing the filtered circular text to obtain a complete seal circular text recognition result.

[0094] In some embodiments of the present invention, based on the recognition result post-processing module, an optimization strategy is implemented for the problems of erroneous segmentation, interference from background text and non-circular text generated during the stretching process of circular text, by analyzing the spacing and horizontal coordinates of the recognized text boxes, reordering the text boxes, and using prior information such as the height of the circular text and its position in the image to filter out the interference of non-circular text. Finally, the filtered text is spliced ​​to obtain a complete seal circular text recognition result. The following is the specific logic of the recognition result post-processing module:

[0095] 1. Sort the text recognition results rec_box_infos of the image after the seal is stretched. The sorting basis is the left boundary value of the text coordinate rectangular box, and the sorting is from small to large to obtain the sorted recognition results sort_box_infos;

[0096] 2. Calculate the distance between the left border of each text box in sort_box_infos and the right border of the previous text box, and store the corresponding distance information in dis_infos. Note: The distance information corresponding to the first text box is calculated as dis1 = xl1 + w - xr n +1, where xl1 is the left edge value of the first text box, xr n is the right border value of the last text box, and w is the width of the image after the stamp is stretched.

[0097] 3. According to the information in dis_infos, find the index index_max corresponding to the maximum distance, and then re-sort sort_box_infos with index_max as the starting point to obtain the circular text information box_infos containing the correct order;

[0098] Fourth, filter the text boxes in box_infos, and filter out the text boxes whose height is less than half of the height of the stretched seal image by comparing them with the height of the stretched seal image. Then, splice the contents of the remaining text boxes in order to finally obtain accurate circular text recognition results.

[0099] S4, based on the seal image in the pre-processed user input data, judging the authenticity of the seal appearance and generating a seal authenticity result;

[0100] Furthermore, the method includes: binarizing the seal image based on a preset seal standard color; filling in the uneven details of the seal color using binary morphological corrosion and expansion operations to obtain a filled seal image; using a connected domain analysis method to calculate the connected domain area boundary box of each character in the filled seal image, and analyzing whether the connected domain boundary box of each character is consistent with the standard rectangular box of the preset seal standard font to generate a seal authenticity result.

[0101] In some embodiments of the present invention, since the user does not provide relevant information about the reference seal, there is no need to complete the seal consistency determination work. In the face of the seal authenticity determination needs, the seal authenticity analysis is performed based on the seal text standard Song font and the color standard red. First, if the user does not have special instructions, the non-red seal will be judged as a fake seal; secondly, the shape of the seal text is analyzed, and the seal is binarized based on the seal red feature for the horizontal seal text image that has completed the polar coordinate transformation generated in step 2. The uneven color details of the seal are filled using binary morphological corrosion and expansion operations, and the connected domain analysis method is used to calculate the connected domain area boundary box of each character of the seal, and the connected domain boundary box of each character is analyzed to see whether it is close to the standard regular rectangular box of Song font, thereby giving the authenticity result of the seal.

[0102] S5, performing seal consistency judgment based on the text content in the seal information and the reference seal content, and generating a seal consistency judgment result;

[0103] Furthermore, it includes: extracting the characters to be detected and the codes to be detected in the text content, extracting the reference characters and the reference codes in the reference seal content; respectively calculating the edit distances between the characters to be detected and the reference characters, and between the codes to be detected and the reference codes; if any edit distance is greater than a preset distance threshold, it is determined that the text content is inconsistent.

[0104] In some embodiments of the present invention, the consistency between the text content of the image to be detected identified in step three and the text content of the benchmark seal is judged. The benchmark text is the benchmark text information input by the user or the text result of the benchmark seal image identified in step three. First, check whether the benchmark information is compliant, such as the benchmark code must be 13 digits. If the benchmark information is not compliant, an error prompt is directly returned. For compliant benchmark text information, the edit distance between the text to be detected and the benchmark text, and the code to be detected and the benchmark code is calculated respectively. If the edit distance is greater than the set threshold, it is considered that the text content is inconsistent.

[0105] S6. Perform security thread detection and analysis based on the preprocessed seal image to be analyzed and the reference seal image, generate a security thread comparison result, and output the seal authenticity result based on a preset threshold.

[0106] Furthermore, the method includes: performing image segmentation, image alignment, center interference removal, binarization and circular cutting operations on the seal image to be analyzed and the reference seal image respectively, so as to obtain a plurality of circular image sub-blocks corresponding to the seal image to be analyzed and the reference seal image respectively; performing connected domain analysis on each circular image sub-block, and performing similarity based on the connected domain features to determine the similarity between the seal image to be analyzed and the reference seal image, and generating a security line comparison result of the seal image to be analyzed and the reference seal image.

[0107] In some embodiments of the present invention, the following operations are performed on the reference seal and the seal to be analyzed respectively: seal image segmentation, image alignment, center interference removal, binarization, circular cutting, and similarity calculation based on connected domain features, so as to obtain the security thread comparison score of the reference seal and the seal to be analyzed, and output the authenticity result of the seal according to the preset threshold. The specific analysis steps of the security thread detection analysis are as follows: Figure 5 As shown:

[0108] 1) Seal image extraction. To facilitate the determination of subsequent threshold parameters, the seal image is first scaled to 300*300 pixels with equal aspect ratio. Then, the red seal image is extracted based on the pixel value, color and other features of the image, and interference such as background and watermark is removed to finally obtain the seal images img1 and img2.

[0109] 2) Seal image alignment. This step is to perform preprocessing operations for the subsequent comparison of whether the two seal engravings are consistent. First, extract the SIFT key points of the two images img1 and img2, use the FLANN algorithm to complete the key point matching, and then use the Lowe's algorithm to screen out excellent matching points. According to the image coordinates of the excellent matching points, calculate the perspective transformation matrix M, and transform img1 to the perspective of img2 through the transformation matrix M to obtain align_img1. At the same time, copy the image img2 to obtain align_img2, so as to achieve the alignment of the two seal images.

[0110] 3) Remove the interference of the seal content. In view of the fact that the anti-counterfeiting line is a white gap located on the edge of the seal and the internal font graphics, the complex seal text and uneven seal ink make the anti-counterfeiting line on the text difficult to analyze. In order to improve the accuracy of the consistency judgment of the anti-counterfeiting line, the present invention only analyzes and compares the anti-counterfeiting line on the edge of the seal. First, according to the shape of the seal, the corresponding circle or ellipse detection method is used to find the outer edge of the seal image align_img1, and then, based on the outer edge radius minus a certain threshold, a circle or ellipse mask image mask_img of the size of the center content is obtained, and mask_img is respectively operated with align_img1 and align_img2 to obtain the seal outline images outline_img1 and outline_img2 with the center interference removed.

[0111] 4) Calculate the similarity of the security lines. In order to compare whether the positions of the security lines are consistent, first perform a circular block operation on outline_img1 and outline_img2, divide each circular image into 20 circular image sub-blocks at equal intervals, perform a connected domain analysis on each sub-block, and count the number of corresponding connected domains. By comparing whether the number of connected domains of the same position of the two images is equal and whether the corresponding areas of the connected domains are similar, the consistency of the security lines at the same position of the outer contours of the two seal images can be determined.

[0112] The present invention compares the seal recognition content and seal features on the image to be detected with the information provided by the user, completes the seal consistency judgment and the seal authenticity analysis, ensures the accuracy and authenticity of the seal on the document to be detected, and the method can be modularly integrated in the application system, reduces the dependence on professional equipment and complex processes, reduces the application cost and improves the promotion. Based on the seal content analysis, the present invention ensures that the seal on the image to be analyzed is consistent with the reference seal information, and ensures the validity of the seal on the document; based on the seal's color, font shape, anti-counterfeiting line information and anti-counterfeiting line position information, the authenticity of the seal to be analyzed is judged, and the authenticity of the seal on the document to be detected is ensured. The present invention provides an accurate and efficient seal consistency and authenticity judgment method, simplifies the seal authenticity judgment process, improves work efficiency, and reduces the economic losses and legal risks caused by wrong seals and fake seals.

[0113] In a second aspect, an embodiment of the present invention provides a seal consistency and authenticity judgment system based on content and security thread, including a data preprocessing module, a reference information judgment module, a seal detection and recognition module, an appearance authenticity judgment module, a seal consistency judgment module and a security thread analysis module, wherein:

[0114] A data preprocessing module, used for acquiring and preprocessing user input data, wherein the user input data includes a seal image to be analyzed and reference base seal information;

[0115] A reference information judgment module, used to judge the reference seal information;

[0116] A seal detection and recognition module is used to perform seal detection and recognition based on the seal image in the pre-processed user input data to determine the seal information;

[0117] An appearance authenticity judgment module is used to judge the authenticity of the seal appearance based on the seal image in the pre-processed user input data and generate a seal authenticity result;

[0118] A seal consistency judgment module is used to judge the seal consistency according to the text content in the seal information and the reference seal content, and generate a seal consistency judgment result;

[0119] The security thread analysis module is used to perform security thread detection and analysis based on the preprocessed seal image to be analyzed and the reference seal image, generate security thread comparison results, and output the authenticity result of the seal according to a preset threshold.

[0120] This system, through the cooperation of multiple modules such as data preprocessing module, reference information judgment module, seal detection and recognition module, appearance authenticity judgment module, seal consistency judgment module and anti-counterfeiting line analysis module, compares the seal recognition content and seal features on the image to be detected with the information provided by the user, completes the seal consistency judgment and the seal authenticity analysis, ensures the accuracy and authenticity of the seal on the document to be detected, and the method can be modularly integrated into the application system, reducing the dependence on professional equipment and complex processes, reducing application costs and improving promotion. The present invention provides an accurate and efficient seal consistency and authenticity judgment method, simplifies the seal authenticity judgment process, improves work efficiency, and reduces the economic losses and legal risks caused by wrong seals and fake seals.

[0121] like Figure 6 As shown, in a third aspect, an embodiment of the present application provides an electronic device, which includes a memory 101 for storing one or more programs and a processor 102. When the one or more programs are executed by the processor 102, any method in the first aspect described above is implemented.

[0122] The memory 101, the processor 102 and the communication interface 103 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.

[0123] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.

[0124] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may 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 gate or transistor logic devices, or discrete hardware components.

[0125] In the embodiments provided in the present application, it should be understood that the disclosed method and system can also be implemented in other ways. The method and system embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the method and system, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0127] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by the processor 102, a method as in any one of the first aspects described above is implemented. If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

[0128] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0129] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A method for judging the consistency and authenticity of a seal based on content and anti-counterfeiting thread, characterized in that: The following steps are involved: S1, obtaining and preprocessing user input data, wherein the user input data includes a seal image to be analyzed and reference seal information; S2, judging the reference reference seal information, if the reference reference seal information is empty, executing steps S3 and S4; if the reference reference seal information is the reference seal content, executing steps S3 and S5; if the reference reference seal information is the reference seal image, executing steps S3, S5 and S6; S3, based on the seal image in the pre-processed user input data, performing seal detection and recognition to determine the seal information; S4, based on the seal image in the pre-processed user input data, judging the authenticity of the seal appearance and generating a seal authenticity result; S5, performing seal consistency judgment based on the text content in the seal information and the reference seal content, and generating a seal consistency judgment result; S6. Perform security thread detection and analysis based on the preprocessed seal image to be analyzed and the reference seal image, generate a security thread comparison result, and output the seal authenticity result based on a preset threshold.

2. A seal consistency and authenticity judgment method based on content and anti-counterfeiting thread according to claim 1, characterized in that: The method for preprocessing user input data comprises the following steps: Perform format conversion, image enhancement, and noise removal on the seal image to be analyzed; Extracting effective text content and coded content from the reference seal content in the reference seal information; The reference seal image in the reference seal information is subjected to various operations such as format conversion, image enhancement and noise removal.

3. A seal consistency and authenticity judgment method based on content and anti-counterfeiting thread according to claim 1, characterized in that: The method for seal detection and recognition based on the seal image in the pre-processed user input data comprises the following steps: Using target detection technology to locate and detect the position information and corresponding seal shapes of all seals from the pre-processed seal image to be analyzed or the reference seal image; According to the position information of the seal, a single seal image is cut out from the original image in sequence, each seal image is classified, and the shape and color of the seal are judged, and the seal shape and seal color information are output; According to the position information of the seal, the seal image is segmented to separate the seal from the background to obtain a corresponding seal segmentation image; The seal segmentation image is rotated and corrected, and the annular seal is stretched based on the polar coordinate transformation operation; the text position in the image is located, and the seal content is recognized based on the OCR algorithm to obtain the seal's annular text content, horizontal text content and coded content.

4. A seal consistency and authenticity judgment method based on content and anti-counterfeiting thread according to claim 3, characterized in that: The following steps are also included: According to the spacing and horizontal coordinates of the text boxes of the circular text content of the seal, the text boxes are reordered, and the non-circular text is filtered out using a variety of prior information such as the height of the circular text and its position in the image; The filtered circular text is spliced ​​to obtain the complete seal circular text recognition result.

5. A seal consistency and authenticity judgment method based on content and anti-counterfeiting thread according to claim 1, characterized in that: The method for judging the authenticity of a seal appearance based on the seal image in the pre-processed user input data comprises the following steps: Binarization of the seal image is performed based on the preset seal standard color; Use binary morphological erosion and dilation operations to fill in the uneven color details of the stamp to obtain the filled stamp image; The connected domain analysis method is used to calculate the connected domain area boundary box of each character in the filled seal image, and analyze whether the connected domain boundary box of each character is consistent with the standard rectangular box of the preset seal standard font to generate the seal authenticity result.

6. A seal consistency and authenticity judgment method based on content and anti-counterfeiting thread according to claim 1, characterized in that: The method for performing seal consistency judgment based on the text content in the seal information and the reference seal content to generate a seal consistency judgment result comprises the following steps: Extracting the characters to be detected and the codes to be detected from the text content, and extracting the reference characters and the reference codes from the reference seal content; Calculate the edit distance between the text to be detected and the reference text, and between the code to be detected and the reference code respectively; If any edit distance is greater than a preset distance threshold, the text content is deemed inconsistent.

7. A seal consistency and authenticity judgment method based on content and anti-counterfeiting thread according to claim 1, characterized in that: The method for detecting and analyzing the anti-counterfeiting thread according to the pre-processed seal image to be analyzed and the reference seal image comprises the following steps: The seal image to be analyzed and the reference seal image are respectively subjected to image segmentation, image alignment, center interference removal, binarization, and annular block cutting operations to obtain a plurality of annular image sub-blocks corresponding to the seal image to be analyzed and the reference seal image; Connected domain analysis is performed on each annular image sub-block, and similarity is performed based on the connected domain features to determine the similarity between the seal image to be analyzed and the reference seal image, and a security line comparison result of the seal image to be analyzed and the reference seal image is generated.

8. A seal consistency and authenticity judgment system based on content and anti-counterfeiting thread, characterized in that: It includes data preprocessing module, reference information judgment module, seal detection and recognition module, appearance authenticity judgment module, seal consistency judgment module and anti-counterfeiting thread analysis module, among which: A data preprocessing module, used for acquiring and preprocessing user input data, wherein the user input data includes a seal image to be analyzed and reference base seal information; A reference information judgment module, used to judge the reference seal information; A seal detection and recognition module is used to perform seal detection and recognition based on the seal image in the pre-processed user input data to determine the seal information; An appearance authenticity judgment module is used to judge the authenticity of the seal appearance based on the seal image in the pre-processed user input data and generate a seal authenticity result; A seal consistency judgment module is used to judge the seal consistency according to the text content in the seal information and the reference seal content, and generate a seal consistency judgment result; The security thread analysis module is used to perform security thread detection and analysis based on the preprocessed seal image to be analyzed and the reference seal image, generate security thread comparison results, and output the authenticity result of the seal according to a preset threshold.

9. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Card authenticity visual identification method and system based on cluster flower anti-counterfeiting characteristics

    CN122090236A