A kind of registration number character dividing method of dynamic template combination pixel
Technical field
The invention belongs to technical field of image processing more particularly to a kind of character segmentation methods to license plate image.
Background technology
The highway communication career development in China is rapid in recent years, and labor management mode cannot meet actual needs,
Microelectronics, communication and computer technology greatly improve traffic administration efficiency in the application of field of traffic.Car license recognition
(License Plate Recognition, LPR) is one of important component in modern intelligent transportation system, using ten
Divide extensive.It is with based on the technologies such as Digital Image Processing, pattern-recognition, computer vision, to the vehicle of shot by camera
Image or video sequence are analyzed, and the number-plate number of each vehicle are obtained, so as to complete identification process.It is but existing
There are the shortcomings such as accuracy of identification is low, recognition efficiency is low for licence plate recognition method.
In general, Vehicle License Plate Recognition System can be divided into three parts:License Plate (obtaining single license plate image), characters on license plate point
It cuts, Recognition of License Plate Characters.Nowadays with the development of the technologies such as machine learning, pattern-recognition, by neutral net, template matches,
It is not problem that obtained characters on license plate, which is identified, in the methods of support vector machines (SVM).How characters on license plate is carried out accurate
True segmentation increasingly becomes the final problem for influencing discrimination.
Accurately segmentation is carried out to characters on license plate, and there are following problems:
1st, basis《People's Republic of China's automotive number plate》(GA36-2007), containing 7 characters in automotive number plate,
And except " 1 ", the width of other characters is roughly the same;In the roughly the same character of width, character " J ", " T " and " L " and its
He compares character, has its particularity;It is not connected in the character of automotive number plate except " Shan ", " river " etc. is a small number of outside character, other
It is connected component.
2nd, the external environment residing for Vehicle License Plate Recognition System is complicated and changeable.Vehicle License Plate Recognition System is in evils such as rainy day, dense fog, heavy snow
Under bad weather condition, since atrocious weather can cause car plate to be blocked, defaced, strong influence obtains car plate figure
The quality of picture causes actual acquisition character there are adhesion, situations such as being stained.
Current Character Segmentation of License Plate is mainly the following method:
(1) sciagraphy.Sciagraphy is traditional classical Character segmentation algorithm, is obtained in ripe character recognition system
It is widely applied.The basic thought of Character Segmentation of License Plate based on projection is to the two-value vehicle after slant correction, thresholding
Board image carries out upright projection, more according to character zone white pixel point, and white pixel point in background area is few or without this
License plate area feature is selected a threshold function in upright projection result to distinguish character zone and background area, and then is determined
The cut-point of single character realizes License Plate Character Segmentation.The algorithm car plate is slightly obscured it is insensitive, and it is simple easily realize, but
It is easily to generate cutting;For spcial characters such as " 1 ", " J ", " L ", " T ", when up-and-down boundary cuts inaccuracy, can treat as
Noise processed seriously affects the accuracy of License Plate Character Segmentation.
(2) connected domain analysis method.Connected domain analysis method make use of second character of China's normal domestic car plate to the 7th
Character is English character or number, and English character and number are this features connected.License plate area is connected first
Logical domain analysis, then in conjunction with the characteristics such as highly consistent, the character center spacing of characters on license plate the 2nd~7 character of cutting first, Ran Houjie
Rear six characters for closing car plate carry out cutting car plate first character.But this method is for Chinese character, the tiled configurations such as Ru Chuan, Shan
Chinese character adaptability is very poor, and is affected by Characters Stuck.This algorithm does not account for the car plate form of the special unit in China, such as
Police car car plate the 7th character in China's is Chinese character " police ", the 7th character of learner-driven vehicle car plate be " " be texture information enrich,
Connective not strong Chinese character.
The content of the invention
The present invention is directed to above-mentioned technical problem, it is proposed that one kind has good robustness and versatility in complex environment
Registration number character dividing method, the registration number character dividing method of dynamic template combination pixel of the present invention comprises the following steps:
Binary conversion treatment is carried out to the license plate image of input, and calculates the width w of the license plate image and height h;
Plate template is set:Height is identical with the height of license plate image to be split, is arranged to h, width be arranged to w'(its
The value range of the initial value of middle width w' is w/3~2w/3), plate template sets 7 characters, and the ratio of width to height of each character is set
The ratio of width to height for r1, the 2nd interval between the 3rd character is r2, and the ratio of width to height at the interval of other intercharacters is r3, r1,
The correspondingly-sized of defined is configured in standard of the value of r2, r3 based on automotive number plate;
Template slip is handled:Using the left end of the license plate image after binary conversion treatment as initial position, based on default car plate
Template carries out template slip, slides a pixel every time, often slides once, then record the license plate image in current car plate mould
Split position corresponding to the number of non-zero pixels point at each character position of plate and current plate template, when plate template is right
Terminate to slide when end reaches the right end of the license plate image or when the initial position of plate template slides at the T of license plate image
Dynamic, the value of the T is w/4~w/2;
The width w' of plate template is gradually increased, the ratio of width to height of each character of plate template and intercharacter space is kept to set
(r1, r2, r3) repeats template slip processing, wide until the width w' of plate template increases to the width w of license plate image
The increase step-length of degree w' is arranged to 1~3 pixel;
The number of the non-zero pixels point recorded when being slided and handled based on each template is searched most comprising pixel number
License Plate Character Segmentation position of the split position as license plate image.
Beneficial effects of the present invention are:
(1) structural information and texture information of car plate are made full use of, using between each character required in car plate standard
Queueing discipline and character between the strong dependency that is distributed, carry out License Plate Character Segmentation, effectively prevent partial character due to
It is blocked, defaced the drawbacks of cannot accurately being split.Multiple Character segmentation is carried out by same license plate image, obtains difference
Segmentation result and corresponding split position the size of non-zero pixels point number is included in binaryzation license plate image, take in binaryzation
Comprising the largest number of split positions of non-zero pixels point as final License Plate Character Segmentation result in license plate image;
(2) due to the present invention using taking comprising the most split position of non-zero pixels point as final License Plate Segmentation as a result,
For license plate image coarse positioning early period, fine positioning is not that good license plate image still has good recognition effect;For throwing
Shadow method, the reluctant car plate for being blocked, being stained of connected domain analysis method still have good segmentation effect.It can greatly improve
The robustness of Vehicle License Plate Recognition System and the stability of result.
Description of the drawings
The present invention will illustrate by specific embodiment and with reference to the appended drawing, wherein:
Fig. 1 is the flow chart of the specific embodiment of the present invention;
Fig. 2 is the initial size of plate template of specific embodiment of the present invention and dynamic change schematic diagram;
Fig. 3 is slip exemplary plot of the plate template of the specific embodiment of the present invention on license plate image.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, with reference to embodiment and attached drawing, to this hair
It is bright to be described in further detail.
The present invention is used for the License Plate Character Segmentation of Vehicle License Plate Recognition System.Vehicle License Plate Recognition System receives what monitoring device collected
Image data stream carries out License Plate, to obtain single license plate image.Currently, obtaining the usual processing mode of license plate image is:
Method based on mixed Gaussian background modeling is obtained the foreground and background in moving scene using weights and variance, will currently obtained
The two field picture obtained can obtain each moving vehicle in motion target area i.e. scene with background image subtraction.Then root
According to each vehicle condition tracked in scene, first obtained single-frame images is carried out being converted into gray level image, and to gray-scale map
As carrying out edge detection, binaryzation is carried out again to the edge-detected image of acquisition, can so remove apparent interference and some
The influence of noise spot, especially night car light that noise generates, based on pre-structured matrix, (row and column of matrix can basis afterwards
The length-width ratio of car plate is set, and the element in matrix is initialized as 1) traveling through entire target area, then extracts connected domain, then
Morphology closed operation is carried out to obtained target area, the external square demarcated afterwards to each connected domain and ask it minimum
Then shape, obtains boundary rectangle corresponding image in artwork.Finally, obtained image is classified and obtains car plate
Positive negative sample chooses some features that car plate has, removes pseudo- car plate using two grader of positive and negative sample training of car plate, so as to
Obtain the license plate image of coarse positioning.Car plate is further accurately positioned, obtains the license plate image of fine positioning:First, to coarse positioning
License plate image projected in the horizontal direction, the accurately up-and-down boundary of definite car plate, then to car plate in the vertical direction
Projection selects threshold values, judges accurate location of the candidate license plate region as car plate left and right edges according to threshold values, fixed so as to obtain essence
The license plate image of position.
With reference to figure 1, input based on the single license plate image acquired in Vehicle License Plate Recognition System, and pre-processed:To car plate
Image carries out binary conversion treatment (wherein black represents background, and white represents characters on license plate), and calculates the width of input license plate image
Spend w and height h.According to existing domestic car plate standard《People's Republic of China's industry standards of public safety-the People's Republic of China (PRC)
Automotive number plate》Standard outer profile size in (GA36-2007) on automobile uniline licence plate:Long 440mm and width 140mm;Vehicle
Board character total length is 409mm, and single character uniform width is 45mm, a height of 90mm;Second and the 3rd is spaced between character
34mm, remaining character pitch are 12mm;The wide 1Omm dots of blank character, second and the 3rd the spacing of character and blank character be 12mm;
The regulation of stroke width 10mm understands that the ratio of width to height of character is r1 (45/90) in car plate;Car plate the 2nd, 3 characters interval most
Greatly, the ratio of width to height of intercharacter space is r2 (34/90);The ratio of width to height of other intercharacter spaces is r3 (12/90), then can obtain
In license plate image, character duration w1=r1*h, 2,3 intercharacter space width w2=r2*h, other intercharacter space width w3=
r3*h.The overall width w=7*w1+w2+5*w3 of license plate image can then be obtained.Accordingly, the plate template of the present invention is set, is such as schemed
2 show, plate template includes 7 characters, 6 character pitches, wherein the interval between the 2nd and the 3rd character is than other 5 words altogether
Symbol interval is big, and the ratio of width to height of 7 characters is r1, the 2nd, the ratio of width to height at the intervals of 3 intercharacters be r2, remaining 5 character pitch
The ratio of width to height is r3, since fine positioning is there may be larger error, in order to improve the robustness of template and stability, first sets vehicle
The overall width of board template is that the value range of w'(its initial value is w/3~2w/3, and initial value is arranged in present embodiment
W/2), the height of the board image to be split highly with input is identical (being arranged to h).
Then, license plate image of the plate template of setting after binary conversion treatment is subjected to template slip processing:Reference chart
3, left end (be usually first pixel of left end) of the initial position for pretreated license plate image is slided, based on default vehicle
Board template carries out template slip, slides a pixel every time, often slides once, then record the license plate image in current car plate
Split position corresponding to the number of non-zero pixels point at each character position of template and current plate template, works as plate template
(the right end pixel of plate template and the right end pixel of license plate image when right end reaches the right end of the license plate image
Position overlap when) or plate template initial position slide into license plate image T (value range of T be w/4~w/2, this tool
In body embodiment, T values be w/3) at when terminate slide w/3 place when be determined as terminate template slip.Because the beginning of car plate
At preceding 1/3rd of the license plate image of position usually after the pre-treatment, if the initial position of plate template has slided into car plate
At 1/3rd of image, even if plate template right end does not reach the right end of license plate image yet, still terminate template slip at this time,
Otherwise continue to slide plate template, be then present with as shown in Figure 3 beyond situation.
It slides one time after terminating, being stepped up the overall width of plate template (increases step-length and be usually arranged as 1~3 picture
Vegetarian refreshments, in present embodiment, each increased step-length is 1 pixel), the height of plate template remains unchanged, and is based on
The ratio of width to height r1 of each character, the 2nd, the ratio of width to height r2 at the intervals of 3 intercharacters, the ratio of width to height r3 of remaining 5 character pitch it is corresponding
Each character of plate template and the width at interval are adjusted, then carries out once above-mentioned template slip processing, until the width of plate template
W' is of same size with pretreated license plate image.In specific implementation, the width for first determining whether current plate template can be set
Spend whether w' is equal to w, if it is not, then increasing current width w'(makes w'=w'+1), and it is high based on height h, default width and width
The character duration of plate template and character pitch width are adjusted than r1, r2, r3, the plate template after adjustment is then based on and is locating in advance
License plate image after reason carries out template slip processing (such as centre position as shown in Figure 3);Otherwise search and export car plate word
Accord with split position;
It searches and exports License Plate Character Segmentation position:The non-zero pixels point recorded when sliding and handle based on each template
Number is searched comprising the largest number of split positions of pixel (optimal location as shown in Figure 3) as the final of license plate image
License Plate Character Segmentation position simultaneously exports.
Finally, the License Plate Character Segmentation position based on output is handled by the Recognition of License Plate Characters of Vehicle License Plate Recognition System and completed
The identification of characters on license plate carries out classification based training and identification for example with usual SVM (support vector machines) methods to characters on license plate
Processing.
The present invention is using dynamic template combination pixel to License Plate Character Segmentation, and compared with existing scheme, the present invention has
Very high-accuracy, it is lower to image quality requirement, there is good robustness and stability in complex environment.