Summary of the invention
Not high according to the recognition accuracy of traffic sign recognition method at this stage set forth above, operation time is longer, it is difficult to full
The technical issues of demand of the vehicle-mounted real-time of foot, and a kind of traffic mark of HOG-MBLBP fusion feature based on PCA dimensionality reduction is provided
Will recognition methods.The technological means that the present invention uses is as follows:
A kind of traffic sign recognition method of the HOG-MBLBP fusion feature based on PCA dimensionality reduction, comprising the following steps:
S1, training sample training sorter model is utilized.
S11, construction training sample database, the picture comprising various types traffic sign.
Training sample image in the determined training set of S12, extraction step S11 carries out gray processing, extracts HOG
(Historgram of gradient) feature.
Training sample image in the determined training set of S13, extraction step S11 extracts MBLBP (Multiscale Block
Local Binary Pattern) feature.
HOG and two feature vectors of MBLBP obtain HOG-MBLBP fusion feature in S14, series connection step S12 and step 13
Vector.
S15, the obtained fusion feature vector is used into PCA (Principal Component Analysis) algorithm
Carry out dimensionality reduction.
S16, step S15 is obtained using linear SVM SVM (Support Vector Machine) algorithm
The fusion feature vector after dimensionality reduction is trained, and obtains SVM traffic sign classifier.
S2, detection positioning image in region of interest ROI (region of interest) to get arrive traffic indication map
Picture.
S3, Traffic Sign Images are identified using sorter model.
S31, the Traffic Sign Images gray processing that positioning is detected in step S2 is handled.
The HOG-MBLBP fusion feature for the Traffic Sign Images that S32, extraction are handled through gray processing.
S33, fusion feature is subjected to PCA dimensionality reduction.
S34, using trained SVM traffic sign classifier identifies traffic sign generic in step S1.
As in preferred steps S2, detection positions region of interest ROI (region of interest) in image, specifically
The following steps are included:
S21, color segmentation is carried out to traffic sign under HSI color space.
S22, shape segmentations are carried out to the region in step S21 after color segmentation.
The Traffic Sign Images that S23, location cutting go out.
As in preferred steps S14, two feature vectors of cascaded H OG and MBLBP obtain HOG-MBLBP fusion feature to
Amount, the feature vector after obtaining two Fusion Features, fused feature vector are formulated are as follows:
θ=(μ x, (1- μ) y);
μ is weight coefficient, due to HOG, MBLBP Expressive Features in terms of gradient, texture two respectively, by many experiments,
Show that effect is best when μ=0.5.
As in preferred steps S15, the obtained fusion feature vector is used into PCA (Principal Component
Analysis) algorithm carries out dimensionality reduction, specifically includes the following steps:
The each row for the fusion feature that S151, setting procedure S14 are obtained carries out zero averaging.
S152, the covariance matrix for finding out step S151 matrix.
S153, the characteristic value for finding out S152 covariance matrix and corresponding feature vector.
S154, the feature vector for obtaining step S153 by corresponding eigenvalue size from top to bottom by rows at matrix,
K row forms new matrix before taking.
It S155, is that dimensionality reduction is tieed up to k by the matrix that step S154 is obtained and the fusion feature matrix multiple that step S14 is obtained
New data set afterwards.
As in preferred steps S12, the histograms of oriented gradients HOG feature of extraction step S11 training sample is specifically included
Following steps:
S121, grayscale image is converted by training picture.
S122, color space normalization is carried out to input picture using gamma correction method, standardization disappears well
Except the influence of image global illumination and contrast.
If I (x, y) is the gray value of (x, y) coordinate pixel, gamma compresses formula:
I (x, y)=I (x, y)gamma
Wherein gamma=0.5;
S123, the gradient magnitude for calculating each pixel of image and direction:
Gradient operator: horizontal edge operator: [- 1,0,1];Vertical edge operator: [- 1,0,1]T;
The gradient of pixel (x, y) in image are as follows:
Gx(x, y)=H (x+1, y)-H (x-1, y)
Gy(x, y)=H (x, y+1)-H (x, y-1)
G in formulax(x, y), Gy(x, y), H (x, y) respectively indicate the ladder of the horizontal direction in input picture at pixel (x, y)
Degree, vertical gradient and pixel value.
Gradient magnitude G (x, y) and gradient direction α at pixel (x, y) are respectively as follows:
S124, statistic unit inside gradient histogram, by image window region division at equally distributed cell unit, each
Cell unit includes 8 × 8 pixels, handle in each cell unitGradient direction is divided into 9 sections bin, right
Each pixel is weighted projection with gradient direction in histogram in cell unit, obtains the gradient direction histogram of cell unit
Figure.
S125, normalization region unit inside gradient direction histogram, every 2 × 2 cell form a block block, each
There is the feature vector of 36 dimensions in block block, entire block block be normalized using L2- norm:
Wherein v is feature vector, ‖ v ‖2Indicate 2 norms of v, ε indicates a very small constant, is 0 with to avoid denominator.
S126, the HOG set of descriptors of all block blocks is combined, forms final HOG feature description vectors.
As the MB-LBP feature of extraction step S11 training sample in preferred steps S13, specifically includes the following steps:
S131, fritter one by one is divided the image into first, block size is 24 pixels × 24 pixels, and each fritter divides again
For zonule one by one, size is 8 pixels × 8 pixels, and moving step length is 4 pixels, the average gray conduct in zonule
The gray value in current area domain is compared with peripheral cell domain gray scale.
S132, for the zonule in each block, the average gray of 8 adjacent zonules is compared with it
Compared with, if surrounding average gray is greater than the average gray of central area, the position of the zonule is marked as 1, otherwise for
0;
Wherein (xc, yc) be center cell domain average gray, icIt is the average brightness in center cell domain, ipIt is adjacent
The average brightness of zonule, s are sign functions:
S133, setting are decimal number LBP values, then calculate the histogram of each block, i.e., the frequency that each number occurs
Rate;Then the histogram is normalized.
S134, finally the statistic histogram of obtained each block is attached as a feature vector, that is,
The MBLBP texture feature vector of whole picture figure.
As in preferred steps S16, linear SVM SVM (Support Vector Machine) algorithm pair is used
The fusion feature vector after the dimensionality reduction that step S15 is obtained is trained, and is obtained SVM traffic sign classifier, is specifically included
Following steps:
Linear SVM solves process primal problem:
S161, convex optimization problem is converted by former problem:
s.t.yi(ωT·xi+b)≥1-ξi, i=1,2 ..., N;
ξi>=0, i=1,2 ..., N
Wherein, hyperplane equation is ωTX+b=0, ξiFor slack variable, C for two in Controlling object function (find away from
From maximum hyperplane and guarantee data point departure minimum between) weight.
S162, convex optimization problem solving:
S1621, building Lagrangian:
Wherein: Lagrange multiplier: αi, ri>=0, i=1,2 ..., N;
It enables:
I.e.
p*It indicates the optimal solution of this problem, and is of equal value with initial problem.
S1622, primal problem dualization, then convert are as follows:
The optimal value d of this dual problem*It indicates.
S1623, dual problem is solved using KKT condition:
Before substitutionIn, it obtains:
Lagrange multiplier α is asked greatly, i.e., about the optimization problem of dual problem
s.t.0≤αi≤ C, i=1,2 ..., N
The very big Lagrange multiplier α in above-mentioned dual problem is found out using SMO algorithm*;
Then optimal solution ω is sought using following formula*And b*:
Obtain categorised decision function:
As color segmentation is carried out to traffic sign under HSI color space in preferred steps S21, following step is specifically included
It is rapid:
Setting (R, G, B) is the red, green and blue coordinate value of a certain color, RGB to HIS space conversion formula respectively are as follows:
I=(R+G+B)/3;
For convenience of selected threshold, tri- components of H, S, I are normalized into [0,255];
Because for detecting instruction traffic sign, the threshold value of blue segmentation are as follows:
Whether H ∈ [200,248], S ∈ [30,100], I ∈ (18,99) are that sense is emerging with this threshold decision current pixel point
The pixel value is set to 255, is otherwise set to 0 by interesting color point if point-of-interest, to complete the binaryzation of image.
As the Traffic Sign Images that location cutting in preferred steps S23 goes out, specifically includes the following steps:
S231, median filtering is carried out to gained image in step S21, filters single noise spot to a certain extent.
S232, Morphological scale-space is carried out to filtered image obtained by step S231, what is guaranteed is one closed
Shape.
S233, the obtained closed figure of step S232 is filled.
S234, contour detecting is carried out to the image that step S233 is obtained, preliminary screening goes out region of interest ROI;Due to wheel
Wide detection method is easy to come in noise measuring, so limitation the ratio of width to height is between 0.5-2, area minimum value is set as 400 pictures
Element.
Whether the region that S235, judgement detect is circle, in the region boundary rectangle detected, is divided into four pieces,
Missing pixel by four pieces compares, and c1, c2, c3, c4 are respectively shared by upper left, upper right, lower-left and lower right area inactive pixels
Can ratio be screened by meet following limitation simultaneously:
0.037 < c1, c2, c3, c4 < 0.12
(| c1-c2 | < 0.04&& | c3-c4 | < 0.04) | | (| c1-c3 | < 0.04&& | c2-c4 | < 0.04).
S236, circularity detection, obtain final area-of-interest
Wherein S is the area of circle, and L is the perimeter of circle, and C is circularity, limits C >=0.4.
S237, area-of-interest is determined by conditions above, then according to the upper left corner picture of the correspondence rectangle in each region
The transverse and longitudinal coordinate of element and the length of rectangle and width are cut in original image, and cutting the image to get off is the friendship detected after positioning
Logical sign image.
Compared with the prior art, the traffic sign of the HOG-MBLBP fusion feature provided by the invention based on PCA dimensionality reduction is known
Other method, using training sample training sorter model, detection positions the traffic sign position in training image, extracts traffic mark
The HOG-MBLBP fusion feature vector of will image simultaneously carries out dimensionality reduction, identifies the affiliated traffic sign classification of test image.Energy of the present invention
The defect for overcoming single features, largely improves discrimination, to improve accuracy.
What the present invention used carries out Traffic Sign Recognition based on HOG-MBLBP fusion feature, in detection-phase, makes first
With based on method for traffic sign detection under HSI color space, color threshold segmentation is carried out in space, the area being then partitioned into
Domain carries out median filtering, corrosion expansion, filling, obtains rectangle and circular bounding box secondly by polygonal segments profile, so
It is screened by limitation depth-width ratio, contour area, circularity, the region of traffic sign is cut from original image again afterwards finally
Get off, completes detection.
The method scale is constant, can carry out reliable road traffic sign detection in complicated traffic sign scene, be convenient for
Carry out next step identification.
In cognitive phase, Gradient Features and Local textural feature are combined, it is abundanter than single features in description performance,
It can overcome the disadvantages that the limitation of single features to improve discrimination.
While improving discrimination using fusion feature, due to carrying out dimensionality reduction to fusion feature, so that dimension obtains very
Big reduction, therefore shorten recognition time.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
As shown, a kind of traffic sign recognition method of the HOG-MBLBP fusion feature based on PCA dimensionality reduction, including with
Lower step:
S1, training sample training sorter model is utilized.
S11, construction training sample database, the picture comprising various types traffic sign.
Training sample is constructed, what is selected here is that traffic mark is indicated in German traffic sign data set (GTSRB data set)
Will position positive sample, each instruction classification of traffic sign position one, is arranged label, random shooting to different instruction traffic signs
Multiple image sets not comprising traffic sign are as negative sample.
Training sample image in the determined training set of S12, extraction step S11 carries out gray processing, extracts HOG
(Historgram of gradient) feature.
In step S12, the histograms of oriented gradients HOG feature of extraction step S11 training sample specifically includes following step
It is rapid:
S121, grayscale image is converted by training picture.
S122, color space normalization is carried out to input picture using gamma correction method, standardization disappears well
Except the influence of image global illumination and contrast.
If I (x, y) is the gray value of (x, y) coordinate pixel, gamma compresses formula:
I (x, y)=I (x, y)gamma
Wherein gamma=0.5.
S123, the gradient magnitude for calculating each pixel of image and direction:
Gradient operator: horizontal edge operator: [- 1,0,1];Vertical edge operator: [- 1,0,1]T;
The gradient of pixel (x, y) in image are as follows:
Gx(x, y)=H (x+1, y)-H (x-1, y)
Gy(x, y)=H (x, y+1)-H (x, y-1)
G in formulax(x, y), Gy(x, y), H (x, y) respectively indicate the ladder of the horizontal direction in input picture at pixel (x, y)
Degree, vertical gradient and pixel value;
Gradient magnitude G (x, y) and gradient direction α at pixel (x, y) are respectively as follows:
S124, statistic unit inside gradient histogram, by image window region division at equally distributed cell unit, each
Cell unit includes 8 × 8 pixels, handle in each cell unitGradient direction is divided into 9 sections bin, right
Each pixel is weighted projection with gradient direction in histogram in cell unit, obtains the gradient direction histogram of cell unit
Figure.
S125, normalization region unit inside gradient direction histogram, every 2 × 2 cell form a block block, each
There is the feature vector of 36 dimensions in block block, entire block block be normalized using L2- norm:
Wherein v is feature vector, ‖ v ‖2Indicate 2 norms of v, ε indicates a very small constant, is 0 with to avoid denominator.
S126, the HOG set of descriptors of all block blocks is combined, forms final HOG feature description vectors.
Training sample image in the determined training set of S13, extraction step S11 extracts MBLBP (Multiscale Block
Local Binary Pattern) feature;This is in front of the extraction of MBLBP feature, it is preferred that can carry out ash to sample image
Degreeization processing.
The MB-LBP feature of extraction step S11 training sample in step S13, specifically includes the following steps:
S131, fritter one by one is divided the image into first, block size is 24 pixels × 24 pixels, and each fritter divides again
For zonule one by one, size is 8 pixels × 8 pixels, and moving step length is 4 pixels, the average gray conduct in zonule
The gray value in current area domain is compared with peripheral cell domain gray scale.
S132, for the zonule in each block, the average gray of 8 adjacent zonules is compared with it
Compared with, if surrounding average gray is greater than the average gray of central area, the position of the zonule is marked as 1, otherwise for
0。
Wherein (xc, yc) be center cell domain average gray, icIt is the average brightness in center cell domain, ipIt is adjacent
The average brightness of zonule, s are sign functions:
S133, setting are decimal number LBP values, then calculate the histogram of each block, i.e., the frequency that each number occurs
Rate;Then the histogram is normalized.
S134, finally the statistic histogram of obtained each block is attached as a feature vector, that is,
The MBLBP texture feature vector of whole picture figure.
HOG and two feature vectors of MBLBP obtain HOG-MBLBP fusion feature in S14, series connection step S12 and step 13
Vector, the feature vector after obtaining two Fusion Features, fused feature vector are formulated are as follows:
θ=(μ x, (1- μ) y);
μ is weight coefficient, due to HOG, MBLBP Expressive Features in terms of gradient, texture two respectively, by many experiments,
Show that effect is best when μ=0.5.
S15, the obtained fusion feature vector is used into PCA (Principal Component Analysis) algorithm
Dimensionality reduction is carried out, specifically includes the following steps:
The each row for the fusion feature that S151, setting procedure S14 are obtained carries out zero averaging.
S152, the covariance matrix for finding out step S151 matrix.
S153, the characteristic value for finding out S152 covariance matrix and corresponding feature vector.
S154, the feature vector for obtaining step S153 by corresponding eigenvalue size from top to bottom by rows at matrix,
K row forms new matrix before taking.
It S155, is that dimensionality reduction is tieed up to k by the matrix that step S154 is obtained and the fusion feature matrix multiple that step S14 is obtained
New data set afterwards.
LBP can preferably describe the Local textural feature of image, have gray scale invariance, and computational efficiency is high, and rotation is not
Denaturation and More General Form, the grey scale change caused by illumination variation have the advantages that robustness.But information is extracted to whole picture figure
It is imperfect, the extraction of edge and direction character cannot be effectively carried out, to the poor robustness of complicated image whole description.
HOG feature can be changed by the local shape of image, describe the edge and profile information of image well.Pass through
The processing method that piecemeal sub-unit quantization position and direction more refine can more fully indicate each picture of image local area
Relationship between vegetarian refreshments, to reduce the interference of translation and rotation, the gradient that HOG feature passes through regional area to a certain extent
Intensity and direction histogram construct characteristics of image.
HOG effect in the noise edge containing there are many of the background where target is poor, and MBLBP can filter out noise well,
Make up the defect of HOG feature.Edge and local shape information are combined there are also texture information, can be good at capturing traffic mark
Will, so HOG feature and LBP characteristic binding are got up characterized traffic sign, both gradient letters of available traffic sign
Breath, and the texture information of available traffic sign improve the road traffic sign detection rate in complex background.Due to redundancy after fusion
Information is more, so using PCA dimensionality reduction fusion feature.
S16, step S15 is obtained using linear SVM SVM (Support Vector Machine) algorithm
The fusion feature vector after dimensionality reduction is trained, and obtains SVM traffic sign classifier, specifically includes the following steps:
Linear SVM solves process primal problem:
S161, convex optimization problem is converted by former problem:
s.t.yi(ωT·xi+b)≥1-ξi, i=1,2 ..., N;
ξi>=0, i=1,2 ..., N
Wherein, hyperplane equation is ωTX+b=0, ξiFor slack variable, C for two in Controlling object function (find away from
From maximum hyperplane and guarantee data point departure minimum between) weight.
S162, convex optimization problem solving:
S1621, building Lagrangian:
Wherein: Lagrange multiplier: αi, ri>=0, i=1,2 ..., N;
It enables:
I.e.
p*It indicates the optimal solution of this problem, and is of equal value with initial problem;
S1622, primal problem dualization, then convert are as follows:
The optimal value d of this dual problem*It indicates.
S1623, dual problem is solved using KKT condition:
Before substitutionIn, it obtains:
Lagrange multiplier α is asked greatly, i.e., about the optimization problem of dual problem
s.t.0≤αi≤ C, i=1,2 ..., N
The very big Lagrange multiplier α in above-mentioned dual problem is found out using SMO algorithm*;
Then optimal solution ω is sought using following formula*And b*:
Obtain categorised decision function:
S2, detection positioning image in region of interest ROI (region of interest) to get arrive traffic indication map
Picture;
S21, color segmentation is carried out to traffic sign under HSI color space.
Color segmentation is carried out to traffic sign under HSI color space in step S21, specifically includes the following steps:
Setting (R, G, B) is the red, green and blue coordinate value of a certain color, RGB to HIS space conversion formula respectively are as follows:
I=(R+G+B)/3;
For convenience of selected threshold, tri- components of H, S, I are normalized into [0,255];
Because for detecting instruction traffic sign, the threshold value of blue segmentation are as follows:
Whether H ∈ [200,248], S ∈ [30,100], I ∈ (18,99) are that sense is emerging with this threshold decision current pixel point
The pixel value is set to 255, is otherwise set to 0 by interesting color point if point-of-interest, to complete the binaryzation of image.
S22, shape segmentations are carried out to the region in step S21 after color segmentation.
The Traffic Sign Images that S23, location cutting go out.
The Traffic Sign Images that location cutting goes out in step S23, specifically includes the following steps:
S231, median filtering is carried out to gained image in step S21, filters single noise spot to a certain extent.
S232, Morphological scale-space is carried out to filtered image obtained by step S231, what is guaranteed is one closed
Shape.
S233, the obtained closed figure of step S232 is filled.
S234, contour detecting is carried out to the image that step S233 is obtained, preliminary screening goes out region of interest ROI;Due to wheel
Wide detection method is easy to come in noise measuring, so limitation the ratio of width to height is between 0.5-2, area minimum value is set as 400 pictures
Element.
Whether the region that S235, judgement detect is circle, in the region boundary rectangle detected, is divided into four pieces,
Missing pixel by four pieces compares, and c1, c2, c3, c4 are respectively shared by upper left, upper right, lower-left and lower right area inactive pixels
Can ratio be screened by meet following limitation simultaneously:
0.037 < c1, c2, c3, c4 < 0.12
(| c1-c2 | < 0.04&& | c3-c4 | < 0.04) | | (| c1-c3 | < 0.04&& | c2-c4 | < 0.04).
S236, circularity detection, obtain final area-of-interest
Wherein S is the area of circle, and L is the perimeter of circle, and C is circularity, limits C >=0.4.
S237, area-of-interest is determined by conditions above, then according to the upper left corner picture of the correspondence rectangle in each region
The transverse and longitudinal coordinate of element and the length of rectangle and width are cut in original image, and cutting the image to get off is the friendship detected after positioning
Logical sign image.
S3, Traffic Sign Images are identified using sorter model.
S31, the Traffic Sign Images gray processing that positioning is detected in step S2 is handled.
The HOG-MBLBP fusion feature for the Traffic Sign Images that S32, extraction are handled through gray processing.
S33, fusion feature is subjected to PCA dimensionality reduction.
S34, using trained SVM traffic sign classifier identifies traffic sign generic in step S1.
The traffic sign recognition method of HOG-MBLBP fusion feature of the present invention based on PCA dimensionality reduction, and it is individual
HOG method compares with individual LBP method, and by experimental verification, accuracy rate is to be significantly improved, following table:
Feature |
Accuracy rate % |
Time-consuming s |
HOG |
95.69 |
36.081 |
MBLBP |
94.77 |
35.713 |
HOG-MBLBP |
97.38 |
58.449 |
In the present invention, histograms of oriented gradients (Histogram of Oriented Gradient, HOG) is characterized in one kind
It is used to carry out the Feature Descriptor of object detection in computer vision and image procossing.HOG feature passes through calculating and statistical chart
As the gradient orientation histogram of regional area carrys out constitutive characteristic.
MBLBP, muti-piece local binary patterns (the Multiscale Block Local Binary based on subregion
Pattern), MBLBP derives on the basis of LBP and is gone out, and the comparison in LBP between single pixel point is substituted for region unit and is put down
The comparison of equal gray value.
PCA algorithm: Chinese Principal Component Analysis Method (principal Component Analysis), also referred to as main point
Measure analytic approach.
SVM (Support Vector Machine) refers to support vector machines, is a kind of common method of discrimination.In machine
Device learning areas is the learning model for having supervision, commonly used to carry out pattern-recognition, classification and regression analysis.
ROI (region of interest), area-of-interest.In machine vision, image procossing, from processed image
Region to be treated, referred to as area-of-interest, ROI are sketched the contours of in a manner of box, circle, ellipse, irregular polygon etc..?
It is emerging to acquire sense that various operators (Operator) and function are commonly used on the machine vision softwares such as Halcon, OpenCV, Matlab
Interesting region ROI, and carry out the next step processing of image.
HSI refers to the model of a digital picture, is that U.S. chromatist's Munsell (H.A.Munsell) was mentioned in 1915
Out, it reflects the colored mode of vision system perception of people, is felt with three kinds of tone, saturation degree and brightness essential characteristic amounts
Fundamental color.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.