CN114882482B - Seal anti-counterfeiting identification method and device - Google Patents

Seal anti-counterfeiting identification method and device Download PDF

Info

Publication number
CN114882482B
CN114882482B CN202111189366.4A CN202111189366A CN114882482B CN 114882482 B CN114882482 B CN 114882482B CN 202111189366 A CN202111189366 A CN 202111189366A CN 114882482 B CN114882482 B CN 114882482B
Authority
CN
China
Prior art keywords
seal
target
stamp
template
detected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111189366.4A
Other languages
Chinese (zh)
Other versions
CN114882482A (en
Inventor
方磊
徐敏
严京旗
周审章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zetyun Tech Co ltd
Original Assignee
Beijing Zetyun Tech Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zetyun Tech Co ltd filed Critical Beijing Zetyun Tech Co ltd
Priority to CN202111189366.4A priority Critical patent/CN114882482B/en
Publication of CN114882482A publication Critical patent/CN114882482A/en
Application granted granted Critical
Publication of CN114882482B publication Critical patent/CN114882482B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The invention provides a seal anti-counterfeiting identification method and a seal anti-counterfeiting identification device. The method comprises the following steps: respectively extracting characteristic points of the stamp to be detected and the template stamp to obtain a plurality of first characteristic points and a plurality of second characteristic points; performing principal component analysis in a preset slicing range of the first characteristic point and a preset slicing range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point; performing characteristic point matching based on the first characteristic vector and the second characteristic vector to determine a first target characteristic point pair; performing matrix transformation processing on the seal to be detected based on the first target characteristic point pair to obtain a target seal; and calculating the similarity value between the target seal and the template seal to obtain the similarity result of the seal to be detected and the template seal. Therefore, the size and the angle of the target seal and the template seal are the same, so that the interference caused by seal distortion is avoided, and the accuracy of the anti-counterfeiting identification result is improved.

Description

Seal anti-counterfeiting identification method and device
Technical Field
The invention relates to the technical field of seal processing, in particular to a seal anti-counterfeiting identification method and a seal anti-counterfeiting identification device.
Background
In the technical field of seal processing, the anti-counterfeiting detection of the seal to be detected can be realized by calculating the similarity between the seal to be detected and the template seal. The similarity may be calculated by using a histogram matching method, or may be calculated based on the euclidean distance between the stamps.
However, in the above manner, there may be noise interference or distortion of the stamp to be detected, which reduces the accuracy of the anti-counterfeit identification result.
Disclosure of Invention
The embodiment of the invention aims to provide a seal anti-counterfeiting identification method and a seal anti-counterfeiting identification device, and solves the technical problems that the existing seal to be detected may have noise interference or distortion, and the accuracy of an anti-counterfeiting identification result is reduced.
In order to solve the technical problem, an embodiment of the present invention provides a stamp anti-counterfeiting identification method, where the method includes:
under the condition of obtaining a to-be-detected seal and a template seal, respectively extracting characteristic points of the to-be-detected seal and the template seal to obtain a plurality of first characteristic points corresponding to the to-be-detected seal and a plurality of second characteristic points corresponding to the template seal;
performing principal component analysis in a preset slice range of the first characteristic point and a preset slice range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point;
performing characteristic point matching based on the first characteristic vector and the second characteristic vector to determine a first target characteristic point pair; the first target feature point pairs include at least some of the plurality of first feature points and at least some of the plurality of second feature points;
performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain a target seal;
and calculating a similarity value between the target seal and the template seal to obtain a similarity result between the seal to be detected and the template seal.
Optionally, before the feature point extraction is performed on the to-be-detected stamp and the template stamp respectively, the method includes:
acquiring an original seal to be detected and an original template seal;
and respectively extracting the interested areas of the original seal to be detected and the original template seal to obtain the seal to be detected and the template seal.
Optionally, the calculating a similarity value between the target stamp and the template stamp includes:
superposing a preset first background image in the first background area to obtain a noised target seal; the first background area is at least a partial area in the target seal;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing; the second background area is at least a partial area in the template stamp;
and calculating a similarity numerical value between the target stamp subjected to the noise processing and the template stamp subjected to the noise processing.
Optionally, the performing feature point matching based on the first feature vector and the second feature vector, and determining a first target feature point pair includes:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distances between the second feature vectors and each first feature vector, and determining a target Euclidean distance, wherein the target Euclidean distance is smaller than a first preset threshold and has the smallest value;
and determining a second characteristic point corresponding to the second characteristic vector and a first characteristic point corresponding to the target Euclidean distance as the first target characteristic point pair.
Optionally, the performing principal component analysis in the preset slice range of the first feature point and the preset slice range of the second feature point respectively to obtain a first feature vector corresponding to the first feature point and a second feature vector corresponding to the second feature point includes:
determining corresponding principal components and gradients in a preset slicing range of the first feature point as the first feature vector;
and determining the principal component and the gradient of the second feature point corresponding to a preset slice range as the second feature vector.
Optionally, the matrix transformation processing of the to-be-detected stamp based on the first target feature point pair to obtain the target stamp includes:
screening the first target characteristic point pairs to obtain second target characteristic point pairs under the condition that the number of the first target characteristic point pairs is larger than or equal to a second preset threshold value;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
Optionally, the performing perspective transformation on the to-be-detected stamp by using the perspective transformation matrix to obtain a target stamp includes:
reading a first component and a second component in the perspective transformation matrix; the first component and the second component are perspective transformation components of the transformed to-be-detected seal;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, performing perspective transformation on the to-be-detected seal by using the perspective transformation matrix.
Optionally, the calculating a similarity value between the target seal and the template seal to obtain a similarity result between the to-be-detected seal and the template seal includes:
calculating a similarity value between the target seal and the template seal;
determining that the target seal is similar to the template seal when the similarity degree value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
Optionally, the calculating a similarity value between the target stamp and the template stamp includes:
calculating the mean, variance and covariance between the target seal and the template seal;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
The embodiment of the invention also provides a stamp anti-counterfeiting identification device, which comprises:
the first processing module is used for respectively extracting characteristic points of the stamp to be detected and the template stamp under the condition of obtaining the stamp to be detected and the template stamp to obtain a plurality of first characteristic points corresponding to the stamp to be detected and a plurality of second characteristic points corresponding to the template stamp;
the analysis module is used for performing principal component analysis in a preset slice range of the first characteristic point and a preset slice range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point;
the matching module is used for matching feature points based on the first feature vector and the second feature vector and determining a first target feature point pair; the first target characteristic point pairs include at least some of the plurality of first characteristic points and at least some of the plurality of second characteristic points;
the second processing module is used for performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain a target seal;
and the calculation module is used for calculating the similarity value between the target seal and the template seal to obtain the similarity result between the seal to be detected and the template seal.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring an original seal to be detected and an original template seal;
and the extraction module is used for respectively extracting the interested areas of the original seal to be detected and the original template seal to obtain the seal to be detected and the template seal.
Optionally, the calculation module is specifically configured to:
superposing a preset first background image in the first background area to obtain a noised target seal; the first background area is at least a partial area in the target seal;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing; the second background area is at least a partial area in the template stamp;
and calculating a similarity numerical value between the target stamp subjected to the noise processing and the template stamp subjected to the noise processing.
Optionally, the matching module is specifically configured to:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distances between the second feature vectors and each first feature vector, and determining a target Euclidean distance, wherein the target Euclidean distance is smaller than a first preset threshold and has the smallest value;
and determining a second characteristic point corresponding to the second characteristic vector and a first characteristic point corresponding to the target Euclidean distance as the first target characteristic point pair.
Optionally, the matching module is further specifically configured to:
determining corresponding principal components and gradients in a preset slicing range of the first feature point as the first feature vector;
and determining the corresponding principal component and gradient of the second feature point in a preset slice range as the second feature vector.
Optionally, the second processing module is specifically configured to:
screening the first target characteristic point pairs to obtain second target characteristic point pairs under the condition that the number of the first target characteristic point pairs is larger than or equal to a second preset threshold value;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
Optionally, the second processing module is further specifically configured to:
reading a first component and a second component in the perspective transformation matrix; the first component and the second component are perspective transformation components of the transformed to-be-detected seal;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, performing perspective transformation on the to-be-detected seal by using the perspective transformation matrix.
Optionally, the calculation module is further specifically configured to:
calculating a similarity value between the target seal and the template seal;
determining that the target seal is similar to the template seal when the similarity value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
Optionally, the computing module is further specifically configured to:
calculating the mean, variance and covariance between the target seal and the template seal;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
The embodiment of the invention also provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; a memory for storing a computer program; and the processor is used for realizing the seal anti-counterfeiting identification method when executing the program stored in the memory.
The embodiment of the invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is stored with instructions, and when the computer-readable storage medium runs on a computer, the computer is enabled to execute the seal anti-counterfeiting identification method.
The embodiment of the invention also provides a computer program product containing instructions, and when the computer program product runs on a computer, the computer is enabled to execute the seal anti-counterfeiting identification method.
In the embodiment of the invention, feature point extraction is respectively carried out on a stamp to be detected and a template stamp to obtain a plurality of first feature points and a plurality of second feature points; performing principal component analysis in a preset slicing range of the first characteristic point and a preset slicing range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point; performing characteristic point matching based on the first characteristic vector and the second characteristic vector to determine a first target characteristic point pair; and performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain the target seal. In the above manner, the principal component obtained by calculating the feature point in the slicing ranges of different scales is used as the feature value corresponding to the feature point, so that under the condition that the size of the to-be-detected stamp is different from that of the template stamp or the to-be-detected stamp is deformed, the noise interference in the stamp can be eliminated, and the accuracy of the anti-counterfeiting identification result is improved. In addition, the sizes and the angles of the target seal and the template seal after the matrix transformation is carried out on the seal to be detected are the same, so that the interference caused by seal distortion is avoided, and the accuracy of the anti-counterfeiting identification result is also improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below.
FIG. 1 is a schematic flow chart of an anti-counterfeiting identification method for a seal according to an embodiment of the invention;
FIG. 2 is one of application scenario diagrams of anti-counterfeit identification of a stamp in the embodiment of the present invention;
FIG. 3 is a second view of an application scenario of anti-counterfeit identification of a stamp according to an embodiment of the present invention;
FIG. 4 is a third application scenario diagram of anti-counterfeit identification of a stamp in the embodiment of the present invention;
FIG. 5 is a fourth view of an application scenario of anti-counterfeit identification of a stamp in an embodiment of the present invention;
FIG. 6 is a flow chart of the application of the anti-counterfeit identification of the seal according to the embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an anti-counterfeiting identification device for a stamp according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a schematic flow chart of a stamp anti-counterfeiting identification method according to an embodiment of the present invention. The anti-counterfeiting identification method for the seal provided by the embodiment of the invention comprises the following steps:
s101, under the condition that a seal to be detected and a template seal are obtained, feature point extraction is respectively carried out on the seal to be detected and the template seal, and a plurality of first feature points corresponding to the seal to be detected and a plurality of second feature points corresponding to the template seal are obtained.
It should be understood that the stamp to be detected and the template stamp are both images.
In this step, the to-be-detected seal and the template seal may be acquired based on input of a user, or a terminal applying the seal anti-counterfeiting identification method provided by this embodiment may download the to-be-detected seal and the template seal via the internet, or acquire the to-be-detected seal and the template seal via other manners. And is not particularly limited herein.
After the stamp to be detected and the template stamp are obtained, feature points corresponding to the stamp to be detected and feature points corresponding to the template stamp are respectively extracted, wherein the feature points corresponding to the stamp to be detected and the feature points corresponding to the template stamp can be extracted by using a Scale-invariant feature transform (SIFT) algorithm, or by using an ORB (ordered Fast and rotaed Brief) algorithm, or by using other methods, which is not specifically limited herein. The feature points include, but are not limited to, edge points or corner points in the stamp.
In the step, the feature points corresponding to the to-be-detected stamp are called first feature points, the feature points corresponding to the template stamp are called second feature points, and the number of the first feature points and the number of the second feature points are both more than or equal to 2.
For convenience of understanding, referring to fig. 2, fig. 2 shows a scene after feature point extraction operations are performed on the stamp to be detected and the template stamp.
S102, performing principal component analysis in the preset slice range of the first characteristic point and the preset slice range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point.
It should be understood that the feature vector is composed of a plurality of feature values, in this step, after the first feature point and the second feature point are obtained, principal component analysis may be performed in a preset slice range of the first feature point and a preset slice range of the second feature point, and a feature value corresponding to the first feature point and a feature value corresponding to the second feature point are determined, so that a set of feature values corresponding to the first feature point is determined as the first feature vector, and a set of feature values corresponding to the second feature point is determined as the second feature vector, for a specific technical solution, please refer to the subsequent embodiments.
S103, performing feature point matching based on the first feature vector and the second feature vector, and determining a first target feature point pair.
In this step, feature point matching is performed on the first feature point and the second feature point, and a first target feature point pair is determined, please refer to the following embodiments regarding the specific scheme of feature point matching.
The first target characteristic point pair includes at least some of the plurality of first characteristic points and at least some of the plurality of second characteristic points. That is, the first target feature point pair includes the first feature point and the second feature point that match each other.
And S104, performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain a target seal.
In this step, matrix transformation processing may be performed on the stamp to be detected based on the first target feature point pair. The matrix transformation processing can be understood as that the multiplication operation is carried out on the coordinates of each pixel point in the seal to be detected and the matrix obtained based on the first target characteristic point pair, so that the matrix transformation of the seal is realized, and the target seal is obtained. The size and the angle of the target stamp and the template stamp are the same.
And S105, calculating a similarity numerical value between the target seal and the template seal to obtain a similarity result between the seal to be detected and the template seal.
In the step, after the target seal is obtained, similarity calculation is carried out on the target seal and the template seal to obtain a similarity numerical value, and whether the target seal and the template seal are similar is determined based on the size relation between the similarity numerical value and a preset numerical value, so that the anti-counterfeiting detection of the seal to be detected is realized.
In the embodiment of the invention, feature point extraction is respectively carried out on a stamp to be detected and a template stamp to obtain a plurality of first feature points and a plurality of second feature points; performing principal component analysis in a preset slicing range of the first characteristic point and a preset slicing range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point; performing characteristic point matching based on the first characteristic vector and the second characteristic vector to determine a first target characteristic point pair; and performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain the target seal. In the above mode, the principal component obtained by calculating the feature point in the slicing range of different scales is used as the feature value corresponding to the feature point, so that under the condition that the size of the to-be-detected seal is different from that of the template seal or the to-be-detected seal is deformed, the noise interference in the seal can be eliminated, and the accuracy of the anti-counterfeiting identification result is improved. In addition, the sizes and the angles of the target seal and the template seal after the matrix transformation is carried out on the seal to be detected are the same, so that the interference caused by seal distortion is avoided, and the accuracy of the anti-counterfeiting identification result is also improved.
Optionally, before the feature point extraction is performed on the to-be-detected stamp and the template stamp respectively, the method includes:
acquiring an original seal to be detected and an original template seal;
and respectively extracting the interested areas of the original seal to be detected and the original template seal to obtain the seal to be detected and the template seal.
Wherein the region of interest extraction includes but is not limited to: mask treatment and repair treatment. Preferably, the region of interest is extracted by adopting a mask processing mode to obtain the stamp to be detected and the template stamp.
Specifically, the original seal to be detected is a seal which is input by a user and needs to be subjected to anti-counterfeiting identification; the original template stamp is input by a user or a preset stamp. In this embodiment, after the original to-be-detected stamp and the original template stamp are obtained, masking is performed on the original to-be-detected stamp and the original template stamp, and background text, watermarks, and noise in the stamp are removed through masking, so as to obtain a Region Of Interest (ROI) Of the stamp. And the original stamp to be detected after the mask processing is called a stamp to be detected, and the original template stamp after the mask processing is called a template stamp.
In the embodiment, the original seal to be detected and the original template seal are masked, so that noise in the original seal to be detected and the original template seal is removed, and in the subsequent similarity calculation process, the influence of the noise in the seal on the similarity result is avoided, and the accuracy of the similarity result is improved.
The following specifically explains how to perform masking processing on an original stamp to be detected and an original template stamp:
optionally, the respectively masking the original to-be-detected stamp and the original template stamp includes:
determining a saturation value and a brightness value corresponding to each pixel point in the original stamp to be detected and the original template stamp;
determining pixel points of which the saturation values are in a first preset interval and the brightness values are in a second preset interval in the original to-be-detected seal as first target pixel points, and determining pixel points of which the saturation values are in the first preset interval and the brightness values are in the second preset interval in the original template seal as second target pixel points;
and adjusting pixel values corresponding to pixel points except for the first target pixel points in the original to-be-detected stamp, and adjusting pixel values corresponding to pixel points except for the second target pixel points in the original template stamp.
In this embodiment, the original stamp to be detected and the original template stamp are converted from the RGB space to the HSV space, and the mask process is performed on the original stamp to be detected and the original template stamp based on the saturation and the brightness in the HSV space.
Specifically, a saturation value and a brightness value corresponding to each pixel point in the original stamp to be detected and the original template stamp in the HSV space are determined. The embodiment is provided with a first preset interval corresponding to the saturation value and a second preset interval corresponding to the brightness value, wherein the first preset interval and the second preset interval can be preset and can also be determined in a self-adaptive manner according to an original to-be-detected stamp and an original template stamp.
For the original to-be-detected seal, determining pixel points of the original to-be-detected seal, of which the saturation values are in a first preset interval and the brightness values are in a second preset interval, as first target pixel points, and adjusting pixel values corresponding to pixel points, except the first target pixel points, of the original to-be-detected seal, optionally, adjusting the pixel values to be 0 or 255.
For the original template seal, determining the pixel points of the original template seal, of which the saturation values are in the first preset interval and the brightness values are in the second preset interval, as second target pixel points, and adjusting the pixel values corresponding to the pixel points of the original template seal except the second target pixel points, optionally, adjusting the pixel values to 0 or 255.
For convenience of understanding, please refer to fig. 3, where fig. 3 illustrates an original template stamp, an original stamp to be detected, a template stamp obtained through region of interest extraction processing, and a stamp to be detected obtained through region of interest extraction processing.
Furthermore, in the process of calculating the similarity data, because a large number of black/white areas (namely background areas) exist in the template stamp and the target stamp, the similarity values of the template stamp and the target stamp are high, and the anti-counterfeiting identification result is calculated inaccurately.
In order to solve the above possible technical problems, this embodiment provides a feasible implementation manner, and when similarity calculation is performed on a template stamp and a target stamp, noise processing may be performed on the template stamp and the target stamp first, and then similarity calculation is performed on the template stamp and the target stamp after the noise processing. The specific process is as follows:
optionally, the calculating a similarity value between the target stamp and the template stamp includes:
superposing a preset first background image in the first background area to obtain a denoised target seal;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing;
and calculating a similarity numerical value between the denoised target seal and the denoised template seal.
The first background area is at least a partial area of the target seal; the second background area is at least a partial area of the template stamp.
In this embodiment, a first background image and a second background image are preset, where a similarity value between the first background image and the second background image is a preset value, and optionally, the preset value is 0. And superposing a first background image on a first background area of the target seal and superposing a second background image on a second background area of the template seal so as to reduce the similarity between the first background area and the second background area.
Further, the similarity between the target stamp on which the first background image is superimposed and the template stamp on which the second background image is superimposed is calculated, and it should be understood that the similarity between the first background region of the target stamp subjected to the noise addition processing and the second background region of the template stamp subjected to the noise addition processing is lower, so that the accuracy of the similarity calculation result can be improved.
The following specifically explains the process of performing feature point matching:
optionally, the performing feature point matching based on the first feature vector and the second feature vector, and determining a first target feature point pair includes:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distance between the second feature vector and each first feature vector, and determining target Euclidean distance;
and determining a second feature point corresponding to the second feature vector and a first feature point corresponding to the target Euclidean distance as the first target feature point pair.
In this step, for each feature point, a feature vector corresponding to the feature point is calculated, and please refer to the following embodiments for a specific way of calculating the feature vector. The feature vector corresponding to the first feature point is referred to as a first feature vector, and the feature vector corresponding to the second feature point is referred to as a second feature vector.
Further, for each second feature vector, a plurality of first feature vectors corresponding to the second feature vector are determined by using a nearest neighbor search algorithm, and the euclidean distance between the second feature vector and each corresponding first feature vector is calculated.
In this embodiment, a first preset threshold is further preset, and after a plurality of euclidean distances are obtained through calculation, if at least one of the euclidean distances is smaller than the first preset threshold, the euclidean distance with the smallest value among the euclidean distances is determined as a target euclidean distance, and a second feature point corresponding to the second feature vector and a first feature point corresponding to the target euclidean distance are determined as a first target feature point pair.
For the sake of understanding, please refer to fig. 4, and fig. 4 shows a scene after feature point matching is performed on the stamp to be detected and the template stamp, wherein the second feature point and the matched first feature point are represented by a connecting line.
Optionally, the performing principal component analysis in the preset slice range of the first feature point and the preset slice range of the second feature point respectively to obtain a first feature vector corresponding to the first feature point and a second feature vector corresponding to the second feature point includes:
determining principal components and gradients corresponding to the first feature points in a preset slice range as the first feature vectors;
and determining the corresponding principal component and gradient of the second feature point in a preset slice range as the second feature vector.
In this embodiment, principal component analysis is performed on the feature points to obtain principal components of the feature points within a preset slice range; further, the gradient and the principal component of the feature point within the preset slice range are taken as the feature value of the feature point. The preset slice range comprises a plurality of slice ranges with different scales and taking the characteristic point as the center.
In this embodiment, a feature value corresponding to the first feature point in the preset slice range is referred to as a first feature value, and a feature value corresponding to the second feature point in the preset slice range is referred to as a second feature value, where the numbers of the first feature value and the second feature value are both greater than or equal to 2.
Further, a plurality of first eigenvalues corresponding to the first eigenvalue are expressed in a vector form, and the first eigenvalue is used as a first eigenvector corresponding to the first eigenvalue; and representing a plurality of second characteristic values corresponding to the second characteristic points in a vector form to serve as second characteristic vectors corresponding to the second characteristic points.
In this embodiment, under the condition that the size of the to-be-detected stamp is different from that of the template stamp or the to-be-detected stamp is deformed, the principal component obtained by calculating the slicing range of the feature point in different scales is used as the feature value corresponding to the feature point, so that the accuracy of the anti-counterfeiting identification result is improved.
Optionally, the matrix transformation processing of the to-be-detected stamp based on the first target feature point pair to obtain the target stamp includes:
screening the first target characteristic point pairs to obtain second target characteristic point pairs under the condition that the number of the first target characteristic point pairs is larger than or equal to a second preset threshold value;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
In this embodiment, when the number of the first target feature point pairs is greater than or equal to the second preset threshold, indicating that there is a possibility of matching between the stamp to be detected and the template stamp, the first target feature point pairs are screened to obtain second target feature point pairs, where the number of the feature points in the second target feature point pairs is less than or equal to the number of the feature points in the first target feature point pairs.
Alternatively, the RANSC algorithm may be used to perform iterative fitting on the first target feature point pair, and select a partial feature point with the best fitting effect as the second target feature point pair. It should be understood that, in other embodiments, the first target feature point pair may be screened in other manners, and is not limited in particular.
It should be understood that the second preset threshold may be preset, or may be determined based on an image entropy value between the stamp to be detected and the template stamp, where the higher the image entropy value is, the higher the second preset threshold is. After the second target feature point pair is obtained, a perspective transformation matrix corresponding to the second target feature point pair may be calculated using an RANSC algorithm, where the perspective transformation matrix is a homography matrix. Further, a perspective transformation matrix is used to perform perspective transformation on the to-be-detected stamp to obtain a target stamp, and please refer to the following embodiments for a specific technical scheme for performing perspective transformation on the to-be-detected stamp.
In other embodiments, if the number of the first target feature point pairs is smaller than the second preset threshold, it indicates that the to-be-detected stamp is not matched with the template stamp, and the similarity between the to-be-detected stamp and the template stamp is 0.
Optionally, the performing perspective transformation on the to-be-detected stamp by using the perspective transformation matrix to obtain a target stamp includes:
reading a first component and a second component in the perspective transformation matrix;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, carrying out perspective transformation on the to-be-detected stamp by using the perspective transformation matrix.
It should be understood that the perspective transformation matrix can be expressed as shown below:
Figure BDA0003300566860000151
wherein h may be 31 Determining h as a first component 32 Determined as the second component. The first component and the second component are perspective transformation components of the transformed to-be-detected seal.
In this embodiment, a third preset threshold and a fourth preset threshold are preset, and when the first component is less than or equal to the third preset threshold and the second component is less than or equal to the fourth preset threshold, it indicates that the to-be-detected stamp after perspective transformation does not generate deformation in an expected range, and then the to-be-detected stamp is subjected to perspective transformation by using a perspective transformation matrix. As described above, the coordinate of each pixel point in the to-be-detected stamp may be multiplied by the perspective transformation matrix to realize the perspective transformation of the to-be-detected stamp.
And under the condition that the first component is greater than a third preset threshold value or the second component is greater than a fourth preset threshold value, the deformation of the to-be-detected seal beyond an expected range is generated after perspective transformation, and under the condition, the to-be-detected seal is determined to be dissimilar to the template seal without performing perspective transformation on the to-be-detected seal.
In the embodiment, the perspective transformation is performed on the stamp to be detected to generate the target stamp, the image of the target stamp is converted into the angle consistent with that of the template stamp, the size of the target stamp is the same as that of the template stamp, and the accuracy of the subsequent similarity calculation result is further improved by the template stamp.
For convenience of understanding, please refer to fig. 5, and fig. 5 shows a stamp to be detected and a target stamp obtained by subjecting the stamp to be detected to perspective transformation.
Optionally, the calculating a similarity value between the target stamp and the template stamp to obtain a similarity result template stamp between the to-be-detected stamp and the template stamp includes:
calculating a similarity value between the target seal and the template seal;
determining that the target seal is similar to the template seal when the similarity value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
In this embodiment, after the target seal is obtained, the target seal and the template seal may not be subjected to the noise adding process, and the similarity value between the target seal and the template seal is directly calculated.
It should be understood that the higher the above-mentioned similarity value is, the higher the similarity between the target stamp and the stamp pad is, and the lower the above-mentioned similarity value is, the lower the similarity between the target stamp and the stamp pad is.
In this embodiment, a fifth preset threshold is preset, and the fifth preset threshold may be set by user. Determining that the target seal is similar to the template seal under the condition that the similarity value is greater than a fifth preset threshold value; and under the condition that the similarity value is less than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
In this embodiment, a similarity value between the target stamp and the template stamp is calculated, and then a magnitude relationship between the similarity value and a fifth preset threshold is compared to generate a similarity result, so as to determine the similarity between the target stamp and the template stamp.
Optionally, the calculating a similarity value between the target stamp and the template stamp includes:
calculating the mean, variance and covariance between the target seal and the template seal;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
In this embodiment, the mean, variance, and covariance between the target stamp and the template stamp may be calculated, and the mean, variance, and covariance may be weighted to determine the similarity value.
In order to facilitate the understanding of the whole scheme, please refer to fig. 6, where fig. 6 is an application flowchart of the anti-counterfeit identification method for a stamp according to an embodiment of the present invention.
In the flow shown in fig. 6, after the image to be detected is acquired, seal extraction is performed on the image to be detected, and feature point extraction is performed on the extracted seal to be detected, so as to obtain a first feature point; after the template image is obtained, seal extraction is carried out on the template image, and feature point extraction is carried out on the extracted template seal to obtain a second feature point. Matching the first characteristic points with the second characteristic points, and if the first characteristic points are not matched with the second characteristic points, determining that the similarity between the seal to be detected and the template seal is 0; and if the first characteristic point is matched with the second characteristic point, carrying out perspective transformation on the seal to be detected. If the matrix parameters in the perspective transformation matrix are abnormal, namely the first component in the matrix parameters is greater than or equal to a third preset threshold value, and the second component in the matrix parameters is greater than or equal to a fourth preset threshold value, determining that the similarity between the stamp to be detected and the template stamp is 0; if the matrix parameters in the perspective transformation matrix are not abnormal, calculating the similarity value between the to-be-detected seal and the template seal after perspective transformation, and further performing anti-counterfeiting identification on the to-be-detected seal based on the pixel value.
As shown in fig. 7, an embodiment of the present invention further provides an anti-counterfeit seal identification apparatus 200, including:
the first processing module 201 is configured to, under the condition that a to-be-detected stamp and a template stamp are obtained, respectively perform feature point extraction on the to-be-detected stamp and the template stamp to obtain a plurality of first feature points corresponding to the to-be-detected stamp and a plurality of second feature points corresponding to the template stamp;
an analysis module 202, configured to perform principal component analysis in a preset slice range of the first feature point and a preset slice range of the second feature point respectively to obtain a first feature vector corresponding to the first feature point and a second feature vector corresponding to the second feature point;
a matching module 203, configured to perform feature point matching based on the first feature vector and the second feature vector, and determine a first target feature point pair; the first target characteristic point pairs include at least some of the plurality of first characteristic points and at least some of the plurality of second characteristic points;
the second processing module 204 is configured to perform matrix transformation on the to-be-detected seal based on the first target feature point pair to obtain a target seal;
the calculating module 205 is configured to calculate a similarity value between the target stamp and the template stamp to obtain a similarity result between the to-be-detected stamp and the template stamp.
Optionally, the stamp anti-counterfeiting identification apparatus 200 further includes:
the acquisition module is used for acquiring an original seal to be detected and an original template seal;
and the extraction module is used for respectively extracting the interested areas of the original seal to be detected and the original template seal to obtain the seal to be detected and the template seal.
Optionally, the calculating module 205 is specifically configured to:
superposing a preset first background image in the first background area to obtain a noised target seal; the first background area is at least a partial area in the target seal;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing; the second background area is at least a partial area in the template stamp;
and calculating a similarity numerical value between the denoised target seal and the denoised template seal.
Optionally, the matching module 203 is specifically configured to:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distances between the second feature vectors and each first feature vector, and determining a target Euclidean distance, wherein the target Euclidean distance is smaller than a first preset threshold and has the smallest value;
and determining a second characteristic point corresponding to the second characteristic vector and a first characteristic point corresponding to the target Euclidean distance as the first target characteristic point pair.
Optionally, the matching module 203 is further specifically configured to:
determining corresponding principal components and gradients in a preset slicing range of the first feature point as the first feature vector;
and determining the corresponding principal component and gradient of the second feature point in a preset slice range as the second feature vector.
Optionally, the second processing module 204 is specifically configured to:
screening the first target characteristic point pairs to obtain second target characteristic point pairs under the condition that the number of the first target characteristic point pairs is larger than or equal to a second preset threshold value;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
Optionally, the second processing module 204 is further specifically configured to:
reading a first component and a second component in the perspective transformation matrix; the first component and the second component are perspective transformation components of the transformed to-be-detected seal;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, performing perspective transformation on the to-be-detected seal by using the perspective transformation matrix.
Optionally, the calculating module 205 is further specifically configured to:
calculating a similarity value between the target seal and the template seal;
determining that the target seal is similar to the template seal when the similarity degree value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
Optionally, the calculating module 205 is further specifically configured to:
calculating the mean, variance and covariance between the target seal and the template seal;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304.
A memory 303 for storing a computer program;
the processor 301 is configured to, when the program stored in the memory 303 is executed, perform feature point extraction on the to-be-detected stamp and the template stamp respectively to obtain a plurality of first feature points corresponding to the to-be-detected stamp and a plurality of second feature points corresponding to the template stamp when the computer program is executed by the processor 301 and obtain the to-be-detected stamp and the template stamp;
performing principal component analysis in a preset slice range of the first characteristic point and a preset slice range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point;
performing feature point matching based on the first feature vector and the second feature vector to determine a first target feature point pair;
performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain a target seal;
and calculating a similarity value between the target seal and the template seal to obtain a similarity result between the seal to be detected and the template seal.
Optionally, the computer program, when executed by the processor 301, is further configured to obtain an original to-be-detected stamp and an original template stamp;
and respectively extracting the interested areas of the original seal to be detected and the original template seal to obtain the seal to be detected and the template seal.
Optionally, when executed by the processor 301, the computer program is further configured to superimpose a preset first background image in a first background area to obtain a target stamp after the denoising process;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing;
and calculating a similarity numerical value between the target stamp subjected to the noise processing and the template stamp subjected to the noise processing.
Optionally, when executed by the processor 301, the computer program is further configured to perform feature point matching based on the first feature vector and the second feature vector, and determining a first target feature point pair includes:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distance between the second feature vector and each first feature vector, and determining target Euclidean distance;
and determining a second characteristic point corresponding to the second characteristic vector and a first characteristic point corresponding to the target Euclidean distance as the first target characteristic point pair.
Optionally, the computer program, when being executed by the processor 301, is further configured to determine a corresponding principal component and a gradient within a preset slice range of the first feature point as the first feature vector; and determining the corresponding principal component and gradient of the second feature point in a preset slice range as the second feature vector.
Optionally, when executed by the processor 301, the computer program is further configured to, when the number of the first target feature point pairs is greater than or equal to a second preset threshold, filter the first target feature point pairs to obtain second target feature point pairs;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
Optionally, the computer program, when executed by the processor 301, is further configured to read a first component and a second component in the perspective transformation matrix;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, performing perspective transformation on the to-be-detected seal by using the perspective transformation matrix.
Optionally, the computer program is further configured to calculate a similarity value between the target stamp and the template stamp when being executed by the processor 301;
determining that the target seal is similar to the template seal when the similarity value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
Optionally, the computer program, when executed by the processor 301, is further configured to calculate a mean, a variance, and a covariance between the target stamp and the template stamp;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer is caused to execute the stamp anti-counterfeiting identification method described in any one of the above embodiments.
In another embodiment of the present invention, a computer program product containing instructions is further provided, which when run on a computer, causes the computer to execute the stamp anti-counterfeiting identification method described in any one of the above embodiments.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. A stamp anti-counterfeiting identification method is characterized by comprising the following steps:
under the condition of obtaining a to-be-detected seal and a template seal, respectively extracting characteristic points of the to-be-detected seal and the template seal to obtain a plurality of first characteristic points corresponding to the to-be-detected seal and a plurality of second characteristic points corresponding to the template seal;
performing principal component analysis in a preset slice range of the first characteristic point and a preset slice range of the second characteristic point respectively to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point;
performing characteristic point matching based on the first characteristic vector and the second characteristic vector to determine a first target characteristic point pair; the first target feature point pairs include at least some of the plurality of first feature points and at least some of the plurality of second feature points;
performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain a target seal;
calculating a similarity value between the target seal and the template seal to obtain a similarity result between the seal to be detected and the template seal;
wherein the calculating the similarity value between the target seal and the template seal comprises:
superposing a preset first background image in the first background area to obtain a noised target seal; the first background area is at least a partial area in the target seal;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing; the second background area is at least a partial area in the template stamp;
calculating a similarity value between the denoised target stamp and the denoised template stamp;
and the similarity value between the first background image and the second background image is a preset value.
2. The method according to claim 1, wherein before said extracting feature points of said to-be-detected stamp and said template stamp, respectively, said method comprises:
acquiring an original seal to be detected and an original template seal;
and respectively extracting the interested areas of the original seal to be detected and the original template seal to obtain the seal to be detected and the template seal.
3. The method of claim 1, wherein the feature point matching based on the first feature vector and the second feature vector, and wherein determining a first target feature point pair comprises:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distances between the second feature vectors and each first feature vector, and determining a target Euclidean distance, wherein the target Euclidean distance is smaller than a first preset threshold and has the smallest value;
and determining a second characteristic point corresponding to the second characteristic vector and a first characteristic point corresponding to the target Euclidean distance as the first target characteristic point pair.
4. The method according to claim 1, wherein the performing principal component analysis in a preset slice range of the first feature point and a preset slice range of the second feature point respectively to obtain a first feature vector corresponding to the first feature point and a second feature vector corresponding to the second feature point comprises:
determining corresponding principal components and gradients in a preset slicing range of the first feature point as the first feature vector;
and determining the corresponding principal component and gradient of the second feature point in a preset slice range as the second feature vector.
5. The method according to claim 1, wherein the performing matrix transformation processing on the to-be-detected stamp based on the first target feature point pair to obtain a target stamp comprises:
screening the first target characteristic point pairs to obtain second target characteristic point pairs under the condition that the number of the first target characteristic point pairs is larger than or equal to a second preset threshold value;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
6. The method according to claim 5, wherein the performing perspective transformation on the to-be-detected stamp by using the perspective transformation matrix to obtain a target stamp comprises:
reading a first component and a second component in the perspective transformation matrix; the first component and the second component are perspective transformation components of the transformed to-be-detected stamp, the first component is a component represented by matrix parameters of a third row and a first column in the perspective transformation matrix, and the second component is a component represented by matrix parameters of a third row and a second column in the perspective transformation matrix;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, carrying out perspective transformation on the to-be-detected stamp by using the perspective transformation matrix.
7. The method according to claim 1, wherein the calculating a similarity value between the target stamp and the template stamp to obtain a similarity result between the stamp to be detected and the template stamp comprises:
calculating a similarity value between the target seal and the template seal;
determining that the target seal is similar to the template seal when the similarity value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
8. The method according to claim 7, wherein said calculating a similarity value between said target stamp and said template stamp comprises:
calculating the mean, variance and covariance between the target seal and the template seal;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
9. An anti-counterfeiting identification device for a seal, the device comprising:
the first processing module is used for respectively extracting characteristic points of the stamp to be detected and the template stamp under the condition of obtaining the stamp to be detected and the template stamp to obtain a plurality of first characteristic points corresponding to the stamp to be detected and a plurality of second characteristic points corresponding to the template stamp;
the analysis module is used for respectively carrying out principal component analysis on the first characteristic point and the second characteristic point to obtain a first characteristic vector corresponding to the first characteristic point and a second characteristic vector corresponding to the second characteristic point;
the matching module is used for matching feature points based on the first feature vector and the second feature vector and determining a first target feature point pair; the first target feature point pairs include at least some of the plurality of first feature points and at least some of the plurality of second feature points;
the second processing module is used for performing matrix transformation processing on the to-be-detected seal based on the first target characteristic point pair to obtain a target seal;
the calculation module is used for calculating a similarity value between the target seal and the template seal to obtain a similarity result between the seal to be detected and the template seal;
wherein, the calculation module is specifically configured to:
superposing a preset first background image in the first background area to obtain a noised target seal; the first background area is at least a partial area in the target seal;
superposing a preset second background image in a second background area to obtain a template seal subjected to noise processing; the second background area is at least a partial area in the template stamp;
calculating a similarity numerical value between the denoised target seal and the denoised template seal;
and the similarity value between the first background image and the second background image is a preset value.
10. The apparatus of claim 9, further comprising:
the acquisition module is used for acquiring an original to-be-detected stamp and an original template stamp;
and the extraction module is used for respectively extracting the region of interest of the original to-be-detected stamp and the original template stamp to obtain the to-be-detected stamp and the template stamp.
11. The apparatus of claim 9, wherein the matching module is specifically configured to:
based on each second feature vector, determining a plurality of first feature vectors corresponding to the second feature vector by using a nearest neighbor search algorithm;
calculating Euclidean distance between the second feature vector and each first feature vector, and determining target Euclidean distance, wherein the target Euclidean distance is smaller than a first preset threshold and has the smallest value;
and determining a second feature point corresponding to the second feature vector and a first feature point corresponding to the target Euclidean distance as the first target feature point pair.
12. The apparatus of claim 9, wherein the matching module is further specifically configured to:
determining corresponding principal components and gradients in a preset slicing range of the first feature point as the first feature vector;
and determining the corresponding principal component and gradient of the second feature point in a preset slice range as the second feature vector.
13. The apparatus according to claim 9, wherein the second processing module is specifically configured to:
screening the first target characteristic point pairs to obtain second target characteristic point pairs under the condition that the number of the first target characteristic point pairs is larger than or equal to a second preset threshold value;
calculating a perspective transformation matrix corresponding to the second target characteristic point pair;
and carrying out perspective transformation on the to-be-detected seal by using the perspective transformation matrix to obtain a target seal.
14. The apparatus of claim 13, wherein the second processing module is further specifically configured to:
reading a first component and a second component in the perspective transformation matrix; the first component and the second component are perspective transformation components of the transformed to-be-detected stamp, the first component is a component represented by matrix parameters of a third row and a first column in the perspective transformation matrix, and the second component is a component represented by matrix parameters of a third row and a second column in the perspective transformation matrix;
and under the condition that the first component is less than or equal to a third preset threshold value and the second component is less than or equal to a fourth preset threshold value, performing perspective transformation on the to-be-detected seal by using the perspective transformation matrix.
15. The apparatus of claim 9, wherein the computing module is further specifically configured to:
calculating a similarity value between the target seal and the template seal;
determining that the target seal is similar to the template seal when the similarity value is greater than a fifth preset threshold value;
and under the condition that the similarity value is smaller than or equal to a fifth preset threshold value, determining that the target seal is not similar to the template seal.
16. The apparatus of claim 15, wherein the computing module is further specifically configured to:
calculating the mean, variance and covariance between the target seal and the template seal;
and performing weighted calculation on the mean value, the variance and the covariance to determine the mean value, the variance and the covariance as the similarity numerical value.
17. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the seal anti-counterfeiting identification method according to any one of claims 1 to 8 when executing the program stored in the memory.
18. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for the forgery-proof identification of seals according to any one of claims 1 to 8.
CN202111189366.4A 2021-10-12 2021-10-12 Seal anti-counterfeiting identification method and device Active CN114882482B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111189366.4A CN114882482B (en) 2021-10-12 2021-10-12 Seal anti-counterfeiting identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111189366.4A CN114882482B (en) 2021-10-12 2021-10-12 Seal anti-counterfeiting identification method and device

Publications (2)

Publication Number Publication Date
CN114882482A CN114882482A (en) 2022-08-09
CN114882482B true CN114882482B (en) 2023-03-17

Family

ID=82667791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111189366.4A Active CN114882482B (en) 2021-10-12 2021-10-12 Seal anti-counterfeiting identification method and device

Country Status (1)

Country Link
CN (1) CN114882482B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103072390A (en) * 2012-12-13 2013-05-01 浙江科技学院 Method for manufacturing and identifying digital holographic anti-counterfeiting stamp
CN104408721A (en) * 2014-11-25 2015-03-11 西安交通大学 Stamper image extracting method based on background density estimation
CN110378351A (en) * 2019-07-26 2019-10-25 中国工商银行股份有限公司 Seal discrimination method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4062987B2 (en) * 2002-06-25 2008-03-19 松下電工株式会社 Image area dividing method, image area dividing apparatus, and image area dividing program
CN100568264C (en) * 2007-01-18 2009-12-09 章毅 Print identification control method
CN103177728B (en) * 2011-12-21 2015-07-29 中国移动通信集团广西有限公司 Voice signal denoise processing method and device
CN108596197B (en) * 2018-05-15 2020-08-25 汉王科技股份有限公司 Seal matching method and device
CN109635818A (en) * 2018-10-26 2019-04-16 平安科技(深圳)有限公司 The anti-counterfeit of seals method of inspection, device and computer readable storage medium
CN110765992B (en) * 2019-09-23 2023-03-24 厦门大学 Seal identification method, medium, equipment and device
CN110956171A (en) * 2019-11-06 2020-04-03 广州供电局有限公司 Automatic nameplate identification method and device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103072390A (en) * 2012-12-13 2013-05-01 浙江科技学院 Method for manufacturing and identifying digital holographic anti-counterfeiting stamp
CN104408721A (en) * 2014-11-25 2015-03-11 西安交通大学 Stamper image extracting method based on background density estimation
CN110378351A (en) * 2019-07-26 2019-10-25 中国工商银行股份有限公司 Seal discrimination method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
印章鉴定系统的图像处理研究;周琨等;《计算机工程与应用》;20040108(第20期);218-220 *
基于圆矩变换的圆形印章配准方法研究;梁吉胜等;《价值工程》;20170711(第18期);204-205 *
面向局部光照突变的时间和空间中心对称局部二值模式算子;卞紫涵等;《中国图象图形学报》;20131114(第10期);1285-1292 *

Also Published As

Publication number Publication date
CN114882482A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
Alireza Golestaneh et al. Spatially-varying blur detection based on multiscale fused and sorted transform coefficients of gradient magnitudes
US9036905B2 (en) Training classifiers for deblurring images
CN111340109B (en) Image matching method, device, equipment and storage medium
Oszust No-reference image quality assessment using image statistics and robust feature descriptors
CN115205223B (en) Visual inspection method and device for transparent object, computer equipment and medium
Thajeel et al. A Novel Approach for Detection of Copy Move Forgery using Completed Robust Local Binary Pattern.
CN115273115A (en) Document element labeling method and device, electronic equipment and storage medium
CN112634288A (en) Equipment area image segmentation method and device
CN113129298B (en) Method for identifying definition of text image
CN108960246B (en) Binarization processing device and method for image recognition
Nawaz et al. Image authenticity detection using DWT and circular block-based LTrP features
CN111768345B (en) Correction method, device, equipment and storage medium for identity card back image
CN111768346B (en) Correction method, device, equipment and storage medium for identity card back image
CN107423739B (en) Image feature extraction method and device
CN114882482B (en) Seal anti-counterfeiting identification method and device
CN116258873A (en) Position information determining method, training method and device of object recognition model
CN111178398A (en) Method, system, storage medium and device for detecting tampering of image information of identity card
CN115273123A (en) Bill identification method, device and equipment and computer storage medium
Temel et al. ReSIFT: Reliability-weighted sift-based image quality assessment
CN111178340B (en) Image recognition method and training method of image recognition model
CN110232302B (en) Method for detecting change of integrated gray value, spatial information and category knowledge
CN113255674A (en) Character recognition method, character recognition device, electronic equipment and computer-readable storage medium
CN114596210A (en) Noise estimation method, device, terminal equipment and computer readable storage medium
JP7147828B2 (en) Image processing system, image processing method and program
Shukla et al. A survey on digital image forensic methods based on blind forgery detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant