Summary of the invention
The purpose of this specification one or more embodiment is to provide a kind of certificate identification method and device, equipment and storage
Medium, to provide a kind of method that can be effectively identified certificate.
In order to solve the above technical problems, this specification one or more embodiment is achieved in that
On the one hand, this specification one or more embodiment provides a kind of certificate identification method, comprising:
It obtains in the case where setting lighting condition to the first image of document photography to be identified, wherein the first image includes
The image of the certificate to be identified;
Spot detection is carried out to the first image;
If spot detection result meets preset hot spot existence condition, the peripheral region of the hot spot detected is examined
The detection of mapping sample;
According to the material information of the certificate to be identified and the testing result of detection pattern, the certificate to be identified is carried out
Identification.
Optionally, the material information according to the certificate to be identified and detect the testing result of pattern, to it is described to
Identification certificate is identified, comprising:
If the material of the certificate to be identified be first kind material, and it is described detection pattern testing result do not meet it is default
Detection pattern existence condition, it is determined that the certificate to be identified be forged certificate;Wherein, the certificate of the first kind material exists
Captured image under the setting lighting condition, spot detection result meets the preset hot spot existence condition, and examines
The testing result of mapping sample meets the preset detection pattern existence condition;
If the material of the certificate to be identified be the second class material, and it is described detection pattern testing result meet it is preset
Detect pattern existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, the certificate of the second class material is in institute
Image captured under setting lighting condition is stated, spot detection result meets the preset hot spot existence condition, and detects
The testing result of pattern does not meet the preset detection pattern existence condition.
Optionally, described to include: to the first image progress spot detection
Gray level image is converted by the first image;
Based on a gray threshold, the largest connected domain in the gray level image is obtained;
Judge whether the pixel quantity in the largest connected domain is greater than preset quantity;
The spot detection result of the first image is determined according to the judging result.
Optionally, described to include: to the first image progress spot detection
The first image is aligned template with pre-set certificate to be aligned;
The image of the certificate to be identified is intercepted in the first image of alignment;
The image of the certificate to be identified is converted into gray level image;
Based on a gray threshold, the largest connected domain in the gray level image is obtained;
Judge whether the pixel quantity in the largest connected domain is greater than preset quantity;
The spot detection result of the first image is determined according to the judging result.
Optionally, the spot detection result that the first image is determined according to the judging result includes:
If the pixel quantity in the largest connected domain is greater than preset quantity, it is determined that the spot detection knot of the first image
Fruit meets preset hot spot existence condition, and the largest connected domain is the hot spot detected;
If the pixel quantity in the largest connected domain is not more than preset quantity, it is determined that the first image does not meet default
Hot spot existence condition.
Optionally, described to be based on a gray threshold, the largest connected domain obtained in the gray level image includes:
The brightness of the gray level image is adjusted, so that the brightness of the gray level image meets predetermined luminance requirement;
Based on a gray threshold, the largest connected domain in the gray level image after adjusting brightness is obtained.
Optionally, the peripheral region of the described pair of hot spot detected carry out detection pattern detection include:
The detection pattern classification device obtained based on one by deep learning network training, the peripheral region to the hot spot detected
Carry out the detection of detection pattern.
On the other hand, this specification one or more embodiment provides a kind of certificate identification apparatus, comprising:
Module is obtained, for obtaining the first image in the case where setting lighting condition to document photography to be identified, wherein described
First image includes the image of the certificate to be identified;
Spot detection module, for carrying out spot detection to the first image;
Pattern detection module is detected, if meeting preset hot spot existence condition for spot detection result, to detecting
Hot spot peripheral region carry out detection pattern detection;
Module is identified, for according to the material information of the certificate to be identified and detecting the testing result of pattern, to described
Certificate to be identified is identified.
Optionally, the identification module, comprising:
First determination unit, if the material for the certificate to be identified is first kind material, and the detection pattern
Testing result does not meet preset detection pattern existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, described
The certificate of first kind material image captured under the setting lighting condition, spot detection result meets described preset
Hot spot existence condition, and the testing result for detecting pattern meets the preset detection pattern existence condition;
Second determination unit, if the material for the certificate to be identified is the second class material, and the detection pattern
Testing result meets preset detection pattern existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, described
The certificate of two class materials image captured under the setting lighting condition, spot detection result meet the preset light
Spot existence condition, and the testing result for detecting pattern does not meet the preset detection pattern existence condition.
Optionally, the spot detection module includes:
Conversion unit, for converting gray level image for the first image;
Acquiring unit obtains the largest connected domain in the gray level image for being based on a gray threshold;
Judging unit, for judging whether the pixel quantity in the largest connected domain is greater than preset quantity;
Determination unit, for determining the spot detection result of the first image according to the judging result.
Optionally, the spot detection module includes:
Alignment unit is aligned for the first image to be aligned template with pre-set certificate;
Interception unit, for intercepting the image of the certificate to be identified in the first image of alignment;
Conversion unit, for the image of the certificate to be identified to be converted to gray level image;
Acquiring unit obtains the largest connected domain in the gray level image for being based on a gray threshold;
Judging unit, for judging whether the pixel quantity in the largest connected domain is greater than preset quantity;
Determination unit, for determining the spot detection result of the first image according to the judging result.
Optionally, the determination unit includes:
First determines subelement, if the pixel quantity for the largest connected domain is greater than preset quantity, it is determined that described
The spot detection result of first image meets preset hot spot existence condition, and the largest connected domain is the hot spot detected;
Second determines subelement, if the pixel quantity for the largest connected domain is not more than preset quantity, it is determined that institute
It states the first image and does not meet preset hot spot existence condition.
Optionally, the acquiring unit includes:
Regulator unit, for adjusting the brightness of the gray level image so that the brightness of the gray level image meet it is default
Brightness requirement;
Subelement is obtained, for being based on a gray threshold, obtains the most Dalian in the gray level image after adjusting brightness
Logical domain.
Optionally, the detection pattern detection module exists if meeting preset hot spot specifically for spot detection result
Condition, then the detection pattern classification device obtained based on one by deep learning network training, the peripheral region to the hot spot detected
Carry out the detection of detection pattern.
In another aspect, this specification one or more embodiment provides a kind of certificate evaluation apparatus, comprising:
Processor;And
It is arranged to the memory of storage computer executable instructions, the computer executable instructions make when executed
The processor:
It obtains in the case where setting lighting condition to the first image of document photography to be identified, wherein the first image includes
The image of the certificate to be identified;
Spot detection is carried out to the first image;
If spot detection result meets preset hot spot existence condition, the peripheral region of the hot spot detected is examined
The detection of mapping sample;
According to the material information of the certificate to be identified and the testing result of detection pattern, the certificate to be identified is carried out
Identification.
In another aspect, this specification one or more embodiment provides a kind of storage medium, can be held for storing computer
Row instruction, the computer executable instructions realize following below scheme when executed:
It obtains in the case where setting lighting condition to the first image of document photography to be identified, wherein the first image includes
The image of the certificate to be identified;
Spot detection is carried out to the first image;
If spot detection result meets preset hot spot existence condition, the peripheral region of the hot spot detected is examined
The detection of mapping sample;
According to the material information of the certificate to be identified and the testing result of detection pattern, the certificate to be identified is carried out
Identification.
Using the technical solution of this specification one or more embodiment, by the case where setting lighting condition to be identified
First image of document photography carries out spot detection, and when spot detection result meets default hot spot and exists, to detecting
Hot spot peripheral region carry out detection pattern detection, and according to detection pattern testing result and certificate to be identified material
Matter information identifies certificate to be identified.On the one hand, a kind of mode for identifying certificate to be identified is provided, and step is simply easy
In execution;It on the other hand, only only can be right in such a way that spot detection identifies certificate due in the related art
Papery is duplicated this forgery means and is identified, can not recognition screen reproduction, copper sheet printing etc. forge means, and the present embodiment
By way of combining spot detection and the detection mode of the detection pattern of the peripheral region of hot spot, it can identify that a variety of certificates are pseudo-
Means are made, and then improve the accuracy rate of certificate identification, so as to effectively identify certificate.
Specific embodiment
This specification one or more embodiment provides a kind of certificate identification method and device, equipment and storage medium, uses
To provide a kind of method that can be effectively identified certificate.
In order to make those skilled in the art more fully understand the technical solution in this specification one or more embodiment,
Below in conjunction with the attached drawing in this specification one or more embodiment, to the technology in this specification one or more embodiment
Scheme is clearly and completely described, it is clear that and described embodiment is only this specification a part of the embodiment, rather than
Whole embodiments.Based on this specification one or more embodiment, those of ordinary skill in the art are not making creativeness
The model of this specification one or more embodiment protection all should belong in every other embodiment obtained under the premise of labour
It encloses.
This specification embodiment provides a kind of certificate identification method, and the executing subject of the certificate identification method for example can be with
Be independent a server, or the server cluster being made of multiple servers, the present exemplary embodiment to this not
Do particular determination.Fig. 1 is the flow diagram one for the certificate identification method that this specification embodiment provides, as shown in Figure 1, the party
Method may comprise steps of:
Step S102, it obtains in the case where setting lighting condition to the first image of document photography to be identified, wherein the first image
Image including certificate to be identified.
In this specification embodiment, setting lighting condition can refer to that under the conditions of flash lamp illumination, the flash lamp can be with
For the flash lamp carried on terminal device, it can also be independent flash lamp, the present exemplary embodiment does not do particular determination to this.
Specifically, user can by the camera in terminal device (such as mobile phone, tablet computer), and open flash lamp condition
Under to the first image of document photography to be identified;User can also be by the camera of camera and under conditions of opening flash lamp
To first image of document photography to be identified etc., this specification embodiment does not do particular determination to this.The certificate identification method is held
Row main body it is available under conditions of flash lamp is taken pictures to the first image of document photography to be identified.It should be noted that should
First image includes the image of certificate to be identified.
Certificate to be identified can be identity card, academic certificate, diploma etc., and it is special that this specification embodiment does not do this
It limits.
Step S104, spot detection is carried out to the first image.
In this specification embodiment, spot detection can be carried out to the first image by following four mode, in which:
Mode one: Fig. 2 is the flow diagram one that spot detection is carried out to the first image that this specification embodiment provides.
As shown in Fig. 2, may comprise steps of:
Step S202, gray level image is converted by the first image.Specifically, image processing operations can be used the first figure
As being converted into gray level image.
Step S204, it is based on a gray threshold, obtains the largest connected domain in gray level image.
In this specification embodiment, it is possible, firstly, to the gray value of each pixel in gray level image be obtained, by each picture
The gray value of element is compared with gray threshold, and the pixel that gray value in gray level image is greater than gray threshold is determined as target
Pixel;Then, Connected area disposal$ is carried out to the object pixel in gray level image, to obtain at least one connected domain and near
The maximum connected domain of area is determined as largest connected domain in a few connected domain.It should be noted that the numerical value of the gray threshold
It can rule of thumb be arranged, or be obtained by experiment, the present exemplary embodiment does not do particular determination to this.
By taking the maximum connected domain of area, hot spot noise can be removed, to increase the accuracy of certificate identification.
Step S206, judge whether the pixel quantity in largest connected domain is greater than preset quantity.Obtain largest connected domain
Pixel quantity, and the pixel quantity in largest connected domain is compared with preset quantity, the preset quantity can be according to testing
It arrives, the present exemplary embodiment does not do particular determination to this.
Step S208, the spot detection result of the first image is determined according to judging result.Specifically, if largest connected domain
Pixel quantity is greater than preset quantity, it is determined that the spot detection result of the first image meets preset hot spot existence condition, and should
Largest connected domain is the hot spot detected;If the pixel quantity in largest connected domain is not more than preset quantity, it is determined that the first image
Preset hot spot existence condition is not met.In the present specification, the foundation for setting hot spot existence condition can be according to specific application
Scene and specific requirements are adjusted, such as to Mr. Yu's class certificate, and in the case where the first illumination condition is shot, are then set
The foundation of hot spot existence condition can be more than first threshold for the number of laser image spot element, to another kind of certificate, and in second of light
It is shot according under the conditions of, then the foundation of the hot spot existence condition set can be more than second threshold for the number of laser image spot element.
Hot spot existence condition can be adjusted according to the feedback of detection environment and testing result, so as to be detected based on the condition
Testing result it is more acurrate.
Mode two: Fig. 3 is the flow diagram two that spot detection is carried out to the first image that this specification embodiment provides.
As shown in figure 3, may comprise steps of:
Step S302, gray level image is converted by the first image.Since the step has been explained above, because
This is not being repeated herein.
Step S304, the brightness for adjusting gray level image, so that the brightness of gray level image meets predetermined luminance requirement.
In this specification embodiment, the range of the gray value of pixel is 0~255, and gray value is bigger, and the pixel is brighter,
Gray value is smaller, and the pixel is darker.Based on this, the process for adjusting the brightness of gray level image may include: in search gray level image
The gray value of each pixel, to obtain the maximum pixel of gray value.Judge the maximum pixel of the gray value gray value whether be
255, if so, being not required to be adjusted the brightness of gray level image;If it is not, then equal proportion adjusts each of whole gray level image
The gray value of pixel, so that the gray value of the maximum pixel of gray value is 255.Predetermined luminance requires after can referring to adjustment brightness
The gray value of the maximum pixel of gray value in gray level image is 255.
By the brightness of adjusting gray level image, predetermined luminance requirement can not be met to avoid the brightness due to gray level image,
And lead to the phenomenon that can not find hot spot generation.
Step S306, it is based on a gray threshold, obtains the largest connected domain in the gray level image after adjusting brightness.In this theory
In bright book embodiment, since the realization principle of step S206 is identical as the realization principle of step S204, no longer carry out herein
It repeats.
Step S308, judge whether the pixel quantity in largest connected domain is greater than preset quantity.The step is hereinbefore
It is illustrated, therefore is no longer repeated herein.
Step S310, the spot detection result of the first image is determined according to judging result.The step hereinbefore into
It has gone explanation, therefore has no longer been repeated herein.
Mode three: Fig. 4 is the flow diagram three that spot detection is carried out to the first image that this specification embodiment provides.
As shown in figure 4, may comprise steps of:
Step S402, the first image template is aligned with pre-set certificate to be aligned.
In this specification embodiment, it is possible, firstly, to the certificate alignment template of every kind of certificate is preset, then, according to
The type of certificate to be identified selects corresponding certificate alignment template from the certificate of the certificate pre-set alignment template;Most
Afterwards, by the matched picture alignment algorithm of SIFT feature, the first image is aligned template with the certificate of selection and is aligned.
Step S404, the image of certificate to be identified is intercepted in the first image of alignment.In this specification embodiment, by
Not only include the image of certificate to be identified in the first image, further includes background image, since background image is there may be noise,
These noises may influence whether the accuracy rate of identification, therefore, in order to further increase the accuracy rate of certificate identification, need right
The image of certificate to be identified is intercepted in the first neat image, to carry out subsequent processing according to the image of certificate to be identified.
Step S406, the image of certificate to be identified is converted into gray level image.It can use image processing operations will be wait reflect
The image for determining certificate is converted into gray level image.
Step S408, it is based on a gray threshold, obtains the largest connected domain in gray level image.Since the realization of the step is former
Reason is identical as the realization principle of step S204, therefore details are not described herein again.
Step S410, judge whether the pixel quantity in largest connected domain is greater than preset quantity.Due to the realization of step S410
Principle has been explained above, therefore is no longer repeated herein.
Step S412, the spot detection result of the first image is determined according to judging result.Specifically, if largest connected domain
Pixel quantity is greater than preset quantity, it is determined that the spot detection result of the first image meets preset hot spot existence condition, and should
Largest connected domain is the hot spot detected;If the pixel quantity in largest connected domain is not more than preset quantity, it is determined that the first image
Preset hot spot existence condition is not met.
Mode four: Fig. 5 is the flow diagram four that spot detection is carried out to the first image that this specification embodiment provides.
As shown in figure 5, may comprise steps of:
Step S502, the first image template is aligned with pre-set certificate to be aligned.Due to the realization of the step
Principle has been explained above, therefore is no longer repeated herein.
Step S504, the image of certificate to be identified is intercepted in the first image of alignment.Due to the realization principle of the step
It has been be explained above that, therefore details are not described herein again.
Step S506, the image of certificate to be identified is converted into gray level image.Since the realization principle of the step has existed
It is above illustrated, therefore details are not described herein again.
Step S508, the brightness for adjusting gray level image, so that the brightness of gray level image meets predetermined luminance requirement.Due to this
The principle of step has been explained above, therefore details are not described herein again.
Step S510, it is based on a gray threshold, obtains the largest connected domain in the gray level image after adjusting brightness.Due to this
The realization principle of step has been explained above, therefore is no longer repeated herein.
Step S512, judge whether the pixel quantity in largest connected domain is greater than preset quantity.Since the realization of the step is former
Reason is hereinbefore illustrated, therefore details are not described herein again.
Step S514, the spot detection result of the first image is determined according to judging result.Due to the realization principle of the step
It is hereinbefore illustrated, therefore details are not described herein again.
If step S106, spot detection result meets preset hot spot existence condition, around the hot spot detected
Region carries out the detection of detection pattern.
Wherein, the detection mode of the detection pattern in this specification embodiment includes the detection mode of various optical effects,
Such as spiral lamination detection or the detection of other optical effects, such as ripple detection.The detection side of specific detection pattern
Formula can be determined that details are not described herein according to the had optical characteristics of type of specific application scenarios and certificate to be identified.
Below to detect pattern as spiral lamination, the detection mode for detecting pattern is to be illustrated for spiral lamination detects.It can think
It arrives, the technical concept based on the program also can be suitably used for the detection of other optical effects.
In this specification embodiment, if spot detection result does not meet preset hot spot existence condition, i.e., according to above-mentioned
Mode determines in the first image there is no hot spot, it is determined that certificate to be identified is forged certificate, if spot detection result meet it is pre-
If hot spot existence condition, i.e., determine that there are hot spots in the first image according to aforesaid way, then to the hot spot detected around
Region carries out spiral lamination detection, it should be noted that the hot spot detected is the maximum that above-mentioned pixel quantity is greater than preset quantity
Connected domain.Specifically, the spiral lamination classifier that can be obtained based on one by deep learning network training, to the hot spot detected
Peripheral region carries out spiral lamination detection.In the following, being illustrated to the building process of spiral lamination classifier.
Firstly, obtaining training sample, training sample is to intercept from the various certificate images obtained under setting lighting condition
Spot area, which includes the peripheral region of hot spot and hot spot, it should be noted that spot area be various cards
Pixel quantity in part image is greater than the largest connected domain of preset quantity and the peripheral region in largest connected domain, wherein training sample
This includes two classes, there are spiral lamination in the peripheral region of the hot spot in one kind, is not present in the peripheral region of the hot spot in one kind
Spiral lamination;
Then, spiral lamination label is carried out to each training sample, it can mark in the training sample there are spiral lamination
Spiral lamination out, it is marked in the training sample there is no spiral lamination, and there is no spiral laminations.
It is trained finally, the training sample marked is input in deep learning network, to obtain spiral lamination classification
Device.The deep learning network can be for example CNN (convolutional neural networks) model etc., and it is special that the present exemplary embodiment does not do this
It limits.
It may include: the hot spot that interception detects to the process that the peripheral region of the hot spot detected carries out spiral lamination detection
And its peripheral region, that is, largest connected domain and its peripheral region are intercepted, the hot spot of interception and its peripheral region are input to spiral
In line classifier, spiral lamination classifier, which can export the hot spot peripheral region, whether there is the result of spiral lamination.Specifically, if spiral
The result of line classifier output is that there are spiral laminations for the hot spot peripheral region, it is determined that spiral lamination testing result meets preset spiral shell
Lira existence condition, if the result of spiral lamination classifier output is that spiral lamination is not present in the hot spot peripheral region, it is determined that spiral
Line testing result does not meet spiral lamination existence condition.
Step S108, according to the material information of certificate to be identified and detect pattern testing result, to certificate to be identified into
Row identification.
In this specification embodiment, for the detection mode to detect pattern is spiral lamination detection, hot spot peripheral region
It is determined with the presence or absence of spiral lamination by the material of certificate, that is, is directed to the certificate of part material, to certificate under to setting lighting condition
When the peripheral region of the hot spot detected in the image of shooting carries out spiral lamination detection, spiral lamination testing result meets preset spiral shell
Lira existence condition, that is, there are spiral laminations for the hot spot peripheral region in the image of the certificate shot;For another part material
Certificate, when the hot spot detected in image to document photography under to setting lighting condition carries out spiral lamination detection, spiral shell
Lira testing result does not meet preset spiral lamination existence condition, that is, in the hot spot peripheral region in the image of the certificate shot not
There are spiral laminations.Based on this, can in advance the certificate to every kind of material hot spot peripheral region carry out spiral lamination detection, Yi Jigen
According to the spiral lamination testing result of the certificate of every kind of material, the material of certificate is divided into first kind material and the second class material,
In, the certificate of the first kind material image captured in the case where setting lighting condition, spot detection result meets preset hot spot
Existence condition, and spiral lamination testing result meets preset spiral lamination existence condition, that is, there are light in the image of the certificate shot
Spot and there are spiral laminations for hot spot peripheral region;The certificate of the second class material image captured in the case where setting lighting condition, light
Spot testing result meets preset hot spot existence condition, and spiral lamination testing result does not meet preset spiral lamination existence condition,
There are hot spot but spiral lamination is not present in hot spot peripheral region in the image of the certificate shot.
Certificate to be identified is identified according to the material information of certificate to be identified and spiral lamination testing result based on this
Process may include:
It is possible, firstly, in conjunction with above-mentioned ready-portioned first kind material and the second class material in advance and according to certificate to be identified
Material information determines that the material of the certificate to be identified is first kind material or the second class material;
Then, if the material of certificate to be identified is first kind material, and spiral lamination testing result does not meet preset spiral
Line existence condition, it is determined that certificate to be identified is forged certificate;If the material of certificate to be identified is first kind material, and spiral lamination
Testing result meets preset spiral lamination existence condition, it is determined that certificate to be identified is real docu-ment;For more accurate identification
Certificate to be identified, if the material of certificate to be identified is first kind material, and spiral lamination testing result meets preset spiral lamination and deposits
In condition, then other identification of means can also be combined further to identify certificate to be identified on this basis.
If the material of certificate to be identified is the second class material, and spiral lamination testing result meets preset spiral lamination there are items
Part, it is determined that certificate to be identified is forged certificate;If the material of certificate to be identified is the second class material, and spiral lamination testing result
Preset spiral lamination existence condition is not met, it is determined that the certificate to be identified is real docu-ment;In order to it is more accurate identification to
Identify certificate, if the material of certificate to be identified is the second class material, and spiral lamination testing result does not meet preset spiral lamination and deposits
In condition, then other identification of means can also be combined further to identify certificate to be identified on this basis.
In conclusion providing a kind of mode for identifying certificate to be identified, and step is simply easy to carry out;In addition, due to
In the related art, only only this forgery means can be duplicated to papery in such a way that spot detection identifies certificate
Identified, can not recognition screen reproduction, copper sheet printing etc. forge means, and the present embodiment pass through combine spot detection side
The detection mode of the spiral lamination of the peripheral region of formula and hot spot can identify that papery duplicating, screen reproduction, copper sheet printing etc. are forged
Means, and then the accuracy rate of certificate identification is improved, so as to effectively identify certificate.
Corresponding above-mentioned certificate identification method, based on the same technical idea, this specification embodiment additionally provides a kind of card
Part identification apparatus, Fig. 6 are the composition schematic diagram for the certificate identification apparatus that this specification embodiment provides, and the device is for executing
Certificate identification method is stated, as described in Figure 6, which may include: to obtain module 601, spot detection module 602, detection figure
Sample detection module 603, identification module 604, in which:
Module 601 is obtained, for obtaining the first image in the case where setting lighting condition to document photography to be identified, wherein
The first image includes the image of the certificate to be identified;
Spot detection module 602, for carrying out spot detection to the first image;
Pattern detection module 603 is detected, if meeting preset hot spot existence condition for spot detection result, to detection
To hot spot peripheral region carry out detection pattern detection;
Module 604 is identified, for according to the material information of the certificate to be identified and detecting the testing result of pattern, to institute
Certificate to be identified is stated to be identified.
Optionally, the identification module 604, comprising:
First determination unit, if the material for the certificate to be identified is first kind material, and the detection pattern
Testing result does not meet preset detection pattern existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, described
The certificate of first kind material image captured under the setting lighting condition, spot detection result meets described preset
Hot spot existence condition, and the testing result for detecting pattern meets the preset detection pattern existence condition;
Second determination unit, if the material for the certificate to be identified is the second class material, and the detection pattern
Testing result meets preset detection pattern existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, described
The certificate of two class materials image captured under the setting lighting condition, spot detection result meet the preset light
Spot existence condition, and the testing result for detecting pattern does not meet the preset detection pattern existence condition.
Optionally, the spot detection module 602 includes:
Conversion unit, for converting gray level image for the first image;
Acquiring unit obtains the largest connected domain in the gray level image for being based on a gray threshold;
Judging unit, for judging whether the pixel quantity in the largest connected domain is greater than preset quantity;
Determination unit, for determining the spot detection result of the first image according to the judging result.
Optionally, the spot detection module 602 includes:
Alignment unit is aligned for the first image to be aligned template with pre-set certificate;
Interception unit, for intercepting the image of the certificate to be identified in the first image of alignment;
Conversion unit, for the image of the certificate to be identified to be converted to gray level image;
Acquiring unit obtains the largest connected domain in the gray level image for being based on a gray threshold;
Judging unit, for judging whether the pixel quantity in the largest connected domain is greater than preset quantity;
Determination unit, for determining the spot detection result of the first image according to the judging result.
Optionally, the determination unit includes:
First determines subelement, if the pixel quantity for the largest connected domain is greater than preset quantity, it is determined that described
The spot detection result of first image meets preset hot spot existence condition, and the largest connected domain is the hot spot detected;
Second determines subelement, if the pixel quantity for the largest connected domain is not more than preset quantity, it is determined that institute
It states the first image and does not meet preset hot spot existence condition.
Optionally, the acquiring unit includes:
Regulator unit, for adjusting the brightness of the gray level image so that the brightness of the gray level image meet it is default
Brightness requirement;
Subelement is obtained, for being based on a gray threshold, obtains the most Dalian in the gray level image after adjusting brightness
Logical domain.
Optionally, the detection pattern detection module 603, is deposited if meeting preset hot spot specifically for spot detection result
In condition, then the detection pattern classification device obtained based on one by deep learning network training, the peripheral region to the hot spot detected
Domain carries out the detection of detection pattern.
Certificate identification apparatus in this specification embodiment provides a kind of mode for identifying certificate to be identified, and step
It is simple easy to carry out;It, only only can be in such a way that spot detection identifies certificate in addition, due in the related art
This forgery means are duplicated to papery to identify, can not recognition screen reproduction, copper sheet printing etc. forge means, and this implementation
Example can identify that papery is multiple by way of combining spot detection and the detection mode of the detection pattern of the peripheral region of hot spot
Means are forged in print, screen reproduction, copper sheet printing etc., and then improve the accuracy rate of certificate identification, so as to effectively verify
Part is identified.
Corresponding above-mentioned certificate identification method, based on the same technical idea, this specification embodiment additionally provides a kind of card
Part evaluation apparatus, Fig. 7 are the structural schematic diagram for the certificate evaluation apparatus that this specification embodiment provides, and the equipment is for executing
The certificate identification method stated.
As shown in fig. 7, certificate evaluation apparatus can generate bigger difference because configuration or performance are different, it may include one
A or more than one processor 701 and memory 702 can store one or more storages in memory 702 and answered
With program or data.Wherein, memory 702 can be of short duration storage or persistent storage.It is stored in the application program of memory 702
It may include one or more modules (diagram is not shown), each module may include to the system in certificate evaluation apparatus
Column count machine executable instruction.Further, processor 701 can be set to communicate with memory 702, set in certificate identification
Series of computation machine executable instruction in standby upper execution memory 702.Certificate evaluation apparatus can also include one or one
The above power supply 703, one or more wired or wireless network interfaces 704, one or more input/output interfaces
705, one or more keyboards 706 etc..
In a specific embodiment, certificate evaluation apparatus includes memory and one or more journey
Sequence, perhaps more than one program is stored in memory and one or more than one program may include one for one of them
Or more than one module, and each module may include the series of computation machine executable instruction in certificate evaluation apparatus, and pass through
Configuration includes for carrying out following calculate to execute this or more than one program by one or more than one processor
Machine executable instruction:
It obtains in the case where setting lighting condition to the first image of document photography to be identified, wherein the first image includes
The image of the certificate to be identified;
Spot detection is carried out to the first image;
If spot detection result meets preset hot spot existence condition, the peripheral region of the hot spot detected is examined
The detection of mapping sample;
According to the material information of the certificate to be identified and the testing result of detection pattern, the certificate to be identified is carried out
Identification.
Optionally, computer executable instructions when executed, the material information according to the certificate to be identified and
The testing result for detecting pattern, identifies the certificate to be identified, comprising:
If the material of the certificate to be identified be first kind material, and it is described detection pattern testing result do not meet it is default
Detection pattern existence condition, it is determined that the certificate to be identified be forged certificate;Wherein, the certificate of the first kind material exists
Captured image under the setting lighting condition, spot detection result meets the preset hot spot existence condition, and examines
The testing result of mapping sample meets the preset detection pattern existence condition;
If the material of the certificate to be identified is the second class material, and the detection pattern testing result meets preset inspection
Mapping sample existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, the certificate of the second class material is described
Image captured under lighting condition is set, spot detection result meets the preset hot spot existence condition, and detects figure
The testing result of sample does not meet the preset detection pattern existence condition.
Optionally, computer executable instructions are when executed, described to include: to the first image progress spot detection
Gray level image is converted by the first image;
Based on a gray threshold, the largest connected domain in the gray level image is obtained;
Judge whether the pixel quantity in the largest connected domain is greater than preset quantity;
The spot detection result of the first image is determined according to the judging result.
Optionally, computer executable instructions are when executed, described to include: to the first image progress spot detection
The first image is aligned template with pre-set certificate to be aligned;
The image of the certificate to be identified is intercepted in the first image of alignment;
The image of the certificate to be identified is converted into gray level image;
Based on a gray threshold, the largest connected domain in the gray level image is obtained;
Judge whether the pixel quantity in the largest connected domain is greater than preset quantity;
The spot detection result of the first image is determined according to the judging result.
Optionally, computer executable instructions are when executed, described to determine first figure according to the judging result
The spot detection result of picture includes:
If the pixel quantity in the largest connected domain is greater than preset quantity, it is determined that the spot detection knot of the first image
Fruit meets preset hot spot existence condition, and the largest connected domain is the hot spot detected;
If the pixel quantity in the largest connected domain is not more than preset quantity, it is determined that the first image does not meet default
Hot spot existence condition.
Optionally, computer executable instructions are when executed, described to be based on a gray threshold, obtain the gray level image
In largest connected domain include:
The brightness of the gray level image is adjusted, so that the brightness of the gray level image meets predetermined luminance requirement;
Based on a gray threshold, the largest connected domain in the gray level image after adjusting brightness is obtained.
Optionally, computer executable instructions when executed, examine by the peripheral region of the described pair of hot spot detected
The detection of mapping sample includes:
The detection pattern classification device obtained based on one by deep learning network training, the peripheral region to the hot spot detected
Carry out the detection of detection pattern.
Certificate evaluation apparatus in this specification embodiment provides a kind of mode for identifying certificate to be identified, and step
It is simple easy to carry out;It, only only can be in such a way that spot detection identifies certificate in addition, due in the related art
This forgery means are duplicated to papery to identify, can not recognition screen reproduction, copper sheet printing etc. forge means, and this implementation
Example can identify that papery is multiple by way of combining spot detection and the detection mode of the detection pattern of the peripheral region of hot spot
Means are forged in print, screen reproduction, copper sheet printing etc., and then improve the accuracy rate of certificate identification, so as to effectively verify
Part is identified.
Corresponding above-mentioned certificate identification method, based on the same technical idea, this specification embodiment additionally provides one kind and deposits
Storage media, for storing computer executable instructions.
In a specific embodiment, which can store for USB flash disk, CD, hard disk etc., the storage medium
Computer executable instructions are able to achieve following below scheme when being executed by processor:
It obtains in the case where setting lighting condition to the first image of document photography to be identified, wherein the first image includes
The image of the certificate to be identified;
Spot detection is carried out to the first image;
If spot detection result meets preset hot spot existence condition, the peripheral region of the hot spot detected is examined
The detection of mapping sample;
According to the material information of the certificate to be identified and the testing result of detection pattern, the certificate to be identified is carried out
Identification.
Optionally, the computer executable instructions of storage medium storage are described according to when being executed by processor
The material information of certificate to be identified and the testing result for detecting pattern, identify the certificate to be identified, comprising:
If the material of the certificate to be identified be first kind material, and it is described detection pattern testing result do not meet it is default
Detection pattern existence condition, it is determined that the certificate to be identified be forged certificate;Wherein, the certificate of the first kind material exists
Captured image under the setting lighting condition, spot detection result meets the preset hot spot existence condition, and examines
The testing result of mapping sample meets the preset detection pattern existence condition;
If the material of the certificate to be identified be the second class material, and it is described detection pattern testing result meet it is preset
Detect pattern existence condition, it is determined that the certificate to be identified is forged certificate;Wherein, the certificate of the second class material is in institute
Image captured under setting lighting condition is stated, spot detection result meets the preset hot spot existence condition, and detects
The testing result of pattern does not meet the preset detection pattern existence condition.
Optionally, the computer executable instructions of storage medium storage are described to described the when being executed by processor
One image carries out spot detection
Gray level image is converted by the first image;
Based on a gray threshold, the largest connected domain in the gray level image is obtained;
Judge whether the pixel quantity in the largest connected domain is greater than preset quantity;
The spot detection result of the first image is determined according to the judging result.
Optionally, the computer executable instructions of storage medium storage are described to described the when being executed by processor
One image carries out spot detection
The first image is aligned template with pre-set certificate to be aligned;
The image of the certificate to be identified is intercepted in the first image of alignment;
The image of the certificate to be identified is converted into gray level image;
Based on a gray threshold, the largest connected domain in the gray level image is obtained;
Judge whether the pixel quantity in the largest connected domain is greater than preset quantity;
The spot detection result of the first image is determined according to the judging result.
Optionally, the computer executable instructions of storage medium storage are described according to when being executed by processor
Judging result determines that the spot detection result of the first image includes:
If the pixel quantity in the largest connected domain is greater than preset quantity, it is determined that the spot detection knot of the first image
Fruit meets preset hot spot existence condition, and the largest connected domain is the hot spot detected;
If the pixel quantity in the largest connected domain is not more than preset quantity, it is determined that the first image does not meet default
Hot spot existence condition.
Optionally, the computer executable instructions of storage medium storage are described to be based on an ash when being executed by processor
Threshold value is spent, the largest connected domain obtained in the gray level image includes:
The brightness of the gray level image is adjusted, so that the brightness of the gray level image meets predetermined luminance requirement;
Based on a gray threshold, the largest connected domain in the gray level image after adjusting brightness is obtained.
Optionally, when being executed by processor, described pair detects the computer executable instructions of storage medium storage
Hot spot peripheral region carry out detection pattern detection include:
The detection pattern classification device obtained based on one by deep learning network training, the peripheral region to the hot spot detected
Carry out the detection of detection pattern.
The computer executable instructions of storage medium storage in this specification embodiment are provided when being executed by processor
A kind of mode that identifying certificate to be identified, and step is simply easy to carry out;In addition, only passing through light due in the related art
The mode that certificate is identified in spot detection only can duplicate this forgery means to papery and identify, can not identify screen
Means are forged in curtain reproduction, copper sheet printing etc., and the present embodiment is by way of combining spot detection and the peripheral region of hot spot
The detection mode for detecting pattern can identify the forgeries means such as papery duplicating, screen reproduction, copper sheet printing, and then improve card
The accuracy rate of part identification, so as to effectively identify certificate.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " is patrolled
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed is most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method process can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and insertion microcontroller, the example of controller includes but is not limited to following microcontroller
Device: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320 are deposited
Memory controller is also implemented as a part of the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained to come in fact in the form of logic gate, switch, specific integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc.
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when specification.
It should be understood by those skilled in the art that, the embodiment of this specification can provide as method, system or computer journey
Sequence product.Therefore, in terms of this specification can be used complete hardware embodiment, complete software embodiment or combine software and hardware
Embodiment form.Moreover, it wherein includes computer usable program code that this specification, which can be used in one or more,
The computer implemented in computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of program product.
This specification is referring to the method, equipment (system) and computer program product according to this specification embodiment
Flowchart and/or the block diagram describes.It should be understood that can be realized by computer program instructions every in flowchart and/or the block diagram
The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.It can provide these computers
Processor of the program instruction to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices
To generate a machine, so that generating use by the instruction that computer or the processor of other programmable data processing devices execute
In the dress for realizing the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram
It sets.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that the embodiment of this specification can provide as the production of method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or implementation combining software and hardware aspects can be used in this specification
The form of example.Moreover, it wherein includes the computer of computer usable program code that this specification, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
This specification can describe in the general context of computer-executable instructions executed by a computer, such as journey
Sequence module.Generally, program module include routines performing specific tasks or implementing specific abstract data types, programs, objects,
Component, data structure etc..This specification can also be practiced in a distributed computing environment, in these distributed computing environment
In, by executing task by the connected remote processing devices of communication network.In a distributed computing environment, program module
It can be located in the local and remote computer storage media including storage equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The foregoing is merely the embodiments of this specification, are not limited to this specification.For art technology
For personnel, this specification can have various modifications and variations.It is all made any within the spirit and principle of this specification
Modification, equivalent replacement, improvement etc., should be included within the scope of the claims of this specification.