Vehicle color identification methodTechnical field
The present invention relates to image processing techniques, be specifically related to a kind of method of road image being carried out to information of vehicles detection, relate in particular to vehicle color identification method.
Background technology
In recent years, along with the develop rapidly of computing machine and Internet technology, the rapid growth of various vehicles numbers, various information comprises that the information relevant to traffic presents the situation of explosive growth.In order to manage safer, efficiently these information, intelligent transportation system (Intelligence Transportation System) is arisen at the historic moment.Intelligent transportation system can be at charge bayonet socket, parking lot, and the aspects such as criminal tracking show powerful effect.In video image, information of vehicles comprises the number-plate number, vehicle color, vehicle model etc., and wherein vehicle color is identified in road vehicle monitoring very important effect, is a part indispensable in information of vehicles.When number-plate number None-identified or cannot distinguish time, other information of vehicles such as vehicle color just become the foundation of distinguishing vehicle.For example, in violation deck vehicle identification, must distinguish same number plate vehicle by non-number plate information, vehicle color information is exactly first-selected.
Vehicle color judgement is mainly divided into two processes, first need in evidence obtaining picture, choose the candidate region of vehicle color judgement, then color judgement is carried out in this region, output vehicle color.Choosing of vehicle color judgement candidate region is the key of vehicle color identification.
Traditional vehicle color identification method, to choose whole vehicle or an input that rectangular area judges as vehicle color, due to the region of real reflection vehicle color above whole vehicle seldom, and window or exhausr port color above vehicle may have a long way to go with vehicle color, the identification of vehicle color is produced to very large interference.Therefore said method has above-mentioned interference sensitive issue.
Summary of the invention
For the existing problem of above-mentioned existing vehicle recongnition technique, the object of the present invention is to provide a kind of vehicle color identification method of optimization, the method can solve the problem that the candidate region for color judgement that prior art chooses exists larger interference, can identify more accurately the color of vehicle.
In order to achieve the above object, the present invention adopts following technical scheme:
Vehicle color identification method, described recognition methods comprises the steps:
(1) position of positioning licence plate, and identify the color of car plate;
(2), according to the color of car plate, choose region corresponding to car plate top and identify reference zone as vehicle color;
(3) by the method for statistics, vehicle is divided into colored car and black and white grey car, if vehicle is judged as colored car, proceeds to step (4) and carry out color identification; If vehicle is judged to be black and white grey car, proceeds to step (5) and carry out color identification;
(4) isolate the colored region in reference zone, and color identification is carried out in this region;
(5) with reference to Region Segmentation, according to the colour consistency in each region, judge that whether this region is effective, and identify the color of each effective coverage, finally by ballot, determine vehicle color.
In the preferred embodiment of this recognition methods, in described step (4), realize as follows:
(4-1) create the H passage histogram of reference zone;
(4-2), according to the histogram of H passage, isolate two parts mass-tone region, and find corresponding region as back projection;
(4-3) at S passage, carry out cluster, get the region that the higher and area occupied ratio of class central value is wherein greater than certain threshold value;
(4-4) result of the result of step (4-2) and step (4-3) is carried out and operation, isolate colored region;
(4-5) isolated colored region is carried out to color identification.
Further, in described step (4-5), also comprise the step that the result of color identification is judged for the second time, if the result of color identification is colored, this result is considered as to the color of vehicle, if color recognition result is that black and white is silver-gray, proceeds to step (5) and again carry out color identification.
Further, in described step (5), realize as follows:
(5-1) with reference to region, be divided into N part;
(5-2) calculate the variance of every part of region in S passage, and select several regions of S variance minimum as effective coverage;
(5-3) color identification is carried out in each effective coverage;
(5-4) according to the result of step (5-3), by definite vehicle color of voting.
By such scheme, there is the problem of larger interference in the candidate region for color judgement that the present invention can effectively avoid choosing in identifying, can identify very accurately the color of vehicle, improves greatly the precision of identification.
Moreover when this programme is identified, identification computing velocity is fast, recognition efficiency is high.
Accompanying drawing explanation
Below in conjunction with the drawings and specific embodiments, further illustrate the present invention.
Fig. 1 vehicle color identification method process flow diagram of the present invention;
Fig. 2 is the reference zone schematic diagram of yellow car plate vehicle color identification;
Fig. 3 is the reference zone schematic diagram of blue car plate vehicle color identification;
The separated instance graph of the colored region in Fig. 4 reference zone.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach object and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
Referring to Fig. 1, it is depicted as the process flow diagram that the present invention carries out vehicle color identification.As seen from the figure, the present invention is to carry out vehicle color identifying as follows:
The first step, first obtains the image of vehicle head.
Second step, carries out the location of car plate position and the identification of car plate color to the vehicle head image acquiring.The prerequisite that is this recognition methods for position and the colouring information of car plate, because existing most information of vehicles detection system all comprises car plate location and identification module, therefore can directly utilize car plate location and the result of identifying, determine the reference zone of vehicle color identification, not need operation bidirectional.The result of car plate color identification specifically can be divided into yellow and other colors, as blueness.
The 3rd step, after obtaining car plate position and colouring information, is identified for the reference zone of vehicle color identification according to the color of car plate.If the result of car plate color identification is yellow, get the coboundary that image coboundary is reference zone, the lower boundary thatcar plate 10 coboundaries are reference zone, the border, left and right of reference zone and the left and right borderline phase of car plate are same simultaneously, form thus the reference zone 20(ofyellow car plate 10 correspondences as shown in Figure 2).
If the result of car plate identification is blue, upwards 6 coboundaries that car plate height is reference zone,board 30 coboundaries of picking up the car,car plate 30 coboundaries are 3.5 lower boundaries that car plate height is reference zone upwards, the border, left and right of reference zone and the left and right borderline phase of car plate are same simultaneously, form thus the reference zone 40(ofblue car plate 30 correspondences as shown in Figure 3).
The 4th step, after having determined reference zone, the method by statistics, judges that whether reference zone has the region over certain percentage is colored region, is divided into vehicle the silver grey car of colored car and black and white thus.For the statistical method using, specifically can adopt the statistical method based on the histogrammic statistical method of S passage, the information of subtracting each other between two rear sum and color cluster Hou Lei center based on the three-channel color average of RGB, the statistical method based on S passage color cluster.Certainly, can adopt other prior aries that vehicle is divided into colored car and the silver grey car of black and white.
The 5th step, according to the judged result of reference zone, carry out corresponding identifying operation:
If result of determination is colored car, the colored region in separated reference zone, the colored region of Bing Dui sub-department is carried out color identification, obtain after the color recognition result of colored region, carrying out color for the second time judges again, if secondary colors result of determination is colour, be considered as effectively, if secondary colors result of determination is black and white silver gray, to obtain vehicle color in photo be the silver-gray result of black and white;
If result of determination is the silver grey car of black and white, comprise by color for the first time and for the second time and judge the result drawing, with reference to region divided in equal amounts, and by colour consistency, calculate effective coverage, and then the color of identification effective coverage, finally by the method for ballot, determine the color of vehicle in photo.
In step 5, the following scheme of the concrete employing of colored region in separated reference zone realizes:
As shown in Figure 4, having determined reference zone and having obtained after colored result, first create the H passage histogram of reference zone when color is for the first time judged.Because color is judged for the first time result is colour, can obtain in reference zone except vehicle window and heat radiator etc. disturb, also comprise the colored region that saturation degree is higher, and because the number percent of the shared whole reference zone of colored region is higher, can judge that the color of colored region is vehicle color in photo.Thus, the H passage histogram of reference zone should be bimodal, as Fig. 4 shows the H passage bimodal histogram of the reference zone of certain vehicle photo.
Then, according to the bimodal histogram of H passage, be separated into two mass-tone regions, and find region corresponding in reference zone as back projection.As Fig. 4, its two mass-tone regions that show H passage with and in reference zone corresponding region.
Then, at S passage, carry out cluster, wherein in Fig. 4 example illustrated, specifically gathering is 3 classes, and takes out the region that the higher and area occupied ratio of S value is wherein greater than certain threshold value.Threshold value in Fig. 4 example illustrated is 5%, and this region is shown in Figure 4.
Finally, by region that back projection is obtained and the higher region of S value, do to obtain colored region with operation, and it is separated from reference zone.
After obtaining colored region, colored region is carried out to color identification.Color is known method for distinguishing and can be adopted but not be limited to existing technology, comprises color identification based on color histogram, the color identification based on color moment etc.Preferably, the adoptable sorter based on algorithm of support vector machine, the sorter certainly adopting is not restricted to the described sorter based on algorithm of support vector machine.
In step 5, for the color of the silver grey car of black and white, identify and specifically can adopt following scheme to realize:
When color for the first time or for the second time judges that the result that obtains is as black and white silver gray, adopt the method for ballot to carry out color identification.First with reference to Region Segmentation, as an example, can be divided into 20 sub regions with reference to region.
Then, add up the variance of the S passage of this 20 sub regions, the less several regions of variance of getting S passage are effective coverage, as an example, get 7 regions that variance is less herein as effective coverage.
Then, color identification is carried out respectively in 7 selected effective coverages, and the quantity in the identical region of statistical color.
Finally, the color that definite area quantity is maximum is the color of vehicle in photo.
More than show and described ultimate principle of the present invention, principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that in above-described embodiment and instructions, describes just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.