CN109886265A - A kind of car door limiter detection method based on Adaboost and template matching - Google Patents

A kind of car door limiter detection method based on Adaboost and template matching Download PDF

Info

Publication number
CN109886265A
CN109886265A CN201910027016.4A CN201910027016A CN109886265A CN 109886265 A CN109886265 A CN 109886265A CN 201910027016 A CN201910027016 A CN 201910027016A CN 109886265 A CN109886265 A CN 109886265A
Authority
CN
China
Prior art keywords
picture
character
car door
template
door limiter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910027016.4A
Other languages
Chinese (zh)
Other versions
CN109886265B (en
Inventor
刘峰
余义
干宗良
崔子冠
唐贵进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Post and Telecommunication University
Original Assignee
Nanjing Post and Telecommunication University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Post and Telecommunication University filed Critical Nanjing Post and Telecommunication University
Priority to CN201910027016.4A priority Critical patent/CN109886265B/en
Publication of CN109886265A publication Critical patent/CN109886265A/en
Application granted granted Critical
Publication of CN109886265B publication Critical patent/CN109886265B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Analysis (AREA)

Abstract

The car door limiter detection method based on Adaboost and template matching that the present invention provides a kind of, the nut feature treated in the picture of measuring car door stop including the use of Adaboost classifier are identified and are positioned;According to the positional relationship between the top nut and character feature of the picture of the positioning result of nut feature and car door limiter to be measured in the picture of car door limiter to be measured, the character zone tentatively treated on measuring car door stop picture carries out coarse positioning;Make the optimal Template library of character using double iterative legal system, while acquiring the optimal threshold of template matching;The edge feature for extracting car door limiter picture and template to be measured identifies these characters using improved fast Template Matching method, completes several steps of car door limiter detection and identification to be measured;Improve the detection speed and accuracy of car door limiter detection.

Description

A kind of car door limiter detection method based on Adaboost and template matching
Technical field
The invention belongs to industrial part detection technique fields, and in particular to a kind of vehicle based on Adaboost and template matching Door stop detection method.
Background technique
Traditional industrial part detection is to observe by artificial eye to judge whether part mistake occurs with recognition methods Situations such as, the short time, interior this perhaps can have great accuracy, but with the large-scale production of modern factories, for a long time Working, lower human eye is so inevitable that generate fatigue, so that accuracy declines to a great extent, oneself cannot be met current industry Production requirement, and the technologies such as computer technology, artificial intelligence and pattern-recognition are greatly developed and are answered extensively in recent years With, these technologies have also penetrated into industrial production industry, in this background, industrial part detection and knowledge based on machine vision Other technology is come into being.
Currently, both at home and abroad based on machine vision industrial part detection mainly with based on template matching recognition methods and base In statistical model recognition methods based on.Template matching method is also referred to as nearest neighbour method, is most important side in pattern-recognition nonparametric Method and most common method, are widely used in character machining and recognizer, it has, and algorithm is simple, classification is intuitive, it is fast to calculate Speed, should be readily appreciated that with realize the characteristics of.The method of template matching can substantially be divided into three classes: the first kind is based on gray level image Template matching method, the second class are the template matching methods based on feature, and third class is based on to image understanding and explained Method of completing the square.The outer research emphasis to template matching of Current Domestic mainly in matched speed and precision, has been studied more Method also concentrates on preceding two classes matching process.Template matching method of the first kind based on gray level image be using piece image as The process of the corresponding position of template and the method search pattern by comparing pixel-by-pixel on another piece image.Since template provides Image information it is more complete, the template matching algorithm based on gray level image can be than the template matching algorithm based on feature preferably Adapt to the unfavorable factors such as weak feature, picture noise and image blur.But for some realtime graphic matching tasks or presence The heterologous images match task of critical noisy and tonal distortion interference, often there is also operational efficiency for existing template matching algorithm Slowly, the problems such as reliability is insufficient when not pre-processing.Therefore research calculating speed is fast, template matching algorithm of good reliability has Very important meaning.Template matching of second class based on feature includes the template of global invariant features and local invariant feature Match.Due to global invariant features be not easy obtain and indistinguishable foreground and background, using global invariant features algorithm very It is few to be used.The local invariant feature of image refers to the visual angle change in image, rotationally-varying, change of scale, illumination variation, figure As the local feature remained unchanged under the various transformation such as fuzzy and compression of images.Based on the images match of local invariant feature It calculates complexity to decrease compared with the relevant algorithm of gray scale is based on, anti-noise anti-interference ability is stronger.Currently based on the mould of local feature Plate matching algorithm is widely used with its higher robustness, which mainly includes that feature detection and feature describe two sides Face.Widely used method has an affine method of Harris in feature detection field at present, the affine method of Hessian, MSER method, DOG method, IBR method, EBR method etc..The more than comprehensive analysis performance of several feature detection algorithms, followed by feature describes, and feature is detected Obtained region describes son using local invariant feature and carries out feature description.Wherein most classic local invariant feature description Have SIFT and DAISY description, and MROGH, MRRID, LIOP and HRI-CSLTP describe son be Recent study it is the most popular and Description of greatest concern.Third class needs to establish sample database based on the recognizer of statistical model, then by a series of Method extracts sample characteristics, finally using the method training classifier of machine learning, is finally completed identification process.The algorithm is compared It is that there is good robustness in the advantage of template matching algorithm.
Summary of the invention
To solve above-mentioned the technical problems existing in the prior art, the present invention provides one kind to be based on Adaboost and template Matched car door limiter detection method, this method are different from the template matching method in traditional industry piece test, but first Obtained classifier is trained to car door limiter picture, recycling Adaboost is acquired after car door limiter illumination to light source with preceding Nut on car door limiter is positioned and identified, the positional relationship pair of car door limiter top nut and character is then utilized Character feature carries out coarse positioning on car door limiter, and the edge of character feature on car door limiter is extracted on the basis of coarse positioning Information finally identifies car door limiter type using improved fast Template Matching method, corresponding method very good solution because There is hollow character on car door limiter and is difficult to detect character information to be difficult to the problem of judging car door limiter type.
The present invention solves its technical problem and is achieved through the following technical solutions:
A kind of car door limiter detection method based on Adaboost and template matching, comprising the following steps:
Step S1, picture of the acquisition to car door limiter, using Adaboost classifier to the car door limiter figure of acquisition Nut in piece is identified and is positioned;
Step S2, the recognition result of nut, combined standard number in the car door limiter picture obtained according to the step S1 According to the positional relationship between character on car door limiter top nut in library and car door limiter, the word on measuring car door stop is treated It accords with region and carries out coarse positioning;
Step S3, make the optimal Template library of character on car door limiter using double iterative legal system, while acquiring template Optimal threshold with character on car door limiter;
Step S4, after completing step S3, the character used in the picture and optimal Template library of car door limiter to be measured is extracted The edge feature of template identifies the character in car door limiter picture to be measured using fast Template Matching method, completes to measuring car The detection and identification of door stop.
Further, in the step S1, the preparation process of the Adaboost classifier is to prepare needed for training first Positive and negative samples, the quantitative proportions of the positive and negative samples is 1: 2-1: 4, and wherein positive sample is the spiral shell on car door limiter to be measured Female front picture, negative sample is not by taking the picture of nut in the nut reverse side picture and production process of car door limiter to be measured And only take picture two parts composition of partial nut, the vector description file of the required positive and negative samples of creation training;Again By OpenCV open source Cooley several Weak Classifiers of local binary patterns feature training, and forms the Adaboost and classify by force Device.
Further, in the step S3, make the optimal Template library of character on car door limiter using double iterative legal system And the calculation method of the optimal threshold of template matching character, specifically includes the following steps:
Step S3.1, the total L of i-th kind of character picture as much as possible composition pictures Pic are first obtainedi, to every picture, Utilize the method and pictures Pic of template matchingiIn other pictures match one by one, obtained L-1 similarity be added after Arrive the sum of similarity, it can obtain the sum of L similarity { sim1, sim2, sim3..., simL};
Step S3.2, { sim in step S3.1 is taken1, sim2, sim3..., simLIn the smallest preceding Num of the sum of similarityspe A picture forms pictures spe, the maximum preceding Num of the sum of similaritygenA picture forms pictures gen, by picture set spe The original template library Temp of corresponding model car door limiter is merged into geni
Step S3.3, the original template library Temp obtained respectively with the step S3.2iIn all templates and pictures PiciIn each picture do template matching, due to TempiIn have Numgen+NumspeA template, so PiciIn each figure Num all can be obtained in piecegen+NumspeA similarity value, taking its maximum value is template library TempiWith pictures PiciThe phase of the picture Like confidence level, then PiciL similar confidence levels can be obtained in middle L picture, form confidence level setThis confidence level indicates PiciCharacter on middle L picture is that the confidence level of i-th kind of character is big It is small;
Step S3.4, using the step S3.1 and step S3.2 method, the mould of character on other vehicle limiters is obtained Plate library Tempj(j ≠ i and j=1,2,3 ...), by TempjInstead of the Temp in the step S3.3iThe side of step S3.3 is pressed afterwards Method and pictures PiciIn all pictures do template matching and obtain pictures PiciIn each character picture be jth kind character Confidence level set
If the template library Temp of step S3.5, the described step S3.2iAnd Tempi(j ≠ i and j=1,2,3 ...) can be incited somebody to action Pictures PiciIn each picture be all identified as correct character types, i.e. i-th kind of character, then confidence level setMinimum value be greater than set(j ≠ i and j=1,2,3 ...) Maximum value, further set pictures PiciMatching error rateWherein NumWrongiFor pictures PiciIn be identified as the number of pictures of non-i-th kind of character, i.e. confidence level setIn be less than template matching threshold TiElement number, NumWrongjFor character pictures PiciIn be identified as the number of pictures of jth (j ≠ i and j=1,2,3 ...) kind character, i.e. confidence level setIt is greater than the matching threshold T of template in (j ≠ i and j=1,2,3 ...)iElement number, seek Optimal Template library TempiProcess be exactly to seek optimal threshold TiWith optimum N umgen、NumspeSo that matching error rate WiIt is the smallest Process;
Step S3.6, Num in first fixing step S3.5gen、NumspeValue, seek threshold value TiSo that template library Tempi? With error rateMinimum, finally in the hope of threshold value TiThe midpoint for the segment being in As optimal threshold, after acquiring the optimal threshold, if template library Temp at this timeiMatching error rate WiEqual to zero or it is less than 0.0001, then Numgen、NumspeIt is regarded as optimal, then template library completes, optimal threshold TiAlso it has acquired, otherwise Fixed threshold TiIf confidence level setIn be less than optimal threshold TiConfidence level number be greater than 0.2*L, then the generality of pattern of descriptive parts is not enough, and increases NumgenAfter continue calculate matching error rate WiIf confidence level setIn be less than optimal threshold TiConfidence level number be less than 0.02*L, the then particularity of pattern of descriptive parts It is not enough, increases NumspeAfter continue calculate matching error rate WiIf matching error rate W at this timeiEqual to zero or less than 0.0001, Then Numgen、NumspeIt is regarded as optimal, then template library completes, optimal threshold TiAlso it has acquired, has otherwise repeated this Step is until WiEqual to zero or less than 0.0001;
Step S3.7, the final Num acquired according to the step S3.6gen、Numspe, to i-th kind of character in step S3.1 Picture set Pici, the sum of similarity { sim1, sim2, sim3..., simLIn the smallest preceding NumspeA character picture composition figure Piece collection spe, the maximum preceding Num of the sum of similaritygenA character picture forms pictures gen, and picture set spe and gen are merged At Tempi, TempiThe template library of i.e. finally formed i-th kind of character, and the T that the step S3.6 is finally acquirediAs i-th kind Character is used for the optimal threshold of template matching.
Further, the step S4, specifically includes the following steps:
Step S4.1, the position of car door limiter top nut is obtained according to step S3, further according to car door limiter top nut The position of character on car door limiter is obtained with the positional relationship of character, and character region is intercepted out;
Step S4.2, the gradient map of calculating character region picture extracts marginal information using dual-threshold voltage;
Step S4.3, setting the character number on car door limiter to be measured has numofcha, on all car door limiters Character type shares numofkind kind, by the method for the template library step S4.2 of the obtained numofkind kind character of step S3 Edge is extracted, the character zone gradient map then obtained respectively with step S4.2 does template matching, selects template library matching result In recognition result of the most suitable numofcha character as car door limiter model to be measured.
Preferably, the vector description file of training positive and negative samples, specific steps are created are as follows:
Training sample is divided into positive and negative samples, and in the training process, the quantitative proportion of positive and negative samples is 1: 2-1: 4, described Negative sample is not by taking the picture of nut and only shooting in the nut reverse side picture and production process of car door limiter to be measured Picture two parts to partial nut are constituted, and are guaranteed the character pair picture on other model car door limiters and produced The ratio for the wrong picture being likely to occur in journey is 2: 1-4: 1, and the format of all pictures is converted to bmp format, and by institute There is the dimension of picture of positive sample to turn to long 65 pixels, the size of wide 65 pixel.
Further, detailed process is as follows by the step S4.2:
With the gradient of Sobel operator calculating character region picture, the gradient of each pixel on character zone picture is obtained Value and direction, set two threshold θs1And θ2, gradient value is less than θ1The gradient value of pixel be set to zero, gradient value is greater than θ2Pixel gradient value retain, when gradient value is between θ1And θ2Pixel around gradient value existing for 80 connected regions it is big In θ1The number of pixel be more than 24, i.e., gradient value is greater than θ around corresponding points1Pixel density be greater than 0.3, then protect Gradient value is stayed, gradient value is also otherwise set to zero.
Further, the step S4.3, detailed process is as follows:
If the first character of car door limiter to be measured has several possibility, by the gradient map in several Character mother plate library point Template matching, which is not done, when i-th Prototype drawing is matched with picture to be measured with car door limiter character zone gradient map to be measured uses mould Plate figure is matched on picture to be measured with the continuous sliding window of step-length 1, in j-th of window, by the preceding r edge pixel point of template Do that corresponding that corresponding templates are calculated is similar on this position of picture to be measured to the pixel of corresponding position on picture to be measured Angle value, calculation formula are
WhereinIndicate the preceding r edge pixel of i-th template template in j-th of window on picture to be measured Point does the corresponding similarity value being calculated to the pixel of corresponding position on picture to be measured,It is the m of i-th template The transverse gradients value size of a edge pixel point,Be m-th of edge pixel point of i-th template longitudinal gradient value it is big It is small, PxmIt is the transverse gradients value size of corresponding position pixel on picture to be measured, PymIt is corresponding position pixel on picture to be measured Longitudinal gradient value size;R iteration since 1, if the preceding r side that i-th Prototype drawing obtains on j-th of window of picture to be measured The similarity value of edge pixelMeet predetermined condition, then r=r+1, continues to calculateOtherwise it abandons described Position to be measured, then i-th Prototype drawing is slided into+1 window of picture jth to be measured and continues to calculate since r=1 The required predetermined condition that meets is
Wherein T is the optimal threshold for the template matching that the step S3 is obtained,It is exactly for j-th of window of picture to be measured The minimum of character representated by i-th template can confidence level, be initialized as T, i.e., Continuous iteration generates, Numofpix is the edge pixel number sum of i-th template, and rmax is the last of a upper match window or a upper template One match window is actually added into matched template edge total number of pixels, and jmax is the last match window sequence of a upper template Number;To first character, every kind of possible Character mother plate library can all obtain a final matching similarity, take these similarities Middle maximum value, if it is greater than T, as the recognition result of this character, otherwise it is assumed that without matching result, on car door limiter Each character is handled one by one, to obtain the recognition result of all characters on car door limiter.
Further, the threshold θ1、θ2Calculation method be θ when original state1=50, θ2=200, utilize described pair After threshold method extracts marginal information, the number numofpixel of edge pixel point is calculated, it is assumed that the pixel of character zone picture is total Number is S, then extracts the edge pixel dot density after marginal information in picture and beIf ρ < 0.03, portion Divide the gradient value zero setting of edge pixel point, it is corresponding to reduce θ2If ρ > 0.1, non-edge pixels point in part is identified for edge picture Vegetarian refreshments, so corresponding improve θ2, until 0.03≤ρ≤0.1, θ at this time1And θ2As final θ1And θ2
Compared with prior art, the invention has the benefit that
(1) present invention most probably goes out in the actual productions such as shooting angle variation because single mode plate is difficult to solve illumination variation Existing problem, therefore the method for use template library carries out template matching, and most based on a kind of utilization double iterative production developed The method of good template library, while the optimal threshold of template matching is acquired, so that car door limiter detection accuracy gets a promotion.
(2) while treating measuring car door stop picture using template library and carry out template matching, program runtime can be with The quantity increase of template linearly increase, therefore method provided by the invention makes matching speed obtain great promotion, from And car door limiter detection speed is got a promotion.
Detailed description of the invention
Fig. 1 is flow chart of the invention;
Fig. 2 is the flow chart in step S3 production optimal Template library of the invention;
Fig. 3 is the flow chart of the template matching of step S4 of the invention.
Specific embodiment
Below by specific embodiment, the invention will be further described, and it is not limit that following embodiment, which is descriptive, Qualitatively, this does not limit the scope of protection of the present invention.
As shown in Figure 1, the car door limiter detection method of the invention based on Adaboost and template matching, it will be with forward direction Light source plays the collected gray scale picture comprising car door limiter of the mode shone as process object, and main includes to utilize Adaboost classifier obtains the exact position of car door limiter top nut and carries out coarse positioning, production character mould to character feature Plate library and character is carried out template matching and to identify this three big main process.Its specific embodiment is as follows:
Step 1) prepares positive and negative samples, and ratio is between 1:2-1:4, and wherein positive sample is the spiral shell on car door limiter to be measured Female front picture, negative sample is not by taking the picture of nut in the nut reverse side picture and production process of car door limiter to be measured And only take picture two parts composition of partial nut, the vector description file of the required positive and negative samples of creation training, tool Body step are as follows:
Training sample is divided into positive and negative samples, generally keeps positive and negative samples ratio between 1:2-1:4 in the training process, Prepare complete car door limiter top nut picture 6247 to open as positive sample, negative sample 21288 is opened.Wherein negative sample is by be measured The picture of nut is not taken in the nut reverse side picture and production process of car door limiter and only takes partial nut Picture two parts are constituted, and guarantee to be likely to occur in character pair picture and production process on other model car door limiters Wrong picture ratio be 2:1-4:1.The format of all pictures is all converted into bmp format, and by all positive samples Dimension of picture is normalized to the size of long wide 65 pixel of 65 pixels.
Step 2) passes through OpenCV open source Cooley several Weak Classifiers of local binary patterns (LBP) feature training and composition Adaboost strong classifier;
Step 3) loads corresponding classifier and the nut in car door limiter picture to be detected is positioned and identified.
Step 4) is according to the recognition result of nut in the car door limiter picture that is previously obtained, vehicle in combined standard database Positional relationship in door stop top nut and car door limiter between character, can be to show type on preliminary judgement car door limiter Number character zone Position Approximate, and these characters are identified using improved efficient template matching method, to realize that car door limits The purpose of position device detection, detailed process is as follows:
A) as shown in Fig. 2, first making template library before template matching, the word of several correct model car door limiter pictures is intercepted Accord with region picture, wherein every kind of character all will intercept and come out, then use double iterative method select certain character picture several as The Prototype drawing of corresponding character, and corresponding Character mother plate library is added, the method for generating various Character mother plate libraries, i.e. double iterative method It is as follows:
I. car door limiter shares 4 kinds of vehicles, and each vehicle respectively has 4 car doors, and each car door has a vehicle door spacing Device, therefore 16 kinds of car door limiters are shared, every kind of car door limiter is distinguished using character.First obtain i-th kind of word as much as possible Accord with the total L of picture composition pictures Pici, to every picture, utilize the method and pictures Pic of template matchingiIn other pictures It matches one by one, L-1 obtained similarity obtains the sum of similarity after being added, the sum of L similarity available in this way {sim1, sim2, sim3..., simL};
Ii. { sim is taken1, sim2, sim3..., simLIn the smallest preceding Num of the sum of similarityspeA picture forms pictures Spe, the maximum preceding Num of the sum of similaritygenA picture forms pictures gen, and picture set spe and gen are merged into corresponding type The template library Temp of number car door limiteri, wherein the effect of pictures spe be in view of with template library do template matching to The particularity of mapping piece, i.e., in view of some pictures to be matched be it is distinguished, the effect of pictures gen be in view of with Template library does the generality of the picture to be measured of template matching, i.e., most of picture to be matched is similar;
Iii. Temp is used respectivelyiAll templates and pictures Pic in template libraryiIn each picture do template matching, Due to TempiIn have Numgen+NumspeA template, so PiciIn each picture Num all can be obtainedgen+NumspeA similarity Value, taking its maximum value is template library TempiWith pictures PiciThe similar confidence level of the picture, then PiciMiddle L picture is available L similar confidence levels, form confidence level setThis confidence level indicates PiciOn middle L picture Character be i-th kind of character confidence level size;
Iv. the template library Temp of other characters is similarly obtained using previous step i and step iij(j ≠ i and j=1,2, 3 ...), by TempjInstead of the Temp in previous step iiiiAfterwards by the method for step iii and pictures PiciIn all pictures It does template matching and obtains pictures PiciIn each character picture be jth kind character confidence level set
V. if template library TempiAnd Tempj(j ≠ i and j=1,2,3 ...) can be by pictures PiciIn each figure Piece is all identified as correct character types, i.e. i-th kind of character, then confidence level setMinimum Value is greater than setThe maximum value of (j ≠ i and j=1,2,3 ...), further sets pictures Pici Matching error rateWherein NumWrongiFor pictures PiciIn be identified as non-i-th The number of pictures of kind character, i.e. confidence level setIn be less than template matching threshold TiElement Number, NumWrongjFor character pictures PiciIn be identified as jth (j ≠ i and j=1,2,3 ...) kind character number of pictures, That is confidence level setIt is greater than the matching threshold T of template in (j ≠ i and j=1,2,3 ...)iMember Plain number seeks optimal Template library TempiProcess be exactly to seek optimal threshold TiWith optimum N umgen、NumspeSo that matching is wrong Accidentally rate WiThe smallest process;
Vi. Num is first fixedgen、NumspeValue, seek threshold value TiSo that template library TempiMatching error rateMinimum, finally in the hope of threshold value TiThe midpoint for the segment being in is as best Threshold value, after acquiring the optimal threshold, if template library Temp at this timeiMatching error rate WiEqual to zero or less than 0.0001, then Numgen、NumspeIt is regarded as optimal, then template library completes, optimal threshold TiAlso it has acquired, otherwise fixed threshold TiIf confidence level setIn be less than optimal threshold TiConfidence level number be greater than 0.2*L, then say The generality of bright template is not enough, and increases NumgenAfter continue calculate matching error rate WiIf confidence level setIn be less than optimal threshold TiConfidence level number be less than 0.02*L, the then particularity of pattern of descriptive parts It is not enough, increases NumspeAfter continue calculate matching error rate WiIf matching error rate W at this timeiEqual to zero or less than 0.0001, Then Numgen、NumspeIt is regarded as optimal, then template library completes, optimal threshold TiAlso it has acquired, has otherwise repeated this Step is until WiEqual to zero or less than 0.0001;
Vii. the final Num acquired according to previous stepgen、Numspe, to i-th kind of character picture set Pic in step ii, phase Like the sum of degree { sim1, sim2, sim3..., simLIn the smallest preceding NumspeA character picture forms pictures spe, similarity The sum of maximum preceding NumgenA character picture forms pictures gen, and picture set spe and gen are merged into Tempi, TempiJust It is the final template library of i-th kind of character.And the T that previous step finally acquiresiThe best threshold that as i-th kind of character is used for template matching Value.
B) position of car door limiter top nut is obtained according to step 3), further according to car door limiter top nut and character Positional relationship obtains the Position Approximate of car door limiter face character, so as to intercept out character region.
C) gradient map of calculating character region picture extracts marginal information using dual-threshold voltage, and process is as follows:
With the gradient of Sobel operator calculating character region picture, the gradient value of each pixel and direction on picture are obtained, Set two threshold θs1And θ2, θ is less than for gradient value1Pixel, it is believed that it is not character edge pixel, by its gradient Value is set to zero, is greater than θ for gradient value2Pixel, it is believed that it must be edge pixel point, retain its gradient value, for ladder Angle value is between θ1And θ2Pixel, if around it gradient value existing for 80 connected regions be greater than θ1The number of pixel be more than 24, i.e., gradient value is greater than θ around corresponding points1Pixel density be greater than 0.3, then it is assumed that its maximum probability is edge pixel Point, the gradient value for retaining this pixel is constant, and otherwise its gradient value is also set to zero, threshold θ1、θ2Calculation method it is as follows:
I. θ when original state1=50, θ2=200, it can also change as the case may be;
Ii. after extracting marginal information using dual-threshold voltage described above, the number numofpixel of edge pixel point is calculated, Assuming that the total number of pixels of character zone picture is S, then extracting the edge pixel dot density after marginal information in picture isIf ρ < 0.03, part edge pixel gradient value is zeroed out, so should correspond to reduces θ2If ρ > 0.1, then non-edge pixels point in part is identified as edge pixel point, improves θ so should correspond to2
Iii. iteration runs previous step, until 0.03≤ρ≤0.1, θ at this time1And θ2As final θ1And θ2
D) as shown in Figure 3, it is assumed that the character number on car door limiter to be measured has numofcha, all car door limiters On character type share numofkind kind, by the side of the template library step c) of the obtained numofkind kind character of step a) Method extracts edge, and the character zone gradient map then obtained respectively with step c) does improved template matching, selects template library Recognition result with numofcha character most suitable in result as car door limiter model to be measured, detailed process is as follows:
I. assume that the first character of car door limiter to be measured has several possibility, we will likely several character mould The gradient map in plate library does template matching with car door limiter character zone gradient map to be measured respectively, i-th Prototype drawing with to mapping When piece matches because having to be larger than Prototype drawing on dimension of picture to be measured, with Prototype drawing on picture to be measured with step-length 1 not Disconnected sliding window matching, in j-th of window, by the picture of corresponding position on the preceding r edge pixel point of template and picture to be measured Vegetarian refreshments, which is cooked, is accordingly calculated similarity value of the corresponding templates on this position of picture to be measured, and calculation formula is as follows:
WhereinIndicate the preceding r edge pixel of i-th template template in j-th of window on picture to be measured Point does the corresponding similarity value being calculated to the pixel of corresponding position on picture to be measured,It is m-th of i-th template The transverse gradients value size of edge pixel point,It is longitudinal gradient value size of m-th of edge pixel point of i-th template, PxmIt is the transverse gradients value size of corresponding position pixel on picture to be measured, PymIt is corresponding position pixel on picture to be measured Longitudinal gradient value size;
Ii.r iteration since 1, if the preceding r edge pixel that i-th Prototype drawing obtains on j-th of window of picture to be measured The similarity value of pointIt meets certain condition, then r=r+1, continues to calculateOtherwise this position is abandoned, it is believed that Certainly not correct respective symbols region at this position, i-th Prototype drawing slide into+1 window of picture jth to be measured continue from R=1 starts to calculate The condition of satisfaction should be corresponded to are as follows:
Wherein T is that step a) makes the optimal threshold acquired when template library,It is exactly i-th for j-th of window of picture to be measured The minimum of character representated by template can confidence level, be initialized as T, i.e.,It is subsequentNo by formula (6) Disconnected iteration generates, and Numofpix is the edge pixel number sum of i-th template, and rmax is a upper match window or one upper The last one match window of template is actually added into matched template edge total number of pixels, and jmax is that a upper template is last Match window serial number.
Iii. to first character, every kind of possible Character mother plate library can all obtain a final matching similarity, take Maximum value in these similarities, if it is greater than T, as the recognition result of this character, otherwise it is assumed that without matching result, for vehicle Each character is not always the case processing on door stop, to obtain the recognition result of all characters on car door limiter.
By above step, completes and the feature locations such as character on car door limiter and edge extracting etc. are operated, it can It is used to differentiate the features such as the character of model type on efficient identification car door limiter, to reach the mesh of car door limiter detection 's.
It should be noted thatThe proof of the corresponding condition met is as follows: formula (5) proves:
It is as follows that each parameter represents meaning:
The edge pixel number sum of Numofpix: the i-th template;
The phase of r edge pixel point and corresponding position pixel on j-th of window of picture to be measured before template Like the size of degree;
Corresponding position pixel on all edge pixel points of template and j-th of window of picture to be measured The size of the similarity of point;
Numofpix-r edge pixel point of the template other than preceding r pixel with it is to be measured The size of the similarity of corresponding pixel points on j-th of window of picture;
J-th of window of picture to be measured is exactly the minimum of character representated by i-th template can confidence level, even i-th All edge pixel points for opening template participate in matching, then should haveOtherwise j-th of window affirmative It is not correct characters;
It allows calculating process to continue, then must haveIt sets up,
1) the case where considering r < Numofpix first:
And
Again because of Numofpix-r > 0,
ByDefinition be easy prove,
2) the case where then considering r=Numofpix:
As r=Numofpix, formula (5) degeneration isIt is obvious to set up.
Proof finishes.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (8)

1. a kind of car door limiter detection method based on Adaboost and template matching, which comprises the following steps:
Step S1, picture of the acquisition to car door limiter, using Adaboost classifier in the car door limiter picture of acquisition Nut identified and positioned;
Step S2, the recognition result of nut, combined standard database in the car door limiter picture obtained according to the step S1 Positional relationship in middle car door limiter top nut and car door limiter between character, treats the character area on measuring car door stop Domain carries out coarse positioning;
Step S3, make the optimal Template library of character on car door limiter using double iterative legal system, while acquiring template matching vehicle The optimal threshold of character on door stop;
Step S4, after completing step S3, the Character mother plate used in the picture and optimal Template library of car door limiter to be measured is extracted Edge feature, identify the character in car door limiter picture to be measured using fast Template Matching method, complete car door to be measured limit The detection and identification of position device.
2. a kind of car door limiter detection method based on Adaboost and template matching according to claim 1, special Sign is, in the step S1, the preparation process of the Adaboost classifier is to prepare the required positive and negative sample of training first This, the quantitative proportion of the positive and negative samples is 1: 2-1: 4, and wherein positive sample is the nut front elevation on car door limiter to be measured Piece, negative sample is not by taking the picture of nut and only clapping in the nut reverse side picture and production process of car door limiter to be measured The picture two parts for taking the photograph partial nut are constituted, the vector description file of the required positive and negative samples of creation training;Pass through again OpenCV open source Cooley several Weak Classifiers of local binary patterns feature training, and form the Adaboost strong classifier.
3. a kind of car door limiter detection method based on Adaboost and template matching according to claim 1, special Sign is, in the step S3, makees optimal Template library and the template of character on car door limiter using double iterative legal system The calculation method of optimal threshold with character, specifically includes the following steps:
Step S3.1, the total L of i-th kind of character picture as much as possible composition pictures Pic are first obtainedi, to every picture, utilize The method and pictures Pic of template matchingiIn other pictures match one by one, obtained L-1 similarity obtains phase after being added Like the sum of degree, it can obtain the sum of L similarity { sim1, sim2, sim3..., simL};
Step S3.2, { sim in step S3.1 is taken1, sim2, sim3..., simLIn the smallest preceding Num of the sum of similarityspeA figure Piece forms pictures spe, the maximum preceding Num of the sum of similaritygenA picture forms pictures gen, by picture set spe and gen It is merged into the original template library Temp of corresponding model car door limiteri
Step S3.3, the original template library Temp obtained respectively with the step S3.2iIn all templates and pictures PiciIn Each picture do template matching, due to TempiIn have Numgen+NumspeA template, so PiciIn each picture all may be used Obtain Numgen+NumspeA similarity value, taking its maximum value is template library TempiWith pictures PiciThe picture it is similar credible It spends, then PiciL similar confidence levels can be obtained in middle L picture, form confidence level setThis can Reliability indicates PiciCharacter on middle L picture is the confidence level size of i-th kind of character;
Step S3.4, using the step S3.1 and step S3.2 method, the template library of character on other vehicle limiters is obtained Tempj(j ≠ i and j=1,2,3 ...), by TempjInstead of the Temp in the step S3.3iAfterwards by step S3.3 method with Pictures PiciIn all pictures do template matching and obtain pictures PiciIn each character picture be jth kind character can Reliability set
If the template library Temp of step S3.5, the described step S3.2iAnd Tempj(j ≠ i and j=1,2,3 ...) can be by picture Collect PiciIn each picture be all identified as correct character types, i.e. i-th kind of character, then confidence level setMinimum value be greater than set(j ≠ i and j=1,2,3 ...) Maximum value, further set pictures PiciMatching error rateWherein NumWrongiFor pictures PiciIn be identified as the number of pictures of non-i-th kind of character, i.e. confidence level setIn be less than template matching threshold TiElement number, NumWrongjFor character pictures PiciIn be identified as the number of pictures of jth (j ≠ i and j=1,2,3 ...) kind character, i.e. confidence level setIt is greater than the matching threshold T of template in (j ≠ i and j=1,2,3 ...)iElement number, seek Optimal Template library TempiProcess be exactly to seek optimal threshold TiWith optimum N umgen、NumspeSo that matching error rate WiIt is the smallest Process;
Step S3.6, Num in first fixing step S3.5gen、NumspeValue, seek threshold value TiSo that template library TempiMatching it is wrong Accidentally rateMinimum, finally in the hope of threshold value TiThe midpoint conduct for the segment being in Optimal threshold, after acquiring the optimal threshold, if template library Temp at this timeiMatching error rate WiEqual to zero or less than 0.0001, Then Numgen、NumspeIt is regarded as optimal, then template library completes, optimal threshold TiAlso it has acquired, has otherwise fixed threshold Value TiIf confidence level setIn be less than optimal threshold TiConfidence level number be greater than 0.2*L, then The generality of pattern of descriptive parts is not enough, and increases NumgenAfter continue calculate matching error rate WiIf confidence level setIn be less than optimal threshold TiConfidence level number be less than 0.02*L, the then particularity of pattern of descriptive parts It is not enough, increases NumspeAfter continue calculate matching error rate WiIf matching error rate W at this timeiEqual to zero or less than 0.0001, Then Numgen、NumspeIt is regarded as optimal, then template library completes, optimal threshold TiAlso it has acquired, has otherwise repeated this Step is until WiEqual to zero or less than 0.0001;
Step S3.7, the final Num acquired according to the step S3.6gen、Numspe, to i-th kind of character picture in step S3.1 Set Pici, the sum of similarity { sim1, sim2, sim3..., simLIn the smallest preceding NumspeA character picture forms pictures Spe, the maximum preceding Num of the sum of similaritygenA character picture forms pictures gen, and picture set spe and gen are merged into Tempi, TempiThe template library of i.e. finally formed i-th kind of character, and the T that the step S3.6 is finally acquirediAs i-th kind of word Symbol is used for the optimal threshold of template matching.
4. a kind of car door limiter detection method based on Adaboost and template matching according to claim 1, special Sign is, the step S4, specifically includes the following steps:
Step S4.1, the position of car door limiter top nut is obtained according to step S3, further according to car door limiter top nut and word The positional relationship of symbol obtains the position of character on car door limiter, and character region is intercepted out;
Step S4.2, the gradient map of calculating character region picture extracts marginal information using dual-threshold voltage;
Step S4.3, setting the character number on car door limiter to be measured has numofcha, the character on all car door limiters Type shares numofkind kind, and the template library of the obtained numofkind kind character of the step S3 method of step S4.2 is extracted Edge, the character zone gradient map then obtained respectively with step S4.2 do template matching, select in template library matching result most Suitable recognition result of the numofcha character as car door limiter model to be measured.
5. a kind of car door limiter detection method based on Adaboost and template matching according to claim 2, special Sign is, creates the vector description file of training positive and negative samples, specific steps are as follows:
Training sample is divided into positive and negative samples, and in the training process, the quantitative proportion of positive and negative samples is 1: 2-1: 4, the negative sample This is not by taking the picture of nut and only taking portion in the nut reverse side picture and production process of car door limiter to be measured Divide picture two parts of nut to constitute, and guarantees in character pair picture and production process on other model car door limiters The ratio for the wrong picture being likely to occur is 2: 1-4: 1, and the format of all pictures is converted to bmp format, and by it is all just The dimension of picture of sample turns to long 65 pixels, the size of wide 65 pixel.
6. a kind of car door limiter detection method based on Adaboost and template matching according to claim 4, special Sign is that detailed process is as follows by the step S4.2:
With the gradient of Sobel operator calculating character region picture, obtain on character zone picture the gradient value of each pixel and Direction sets two threshold θs1And θ2, gradient value is less than θ1The gradient value of pixel be set to zero, gradient value is greater than θ2's Pixel gradient value retains, when gradient value is between θ1And θ2Pixel around gradient value existing for 80 connected regions be greater than θ1 The number of pixel be more than 24, i.e., gradient value is greater than θ around corresponding points1Pixel density be greater than 0.3, then retain ladder Otherwise gradient value is also set to zero by angle value.
7. a kind of car door limiter detection method based on Adaboost and template matching according to claim 4, special Sign is that the step S4.3, detailed process is as follows:
If the first character of car door limiter to be measured has several possibility, by the gradient map in several Character mother plate library respectively with Car door limiter character zone gradient map to be measured does template matching and uses Prototype drawing when i-th Prototype drawing is matched with picture to be measured On picture to be measured with the continuous sliding window of step-length 1 matching, in j-th of window, by the preceding r edge pixel point of template and to The pixel of mapping on piece corresponding position, which is done, is accordingly calculated similarity value of the corresponding templates on this position of picture to be measured, Calculation formula is
WhereinIndicate i-th template in j-th of window on picture to be measured the preceding r edge pixel point of template with The pixel of corresponding position does the similarity value being accordingly calculated on picture to be measured,It is m-th of edge of i-th template The transverse gradients value size of pixel,It is longitudinal gradient value size of m-th of edge pixel point of i-th template, PxmIt is The transverse gradients value size of corresponding position pixel, Py on picture to be measuredmIt is the longitudinal direction of corresponding position pixel on picture to be measured Gradient value size;R iteration since 1, if the preceding r edge pixel that i-th Prototype drawing obtains on j-th of window of picture to be measured The similarity value of pointMeet predetermined condition, then r=r+1, continues to calculateOtherwise it abandons described to location It sets, then i-th Prototype drawing is slided into+1 window of picture jth to be measured and continues to calculate since r=1The required predetermined condition that meets is
Wherein T is the optimal threshold for the template matching that the step S3 is obtained,It is exactly i-th for j-th of window of picture to be measured The minimum of character representated by template can confidence level, be initialized as T, i.e., Continuous iteration generates, Numofpix For the edge pixel number sum of i-th template, rmax is the last one matching of a upper match window or a upper template Window is actually added into matched template edge total number of pixels, and jmax is the last match window serial number of a upper template;To One character, every kind of possible Character mother plate library can all obtain a final matching similarity, take maximum in these similarities Value, if it is greater than T, as the recognition result of this character, otherwise it is assumed that without matching result, for word each on car door limiter Symbol is all handled one by one, to obtain the recognition result of all characters on car door limiter.
8. a kind of car door limiter detection method based on Adaboost and template matching according to claim 6, special Sign is, the threshold θ1、θ2Calculation method be θ when original state1=50, θ2=200, it is extracted using the dual-threshold voltage After marginal information, the number numofpixel of edge pixel point is calculated, it is assumed that the total number of pixels of character zone picture is S, then Extracting the edge pixel dot density after marginal information in picture isIf ρ < 0.03, part edge pixel Point gradient value zero setting, it is corresponding to reduce θ2If ρ > 0.1, non-edge pixels point in part is identified for edge pixel point, so It is corresponding to improve θ2, until 0.03≤ρ≤0.1, θ at this time1And θ2As final θ1And θ2
CN201910027016.4A 2019-01-11 2019-01-11 Vehicle door limiter detection method based on Adaboost and template matching Active CN109886265B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910027016.4A CN109886265B (en) 2019-01-11 2019-01-11 Vehicle door limiter detection method based on Adaboost and template matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910027016.4A CN109886265B (en) 2019-01-11 2019-01-11 Vehicle door limiter detection method based on Adaboost and template matching

Publications (2)

Publication Number Publication Date
CN109886265A true CN109886265A (en) 2019-06-14
CN109886265B CN109886265B (en) 2022-08-16

Family

ID=66925787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910027016.4A Active CN109886265B (en) 2019-01-11 2019-01-11 Vehicle door limiter detection method based on Adaboost and template matching

Country Status (1)

Country Link
CN (1) CN109886265B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818983A (en) * 2021-01-22 2021-05-18 常州友志自动化科技有限公司 Method for judging character inversion by using picture acquaintance

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080273800A1 (en) * 2005-01-11 2008-11-06 Nec Corporation Template Matching Method, Template Matching Apparatus, And Recording Medium That Records Program For It
CN103870803A (en) * 2013-10-21 2014-06-18 北京邮电大学 Vehicle license plate recognition method and system based on coarse positioning and fine positioning fusion
CN108615034A (en) * 2017-12-14 2018-10-02 燕山大学 A kind of licence plate recognition method that template matches are combined with neural network algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080273800A1 (en) * 2005-01-11 2008-11-06 Nec Corporation Template Matching Method, Template Matching Apparatus, And Recording Medium That Records Program For It
CN103870803A (en) * 2013-10-21 2014-06-18 北京邮电大学 Vehicle license plate recognition method and system based on coarse positioning and fine positioning fusion
CN108615034A (en) * 2017-12-14 2018-10-02 燕山大学 A kind of licence plate recognition method that template matches are combined with neural network algorithm

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818983A (en) * 2021-01-22 2021-05-18 常州友志自动化科技有限公司 Method for judging character inversion by using picture acquaintance

Also Published As

Publication number Publication date
CN109886265B (en) 2022-08-16

Similar Documents

Publication Publication Date Title
Anagnostopoulos et al. A license plate-recognition algorithm for intelligent transportation system applications
CN101350069B (en) Computer implemented method for constructing classifier from training data and detecting moving objects in test data using classifier
CN103761531B (en) The sparse coding license plate character recognition method of Shape-based interpolation contour feature
CN104504383B (en) A kind of method for detecting human face based on the colour of skin and Adaboost algorithm
CN101996308A (en) Human face identification method and system and human face model training method and system
CN105893941B (en) A kind of facial expression recognizing method based on area image
CN108154144A (en) A kind of name of vessel character locating method and system based on image
Ashfaq et al. Classification of hand gestures using Gabor filter with Bayesian and naïve Bayes classifier
Sahu et al. A comparative analysis of deep learning approach for automatic number plate recognition
Li et al. Seatbelt detection based on cascade adaboost classifier
Qiu et al. Coarse iris classification by learned visual dictionary
Lin et al. A traffic sign recognition method based on deep visual feature
CN109886265A (en) A kind of car door limiter detection method based on Adaboost and template matching
Curran et al. The use of neural networks in real-time face detection
Shaout et al. A smart traffic sign recognition system
Sadeq et al. Comparison Between Face and Gait Human Recognition Using Enhanced Convolutional Neural Network
KR100893086B1 (en) Method for detecting face robust to illumination change
CN113887509A (en) Rapid multi-modal video face recognition method based on image set
Wu A Back-Propagation Neural Network for Recognizing Objects
Yang et al. Dangerous object detection by deep learning of convolutional neural network
Anand et al. Voting classification method for vehicle number plate detection
Bergboer et al. A context-based model of attention
Abdirahman et al. Enhancing Facemask Detection using Deep learning Models
Xu et al. Eye location using hierarchical classifier
Khammari et al. Robust face detection using haar features with weber local descriptor and local binary pattern

Legal Events

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