Summary of the invention
The object of the present invention is to provide the recognition methods of a kind of novel banknote hat font size, the method can be identified the hat font size of Renminbi in fast and stable ground, thus the monitoring and the management that contribute to Renminbi to flow to.
Technical scheme of the present invention is: the recognition methods of banknote hat font size, comprising: first on the Renminbi image under visible ray, font size region is preced with in location; Then use respectively the hat font size recognition methods based on the minimizing hat font size recognition methods of wavelet transformation localized mode and improved support vector machine independently to identify hat font size; Finally use the method for discrimination based on weights to carry out combination decision to aforementioned two kinds of recognition methodss, draw final recognition result.
Described method, on Renminbi image, the method in location hat font size region comprises: first with the canny operator of dual threshold, the image in hat font size region is carried out to rim detection to obtain edge image, afterwards for the marginal point of edge image, in original image, find corresponding point as Seed Points and grow under certain condition, recycling high threshold merges image and the edge image after Seed Points growth, and use the image after low threshold value is combined to carry out denoising, obtained the hat font size area image after binaryzation.
Described method, on Renminbi image, the method in location hat font size region specifically comprises the following steps:
1) to hat font size area image, use the canny operator of dual threshold to process, the edge image obtaining is designated as I
1, wherein high threshold is designated as W;
2) to hat font size area image, use Gaussian filter to carry out preliminary denoising, the image obtaining is designated as I
2;
3) at edge image I
1in, for each marginal point, at I
2in find the identical point in position, and record I
2in the point of gray-scale value minimum in 8 neighborhoods of these points, be defined as Seed Points;
4) at edge image I
1in find gradient to be greater than the point of W, simultaneously at I
2in find the identical point in position, record I
2in the point of gray-scale value maximum and minimum point in 8 neighborhoods of these points, carry out producing after this step two point sets: the maximum point set H={h of gray-scale value
1, h
2..., h
nand the minimum point set L={l of gray-scale value
1, l
2..., l
n, h wherein
iand l
irespectively the point of gray-scale value maximum in 8 neighborhoods of these points and the gray-scale value of minimum point, i value 1,2,3 ... n, n is the number of the point of gray-scale value maximum or the point of minimum;
5) the mean value H of difference set of computations H and L
pand L
p;
6) use H
pdo threshold value to I
2carry out binaryzation, the image obtaining is designated as I
3;
7) merge image I
3with edge image I
1, obtain image I
4;
8) corresponding to image I
4each corresponding Seed Points, utilize algorithm of region growing to process, obtain image I
5;
9) use L
pdo threshold value to I
2carry out binaryzation, the image obtaining is designated as I
6;
10) merge image I
5and I
6, obtain binary image I
7;
11) to image I
7carry out denoising, obtain the image of final binaryzation;
12) normalization prefix sign character to be identified.
Described method, based on the minimizing hat font size of wavelet transformation localized mode, recognition methods is: the skeleton that first extracts hat font size by wavelet transformation localized mode minimal value; Then further carry out denoising, eliminate the burr on skeleton; Finally extract the various features of skeleton, thus identification hat font size.
Described method, the step of extracting hat font size skeleton by wavelet transformation localized mode minimal value comprises:
1) for input picture, select suitable yardstick to carry out wavelet transformation, calculate the mould value of wavelet coefficient; Utilize the character of wavelet coefficient to carry out target and background separation simultaneously;
2) the mould value of wavelet transformation is carried out to many thresholdings, extract the initialized skeleton of hat font size;
3) to step 2) skeleton that obtains judges, if skeleton is single pixel, this point is exactly effective skeleton point so; Otherwise with regard to again carrying out wavelet transformation, go to step 1);
4) according to step 3) all skeleton points of obtaining, obtain final skeleton.
Described method, extracts the various features identification of skeleton and is preced with in the method for font size, and the feature of required extraction comprises:
1) the transverse crossing number of times of the specific row or column of skeleton image and longitudinally traversing times;
2) the non-zero section number of the transverse projection of the specific row or column of skeleton image and longitudinal projection and non-zero segment length;
3) number of skeleton image bifurcation;
4) number on skeleton diagram image circle and limit.
Described method, use the method for discrimination based on weights to show that the step of final recognition result comprises:
1) measure respectively the discrimination of the hat font size recognition methods based on the minimizing hat font size recognition methods of wavelet transformation localized mode and improved support vector machine;
2) for step 1) the higher employing high weight of discrimination in described two kinds of methods, the low weights of employing that discrimination is lower;
3), for the character of input, if the identification of described two kinds of methods obtains is same result R, net result is exactly R; If two kinds of result differences that method obtains, are respectively R
1and R
2, so according to step 1) discrimination and step 2) weights calculate, obtain final result.
The invention has the beneficial effects as follows:
1) adopt effective image segmentation algorithm, overcome hat font size region and had the impact of the situation of spot on discrimination, strengthened the recognition capability that hat font size region is had to the banknote of spot, greatly improved the discrimination of hat font size.The present invention has obviously improved the effect of binaryzation, has greatly facilitated the subsequent treatment of hat font size identification, contributes to the circulation of monitoring and management Renminbi.
2) feature of hat font size has been described all-sidedly and accurately.Because traditional method is just for the single single mode identification method of feature selecting of hat font size, some essential characteristic that hat font size possesses have been ignored.Adopt herein two kinds independently method hat font size different feature is described, improved in itself the accuracy of hat font size identification.
Embodiment
The present invention, on tradition hat font size recognizer basis, adds based on the manifold description of hat font size, adopts diverse ways to portray the feature of hat font size, can improve significantly the discrimination of hat font size.
The present invention is a kind of combined recognising method based on the minimizing skeleton of localized mode and improved SVM, first the present invention locates hat font size region on the Renminbi image under visible ray, then use two kinds of independences and be preced with efficiently font size recognition methods (being respectively the hat font size recognition methods based on the minimizing hat font size recognition methods of wavelet transformation localized mode and improved support vector machine) identification hat font size, finally use the method for discrimination based on weights to carry out combination decision, draw final recognition result.
The present invention has following three key problem in technology points:
1) utilize dual threshold to carry out binary conversion treatment to former figure, greatly strengthened the recognition capability that hat font size region is had to the banknote of spot;
2) adopt based on the minimizing skeleton recognition methods of wavelet transformation localized mode with based on improved SVM (support vector machine) recognition methods hat font size is identified, portrayed the feature of hat font size comprehensively;
3) adopt decision method based on weights to carry out combination decision and draw the final recognition result of hat font size, make to be preced with font size recognition result more stable, can effectively improve discrimination.
Crucial part of the present invention is two kinds of independences and is preced with efficiently font size recognition methods and effective decision method, as follows:
One, based on the recognition methods of the minimizing hat font size of wavelet transformation localized mode
Utilize wavelet transformation localized mode minimal value to extract the skeleton (strip) of hat font size.The minimizing position of localized mode of wavelet coefficient is independent of wavelet scale conversion, and it can extract the central point (skeleton) of symmetrical edge contour.Because having portrayed in gray level image, wavelet transformation local minimum changes pixel the most slowly.These points have two classes, and a class is the point set of background area, and another kind of is the point set being positioned on target's center's line, and they are skeleton.In this patent, selecting the derivative of cubic B-spline function is wavelet function.
ψ(x)=θ′(x) (1)
Wherein, x is wavelet function independent variable, and θ (x) is cubic B-spline function, and ψ (x) is wavelet function.
The performing step of skeletal extraction is:
(1) for input picture, select suitable yardstick to carry out wavelet transformation, calculate the mould value of wavelet coefficient; Utilize the character of wavelet coefficient to carry out target and background separation simultaneously.
(2) the mould value of wavelet transformation is carried out to many thresholdings, extract the initialized skeleton of hat font size.
(3) if skeleton is single pixel, this point is exactly effective skeleton point so, otherwise just again carries out wavelet transformation, and search modulus minimum is as effective skeleton point; Thereby obtain final skeleton.
Further carry out denoising, eliminate the burr on skeleton, thereby obtain the good skeleton of visual effect.
For skeleton image (pixel of this patent acquiescence pixel value 0 is background, and the pixel of pixel value 1 is prospect), extract following characteristics:
(1) the transverse crossing number of times of specific row or column and longitudinally traversing times
The calculating of traversing times: for a width bianry image, first pixel be 1 or pixel value from 0, become 1 calculating and pass through 1 time, otherwise not so, the traversing times as 100110 is 2.
As Fig. 3, get the center section (supposing to get 6 row) of " 8 " of skeletonizing, its longitudinal traversing times cumulative sum is 14.
(2) the non-zero section number of the transverse projection of specific row or column and longitudinal projection and non-zero segment length
Zero section, non-zero section are defined as: if M is the projection array of piece image or parts of images, its value is { 0,0,4,25,22,0,0,0,55,56,0,0,0,0}.Definition is that 0 part is zero section continuously, is not that 0 part is non-zero section continuously.As the first two 0 in array M, middle 30, after 40, this projection array has 3 zero sections; { 4,25,22} is with { 55,56}, this projection array has 2 non-zero sections two non-zero sections.
Non-zero segment length L
nbe calculated as follows: if n non-zero groups of a projection array is combined into M
1, M
2... .., M
i, M wherein
1label in corresponding array is m
1, M
ilabel in corresponding array is m
i, n coordinate length L so
n=m
i-m
1+ 1.
The coordinate number of M is 3+1=4, first coordinate length L
1=5-3+1=3, second coordinate length L
2=10-9+1=2.
So if get the right half part of " 6 " after skeletonizing, its transverse projection non-zero section number is 2.First coordinate length is that 2, the second coordinate length are 11.
(3) number of skeleton image bifurcation.
Bifurcation is defined as: for the image of a skeletonizing, from figure why not take up an official post with 2 points along different directions, to find pixel value be not 0 point, after limited number of time, can find same point, just say that this point finding is bifurcation.
As Fig. 4, the bifurcation number of " 6 " after skeletonizing is 1, and the bifurcation number of letter " H " is 2.
(4) number on skeleton image " circle " and " limit ".
" circle " is defined as: for the image of a skeletonizing, from any one foreground pixel point, along skeleton, find foreground pixel point in a direction, after limited number of time search, still can get back to starting point, the region that path of search surrounds is exactly " circle ".If image has bifurcation, from bifurcation along two paths, find respectively the point that is not 0, after limited number of time, still can find this bifurcation, this image has two " circles ".
" limit " is defined as: for the image of a skeletonizing, from any one foreground pixel point, by any direction, along skeleton, find foreground pixel point, what after limited number of time search, find is background dot, claims this image to have one " limit ".The number value on " limit " is 0 or 1, has " limit " or does not have " limit ".
So, for example the number of " circle " of " 0 " after skeletonizing is 1, the number on " limit " is 0, the number of " circle " of letter " B " is 2, the number on " limit " is 0, and the number of " circle " of " 9 " is 1, and the number on " limit " is 1, the number of " circle " of letter " C " is 0, and the number on " limit " is 1.
By extraction, be preced with 26 letters and 10 above corresponding essential characteristic of numeral in 36 characters of font size, just can describe out their unique features, thereby they are identified.
Two, the hat font size recognition methods of the image segmentation algorithm based on dual threshold and improved support vector machine
Two key points of this recognition methods are as follows:
(1) image segmentation algorithm based on dual threshold
It is the committed step of pattern-recognition that image is cut apart.The pre-service of this patent recognition methods has adopted a kind of new and effective binarization method, the impact that can effectively eliminate the hat contaminated impact in font size region and binaryzation result be caused due to the difference of banknote version.First this method carries out rim detection with the canny operator of dual threshold to the image in hat font size region, afterwards for the marginal point of edge image, in original image, find corresponding point as Seed Points and grow under certain condition, recycling high threshold merges this image and edge image, and use the image after low threshold value is combined to carry out denoising, just can arrive the image after binaryzation.
(2) improved support vector machine
Support vector machine is at high-dimensional feature space, to use the learning system of linear function hypothesis space, and it is to be trained by a learning algorithm from Optimum Theory, and it can solve the problem of linearly inseparable, as hat font size identification problem.Support vector machine is mapped to a high-dimensional feature space by pre-determined Nonlinear Mapping by input vector matrix X, then in this higher dimensional space, builds optimal classification lineoid.Nonlinear Mapping is specifically reflected in support vector machine and adopts certain kernel function, thereby avoids carrying out complicated calculating in high-dimensional feature space.
Because the identification of hat font size is a linearly inseparable problem.So many Nonlinear Mapping links during than processing linear separability problem when processing this problem.
Suppose that this Nonlinear Mapping is:
x →ψ(x) (2)
Wherein, x is sample characteristics collection, and ψ (x) is x correspondence mappings function.
Optimization aim is:
Be limited to y
i(w ψ (x
i)+b)>=1 (3)
Wherein, x
icorresponding to the feature set of i training sample, y
irepresent corresponding class label, ψ (x
i) expression x
icorrespondence mappings function, w and b presentation class device model parameter.
This affined optimization problem can be converted into:
Wherein, L (a) represents antithesis Lagrangian corresponding to optimization problem, α
i, α
jrepresent Lagrange multiplier corresponding to i, a j sample, n represents sample number.
In (2) formula, the sample of luv space, after nonlinear transformation, is mapped to very higher-dimension or even infinite dimensional feature space.If directly find largest interval classification lineoid in this higher dimensional space, as (4) formula, on calculating, will be very difficult or even imponderable.
Meeting under Mercer condition, by using kernel function K, realizing K (x
i, x
j)=ψ (x
i) ψ (x
j), that is to say the inner product of directly calculating higher dimensional space with the variable in former space.So just avoid complicated Nonlinear Mapping process, thereby realized the computing of carrying out higher dimensional space at lower dimensional space.
Therefore, formula (4) becomes
Finally, the decision function of Nonlinear Vector machine becomes:
Wherein, x represents sample to be tested eigen collection, and f (x) is the prediction for the treatment of the label of test sample book.
The present invention is based on the theory of above traditional support vector machine, in conjunction with the specific characteristic of the hat font size extracting before, adopt Gaussian radial basis function (RBF) K (x herein
i, x
j)=exp (|| x
i-x
j||
2/ σ
2) (σ represents the variance of Gaussian radial basis function) as the kernel function of support vector machine.With the SVM model training, characteristic vector data to be measured is classified, identification hat font size.
According to above two key points, the concrete operations flow process of this recognition methods is as follows:
(1) to hat font size area image, use the canny operator of dual threshold (wherein high threshold is designated as W) to process, the image obtaining is designated as I
1.
(2) to hat font size area image, use Gaussian filter to carry out preliminary denoising, the image obtaining is designated as I
2.
(3) at edge image I
1in, for each marginal point, at I
2in find the identical point in position, and record the point of gray-scale value minimum in 8 neighborhoods of these points, be defined as Seed Points.
(4) at edge image I
1in find gradient to be greater than the point of W, simultaneously at I
2in find the identical point in position, record the point of gray-scale value maximum in 8 neighborhoods of these points and minimum point, carry out can producing two point set: H={h after this step
1, h
2..., h
nand L={l
1, l
2..., l
n, h wherein
nand l
nit is the set that the point of gray-scale value maximum in 8 neighborhoods of these points and the gray scale of minimum point form.
(5) the mean value H of set of computations H and L
pand L
p.
(6) use H
pdo threshold value to I
2carry out binaryzation, the image obtaining is designated as I
3.
(7) merge image I
3with edge image I
1, obtain image I
4.
(8) corresponding to image I
4each corresponding Seed Points, utilize algorithm of region growing to process, obtain image I
5.
(9) use L
pdo threshold value to I
2carry out binaryzation, the image obtaining is designated as I
6.
(10) merge image I
5and I
6, obtain binary image I
7.
(11) image is carried out to denoising, obtain the image of final binaryzation.
(12) normalization prefix sign character to be identified.
(13) training of hat font size proper vector: in the binary image sample after the normalization of hat font size, select the sample training of 5 identical characters, calculate the following feature of sample:
A) transverse projection value, is designated as V
1
B) longitudinal projection's value, is designated as V
2
C) be laterally divided into 3 parts, calculate the accounting of pixel 1 in each several part, be designated as V
3
D) be longitudinally divided into 3 parts, calculate the accounting of pixel 1 in each several part, be designated as V
4
E) transverse crossing number of times, is designated as V
5
F) longitudinal traversing times, is designated as V
6
Remember that 36 character characteristic of correspondence vector matrixs are V
n={ V
1, V
2, V
3, V
4, V
5, V
6, wherein n is 1~36, corresponding 36 characters.
(14) foundation of hat font size SVM model: utilize the eigenvectors matrix of 36 characters, utilize formula (5) to set up corresponding SVM model, each model has individual class label, totally 36, corresponding to 36 prefix sign characters.
(15) identification of hat font size: for the image of each input, calculate this eigenvectors matrix, utilize hat font size SVM model to carry out decision-making judgement, identification hat font size.
Three, adopt the decision method based on weights to draw hat font size result
Final result is carried out according to following flow process:
(1) measure respectively the discrimination of two kinds of methods.
(2) for the higher employing high weight of discrimination in two kinds of algorithms, the low weights of employing that discrimination is lower.
(3), for the character of input, if the identification of two kinds of methods obtains is same result R, net result is exactly R.If two kinds of result differences that method obtains, are respectively R
1and R
2, so according to the best preferred principle of discrimination, using the high method of discrimination as final result.
The present invention adopts the recognition methods based on skeleton, careful and portrayed all sidedly the feature of hat font size essence, adopts based on improved SVM recognition methods, has accurately described the feature of hat font size other side.Then in conjunction with these two kinds of methods, jointly hat font size is identified, and the recognition result that adopts the method for discrimination based on weights to draw two kinds of methods carries out ruling, can improve significantly the discrimination of hat font size.