A kind of true and false seal recognition device and method thereof
Technical field
The present invention relates to the seal recognition system of a set of mobile device and server mode, rely on the seal data of public security department, accurately the identifying stamp true and false, specifically provides a kind of true and false seal recognition device and method thereof.
Technical background
At present, China is not also very ripe in aspect technology such as control of stamping, anti-counterfeit of seals and seal identifications, under the driving of tremendous economic interests, offender forges administrations at different levels, law enforcement agency without restraint, financial institution and enterprises and institutions and legal person's seal, cause huge economic loss to country, collective and individual, social public security has been formed to serious harm, greatly destroyed social public credibility.
About seal recognition technology, although academicly someone studies, do not drop into concrete application, and learned research contents is confined to traditional images disposal route substantially, practical application effect is not fine, treatment effeciency is lower.Meanwhile, learned method is not considered separately for seal original paper and copy, is of limited application.We have added the method for neural network on the basis of traditional images disposal route, utilize the image-capable that neural network is powerful, make algorithm general performance more stable, efficient.By the research of this project, improve seal from recognition technology aspect and forge difficulty, provide effective technical support for hitting falsification of seal crime.
Summary of the invention
The object of the present invention is to provide a kind of true and false seal recognition device and method thereof.
The present invention is to achieve these goals by the following technical solutions:
The invention provides a kind of true and false seal recognition device, it is characterized in that comprising:
Client: gather seal designs, seal numbering, and be uploaded to server;
Server: to the seal designs information decoding of client upload, then find out the image of keeping on file of seal according to seal numbering, system enters cognitive phase, and cognitive phase is realized by printed text extraction element, printed text registration apparatus and true and false discriminating gear;
Printed text extraction element, uses the technology of PCNN burning to extract to printed text the printed text information that obtains, and adopts the reparation algorithm (being called for short FMM) of advancing fast to repair the printed text information of extracting, and obtains complete printed text information;
Printed text registration apparatus, carries out registration by the printed text of extracting and the printed text of keeping on file, by printed text rotation and distortion to extracting, the spatial relation that extracts printed text is adjusted to and the printed text of keeping on file matches;
True and false discriminating gear, true and false differentiation is by the printed text after registration and original printed text comparison, calculates the diversity factor of two width images by partition, according to the threshold value of setting, judges that seal is true and false.
Technique scheme, the technology that uses PCNN burning in printed text extraction element is extracted and is obtained printed text information and specifically comprise the following steps printed text,
2a, utilize PCNN combustion technology to extract seal housing skeleton,
Extract successfully, be that skeleton is closed and big or small at zone of reasonableness, just generate seal housing profile according to the skeleton extracting, the colouring information on recycling profile is determined the color gamut of printed text, press color gamut and extract, finally only choose the printed text within the scope of seal housing contoured;
Extract unsuccessfully, input picture is coloured image, and the color gamut definite according to HSI color model extracts printed text; Be gray level image, adopt the method for large Tianjin method Threshold segmentation and tonal range combination to extract printed text;
2b, part outside the background on image to be identified and the printed text that extracts, as the pollution of seal impression, adopt the reparation algorithm (being called for short FMM) of advancing fast to repair the printed text information of extracting, and obtain complete printed text information.
Technique scheme, printed text registration apparatus, adopts the seal image method for registering of Low-Rank and SURF feature to comprise:
Step 3a, be first the SURF unique point that calculates printed text to be identified and the printed text of keeping on file, determine the description operator of each unique point;
Step 3b, carry out quick initial matching to calculating quadratic sum distance between these SURF unique points, obtain two coupling matrixes, then use Low-Rank method to obtain these two transition matrixes between coupling matrix;
Step 3c, change printed text to be identified according to transition matrix, try to achieve the registering images of printed text to be identified.
Technique scheme, true and false discriminating gear, adopts partition, calculates respectively the diversity factor of each fritter, chooses the diversity factor mean value of the piece that wherein diversity factor is larger as the true and false discrimination standard of seal.
Technique scheme, it is 8 × 8 fritter that image is divided equally, gets the piece of front 20 diversity factor maximums.
The present invention also provides a kind of true and false seal recognition methods, it is characterized in that:
Step 1, printed text are extracted, and use the technology of PCNN burning to extract to printed text the printed text information that obtains; Adopt the reparation algorithm (being called for short FMM) of advancing fast to repair the printed text information of extracting, obtain complete printed text information;
Step 2, printed text registration, carry out registration by the printed text of extracting and the printed text of keeping on file, by printed text rotation and distortion to extracting, the spatial relation that extracts printed text adjusted to and the printed text of keeping on file matches;
Step 3, true and false differentiation, by the printed text after registration and original printed text comparison, calculate the diversity factor of two width images by partition, according to the threshold value of setting, judge that seal is true and false.
Technique scheme, the technology that uses PCNN burning in step 1 is extracted and is obtained printed text information and specifically comprise the following steps printed text:
Utilize PCNN combustion technology to extract seal housing skeleton,
Extract successfully, be that skeleton is closed and big or small at zone of reasonableness, just generate seal housing profile according to the skeleton extracting, the colouring information on recycling profile is determined the color gamut of printed text, press color gamut and extract printed text, finally only choose the printed text within the scope of seal housing contoured;
Extract unsuccessfully, input picture is coloured image, just extracts printed text according to the definite color gamut of HSI color model; Be gray level image, just adopt the method for large Tianjin method Threshold segmentation and tonal range combination to extract printed text;
Finally, part outside the background on image to be identified and the printed text that extracts is as the pollution of seal impression, adopt the reparation algorithm (being called for short FMM) of advancing fast to repair the printed text information of extracting, just extract complete printed text information through above processing.
Technique scheme, adopts the seal image method for registering of Low-Rank and SURF feature to comprise the following steps in step 2,
Step 8a, calculate the SURF unique point of printed text to be identified and the printed text of keeping on file, determine the description operator of each unique point;
Step 8b, carry out quick initial matching to calculating quadratic sum distance between these SURF unique points, obtain two coupling matrixes, then use Low-Rank method to obtain these two transition matrixes between coupling matrix;
Step 8c, change printed text to be identified according to transition matrix, just tried to achieve the registering images of printed text to be identified.
Technique scheme, in step 3, true and false differentiation adopts partition, calculates respectively the diversity factor of each fritter, chooses the diversity factor mean value of the piece that wherein diversity factor is larger as the true and false discrimination standard of seal.
Technique scheme, it is 8 × 8 fritter that image is divided equally, gets the piece of front 20 diversity factor maximums.
The present invention is because adopt above technical scheme, so possess following beneficial effect:
(1) customer end adopted mobile phone A PP mode of the present invention, has overturned the seal recognition system of conventional P C version, and mobile phone A PP makes this system move towards broad masses, has more wide market;
(2) this system high efficiency is stable, has improved the efficiency of customer transaction, contract signing;
(3) discrimination is high, has ensured the security of client trading;
(4) by the original paper that is stamped seal and copy being formulated to the different printed text extraction schemes of two covers, not only realize the seal identification on document text, can also precisely identify the seal of copy;
(5) native system mobile terminal has adopted the Design Mode of MVC, and system architecture is reasonable, and beautiful interface is generous, is easy to learn and use, and is applicable to various conditions and place.The communication of client and server end all adopts SOAP+JSON agreement, and data transmission security is reliable, does not worry that data are stolen by undesirable.Server end adopts the parallelization processing of height to customer side request, system processing speed is fast, is swift in response.
Brief description of the drawings
Fig. 1 is operational flowchart of the present invention;
Fig. 2 is the topological structure of PCNN, and the left side is a width bianry image, and the right is the topological structure of the Pulse Coupled Neural Network PCNN corresponding with it;
Fig. 3 is single neuron models in PCNN.
Embodiment
The present invention is in order to provide one seal genuine-fake identification system safely and effectively, and its workflow is divided into as shown in Figure 1: 1, user uses mobile phone to take seal picture; 2,13 seal numberings above input seal; 3, system is carried out seal identification; 4, user checks the recognition result returning.
We have realized respectively following client and server end function.First, user uses client to complete contract, and the seal designs above such as bill is taken pictures, and chooses part interested, then allows user fill out seal numbering, and these information exchanges are crossed upload server after SOAP+JSON protocol code by client.Server end receives image and the seal number information of client upload, first to these information decodings, then finds out the image of keeping on file of seal according to seal numbering.Complete after these preliminary works, system enters formal cognitive phase.
This stage is mainly made up of three steps, is that printed text is extracted successively, printed text coupling and true and false differentiation.Printed text is extracted the reparation algorithm of advancing fast that has mainly used the combustion technology based on Pulse Coupled Neural Network (PCNN-Pulse Coupled Neural Network) and Telea to propose; Printed text registration is mainly to try to achieve image to be identified by calculating SURF unique point to realize registration to the transition matrix of the image of keeping on file; When true and false differentiation, registering images and the image of keeping on file are carried out to piecemeal, calculated difference value respectively, last COMPREHENSIVE CALCULATING result, judges that seal is true and false.
Server end completes after seal identification mission, result can be sent to client by SOAP+JSON protocol code, client decoding Identification display result.So just complete the once correct flow process of identification mission.
Seal identification concrete steps:
The first step is that printed text is extracted.It is to extract user to upload the printed text information in image that printed text is extracted, and removes the interfere information outside printed text.In this step, we have mainly used the technology of PCNN burning to realize the extraction to printed text.Incipient stage, we carry out some pre-service to image, as image smoothing, and convergent-divergent etc.Then we utilize PCNN combustion technology to extract seal housing skeleton, if extract successfully (skeleton is closed and big or small at zone of reasonableness), just generate seal housing profile according to the skeleton extracting, colouring information on recycling profile is determined the color gamut of printed text, press color gamut and extract, finally only choose the printed text within the scope of seal housing contoured; If skeletal extraction failure, input picture is coloured image, just extracts printed text according to the definite color gamut of HSI color model; Be gray level image, just adopt the method for large Tianjin method Threshold segmentation and tonal range combination to extract printed text.Finally, our part outside the background on image to be identified and the printed text that extracts is as the pollution of seal impression, adopt the reparation algorithm based on advancing fast (being called for short FMM) being proposed in 2004 by Telea to repair the printed text information of extracting, just extracted than more complete printed text information through above processing.
I in Fig. 3
i,jrepresent the input from external environment condition, Y
k(1≤k≤4) represent neuron N
i,jin abutting connection with neuronic input.F
i,jand L
i,jrepresent to be respectively fed to input and link input, in this model, be fed to input F
i,jbe numerically equal to external environment condition input I
i,j, link input L
i,jbe in abutting connection with neuron output and.In modulation areas, internal act U
i,jcalculated by following formula,
U
i,j=F
i,j(1+ β
i,jl
i,j), β
i,jrepresent link strength
Calculate by function below
When Pulse Coupled Neural Network is except above-described general characteristic, also there is following features:
1. neuron N
i,jbe fed to input F
i,jfor pixel P
i,jgray-scale value;
2. neuron N
i,jonly be subject to around and neuron N that its links
i-1, j, N
i, j-1, N
i, j+1and N
i+1, jimpact, at this moment this neuronic link input L
i,jcomputing formula be, L
i,j=Y
i-1, j+ Y
i, j-1+ Y
i, j+1+ Y
i+1, j
3. threshold value θ
i,jcomputing formula be,
wherein
two given constants
Second step is printed text registration.Printed text registration is that the printed text of extracting and the printed text of keeping on file are carried out to registration, is mainly by printed text rotation and distortion to extracting, the spatial relation that extracts printed text is adjusted to and the printed text of keeping on file matches.We the method that proposes based on SURF feature and Low-Rank carry out seal image registration this step, first be to calculate printed text picture to be identified and the SURF unique point of the printed text picture of keeping on file, determine the description operator of each unique point, the simple quadratic sum distance of calculating between these points is carried out to quick initial matching, obtain two coupling matrixes, then use Low-Rank method to obtain these two transition matrixes between coupling matrix.Change printed text to be identified according to this transition matrix, just tried to achieve the registering images of printed text to be identified.
Image registration is a process the most basic in image pre-service, and registration is exactly that an image is made to its process consistent with another image through over-rotation, scaling and translation transformation.Can use P
2=Τ (P
1)=AP
1+ t presentation video conversion process, wherein A is the matrix that represents to rotate scaling, and t is the vector that represents translation, and T is the transformation matrix after expansion,
The matrix of conversion process is above expanded
T is the transformation matrix after expansion.
Then, accelerate the unique point of robust features (SURF, Speed-up Robust Feature) extraction two width images by employing, and for characteristic matching, just the simple quadratic sum distance of calculating between point is carried out to quick initial matching, obtain the matrix that two match points form
Note
P
1, P
2major part is what correctly to have been matched, but still has the pairing of some mistakes.We represent with row sparse matrix E
transform to P
2time error, i.e. P '
2=P
2-E has simultaneously
can obtain
so we need to try to achieve T, E and satisfy condition
under make || E||
2,1minimum.|| E||
2,1a convex function, by introducing secondary penalty term
with Lagrange multiplier item
can construct unconfined objective function:
Wherein μ is penalty coefficient
Two problems that will alternately solve in the iteration of alternating direction multiplier method are
①
②
Deal with problems 1., we can be the in the situation that of fixing E and Λ, to L
μ(T) ask the local derviation of T
Derivative zero setting can be obtained
Wherein
be
pseudoinverse, Ke Yiyou
compact svd unique determine.
Deal with problems 2., we have introduced the sealing solution of soft-threshold operator (Soft-Thresholding):
Wherein Θ
τ(.) is a row soft-threshold operator, is defined as:
The 3rd step is true and false differentiation.True and false differentiation is by the printed text after registration and original printed text comparison, calculates the diversity factor of two width images by partition, according to the threshold value of setting, judges that seal is true and false.Here we directly do not calculate printed text to be identified and the diversity factor of printed text of keeping on file, but have adopted the technology of piecemeal, calculate respectively the diversity factor of each fritter, choose some piece diversity factor mean values that wherein diversity factor is larger as the true and false discrimination standard of seal.Through a series of experiment, we find image to divide equally is 8 × 8 fritter, gets the piece of front 20 diversity factor maximums, and recognition effect is best.Then according to experiment record seal be true chapter, false chapter and the threshold decision separately of suspicion obtain the true and false of seal to be identified.
After registration and binaryzation, the image of perceptron input becomes and the equirotal bianry image of the image of keeping on file (element value is 0 or 1 matrix), can represent with following matrix A, B:
Then the diversity factor that we define two matrixes (two width images) is d=F (A, B),
If to entire image calculated difference degree d=F (A, B), experimental result is also bad, because true chapter and false chapter are after registration, the matching result of entirety is very close, i.e. d=F (A, B) very approaching, cannot go to judge the seal true and false by this standard, but we notice that true chapter is all the good of coupling on the whole, false chapter can be serious in some regional areas coupling dislocation.According to this information, we use piecemeal calculated difference degree to choose wherein larger value averaged as diversity factor again, carry out the interpretation seal true and false.Specifically A and B are divided into uniform 8 × 8 pieces.
Ask respectively d
ij=F (A
ij, B
ij) can obtain
Then element in D is pressed to sequence from big to small, the mean value of getting front 20 elements is the diversity factor of two width images,
It is true and falsely judged.