Summary of the invention
The main purpose of the present invention is to provide a kind of traffic signals recognition methods, system, equipment and computer-readable deposit
Storage media, it is intended to solve longer, the technical problem of the real-time difference of identification the time required to the identification of the prior art.
To achieve the above object, the present invention provides a kind of traffic signals recognition methods, comprising steps of
Obtain the road scene image of camera captured in real-time;
Extract region of interest ROI in road scene image;
Based on RGB color, ROI is handled, to obtain traffic signals candidate region;
Histograms of oriented gradients HOG feature and default support vector machines by the traffic signals candidate region are known
Other traffic signals.
Optionally, described to be based on RGB color, ROI is handled, traffic signals candidate region step packet is obtained
It includes:
When traffic signals are traffic lights, to ROI gray processing to obtain ROI grayscale image, and to the ROI grayscale image
Noise reduction process is carried out, to obtain the ROI grayscale image after noise reduction;
Binaryzation is carried out to the ROI grayscale image after noise reduction, obtains ROI binary map;
The all areas profile that gray value is 255 in ROI binary map is chosen, the region contour is mapped to the ROI
In, obtain preliminary traffic lights candidate region in ROI;
The R channel value, G channel value and channel B value variance for obtaining the preliminary traffic lights candidate region, will be described first
The variance for walking R channel value, G channel value and channel B value in traffic lights candidate region is greater than or equal to corresponding preset threshold
Region is as traffic lights secondary in ROI candidate region;
Closed operation is carried out to the corresponding ROI two-value graph region in the secondary traffic lights candidate region, obtains closed operation
Secondary traffic lights candidate region binary map afterwards;
Profile screening is carried out to the secondary traffic lights candidate region binary map after the closed operation, by the wheel after screening
Exterior feature is mapped in ROI, obtains the final candidate region of traffic lights, and believe the final candidate region of traffic lights as traffic
Number candidate region.
Optionally, described to be based on RGB color, ROI is handled, traffic signals candidate region step packet is obtained
It includes:
When traffic signals are traffic prohibitory signs, color segmentation is carried out to ROI, to obtain the binary map of ROI;
Noise reduction is carried out to ROI binary map, the ROI binary map after obtaining noise reduction;
Opening operation is carried out to the ROI binary map after noise reduction, obtains ROI binary map after opening operation;
Profile screening is carried out to ROI binary map after opening operation, the profile after screening is mapped in ROI, traffic is obtained and prohibits
Mark candidate region is enabled, and using traffic prohibitory sign candidate region as traffic signals candidate region.
Optionally, described when traffic signals are traffic prohibitory signs, color segmentation is carried out to ROI, to obtain the two of ROI
Value figure step includes:
It is handled using RGB channel value of the normalization algorithm to ROI, obtains RGB channel value after normalized;
The channel R after difference and normalized in RGB channel value after obtaining normalized between any two channel values
Ratio between value and G channel value, is at corresponding preset range for the difference of the ratio obtained in ROI and any two channel values
The gray value in interior region is set as 255, and the gray value in other regions is set as 0, to obtain ROI binary map.
Optionally, the default SVM includes that the first default SVM, the second default SVM and third preset SVM;It is described to pass through
The histograms of oriented gradients HOG feature of the traffic signals candidate region and default support vector machines, identification traffic signals step
Suddenly include:
When traffic signals are traffic lights, the HOG feature of the traffic signals candidate region is extracted, by extraction
HOG feature inputs in the first default SVM, to classify to the traffic signals candidate region, to obtain the traffic letter
Traffic lights light emitting region in number candidate region;
Region extension is carried out to the traffic lights light emitting region according to the distribution of default traffic light color rule, is obtained
Obtain traffic signals light panel candidate region;
The HOG feature is input to the second default SVM by the HOG feature for extracting traffic signals light panel candidate region
In, to classify to traffic signals light panel candidate region, to obtain traffic signals light panel region;
To the traffic signals light panel region real-time tracking, and SVM is preset by third and identifies traffic lights.
Optionally, described to the traffic signals light panel region real-time tracking, and SVM is preset by third and identifies traffic
Signal lamp step includes:
The traffic signals light panel region is mapped to the corresponding band of position in the ROI and is input to KCF multiple target
In tracker, the output result of KCF multiple target tracking device is obtained;
The output result is input in targets manager, the traffic signals light panel region location information is obtained;
According to the traffic signals light panel region location information, location information corresponding region described in the ROI is extracted
HOG feature, R channel value, G channel value and channel B value;
The HOG feature of the location information corresponding region, R channel value, G channel value and channel B value input third are preset
In SVM, to identify traffic lights direction and color.
Optionally, the default SVM includes that the first default SVM, the second default SVM and third preset SVM;It is described to pass through
The histograms of oriented gradients HOG feature of the traffic signals candidate region and default support vector machines, identification traffic signals step
Suddenly include:
When traffic signals are traffic prohibitory sign, the HOG feature of the traffic signals candidate region is extracted, it will be described
HOG feature inputs in first order SVM, obtains traffic prohibitory sign and identifies candidate region for the first time;
The HOG feature that the traffic prohibitory sign identifies candidate region for the first time is extracted, the traffic prohibitory sign is first
The HOG feature of identification candidate region is input in the SVM of the second level, obtains the secondary identification region of traffic prohibitory sign;
The HOG feature is input to third level SVM by the HOG feature for extracting the secondary identification region of traffic prohibitory sign
In, identify traffic prohibitory sign.
In addition, to achieve the above object, the present invention also provides a kind of traffic signals identifying system, the system comprises:
Image module is obtained, for obtaining the road scene image of camera captured in real-time;
ROI module is extracted, for extracting region of interest ROI in road scene image;
Image pre-processing module is handled ROI, for being based on RGB color to obtain traffic signals candidate regions
Domain;
Identification module, for the histograms of oriented gradients HOG feature and default branch by the traffic signals candidate region
Vector machine SVM is held, identifies traffic signals.
In addition, to achieve the above object, the present invention also provides a kind of traffic signals to identify equipment, the equipment includes: to deposit
Reservoir, processor and it is stored in the computer program that can be run on the memory and on the processor, the computer
Program realizes the step of traffic signals recognition methods as described above when being executed by the processor.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
Computer program is stored on storage medium, the computer program realizes traffic signals as described above when being executed by processor
The step of recognition methods.
The embodiment of the present invention propose a kind of traffic signals recognition methods, device, equipment and computer can storage medium, lead to
Cross the road scene image for obtaining camera captured in real-time;Extract region of interest ROI in road scene image;Based on RGB face
The colour space handles ROI, to obtain traffic signals candidate region;Pass through the direction ladder of the traffic signals candidate region
Histogram HOG feature and default support vector machines are spent, identify traffic signals.To compared with prior art by RGB color
It is converted into HIS color space or hsv color space, traffic signals identification is directly carried out by RGB color, reduces floating-point
The time of operation can be realized the traffic signals quickly and in real time identified in road, assist safe driving.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Fig. 1 is please referred to, Fig. 1 is the hardware structural diagram of the traffic signals identification equipment in each embodiment of the present invention,
The traffic signals identification equipment includes the components such as communication module 10, memory 20 and processor 30.Those skilled in the art can
To understand, the identification of traffic signals shown in Fig. 1 equipment can also include than illustrating more or fewer components, or combination
Certain components or different component layouts.Wherein, the processor 30 respectively with the memory 20 and the communication module
10 connect, and are stored with computer program on the memory 20, the computer program is executed by processor 30 simultaneously.
Communication module 10 can be connect by network with external equipment.Communication module 10 can receive external communications equipment hair
Request out, can also broadcast traffic signal identification content to the external communications equipment.The external communications equipment can be vehicle
Carry the electronic equipments such as computer, mobile phone, tablet computer and monitoring device.
Memory 20 can be used for storing software program and various data.Memory 20 can mainly include storing program area
The storage data area and, wherein storing program area can application program needed for storage program area, at least one function (for example scheme
As processing) etc.;Storage data area, which can be stored, uses created data or information etc. according to traffic signals identification equipment.This
Outside, memory 20 may include high-speed random access memory, can also include nonvolatile memory, for example, at least a magnetic
Disk storage device, flush memory device or other volatile solid-state parts.
Processor 30 is the control centre of traffic signals identification equipment, utilizes various interfaces and the entire traffic of connection
The various pieces of signal identifying apparatus, by running or execute the software program and/or module that are stored in memory 20, and
The data being stored in memory 20 are called, the various functions and processing data of traffic signals identification equipment are executed, thus to friendship
Messenger identifies that equipment carries out integral monitoring.Processor 30 may include one or more processing units;Preferably, processor 30 can
Integrated application processor and modem processor, wherein the main processing operation system of application processor, user interface and application
Program etc., modem processor mainly handle wireless communication.It is understood that above-mentioned modem processor can not also
It is integrated into processor 30.
Although Fig. 1 is not shown, above-mentioned traffic signals identification equipment can also include circuit control module, realize power supply control
System, guarantees the normal work of other component.
It will be understood by those skilled in the art that the identification device structure of traffic signals shown in Fig. 1 is not constituted to traffic
The restriction of signal identifying apparatus may include perhaps combining certain components or different than illustrating more or fewer components
Component layout.
Based on above-mentioned hardware configuration, each embodiment of the method for the present invention is proposed.
Referring to Fig. 2, in the first embodiment of traffic signals recognition methods of the present invention, the traffic signals recognition methods packet
Include step:
Step S10 obtains the road scene image of camera captured in real-time;
Step S20 extracts region of interest ROI in road scene image;
Traffic signals are divided into: the commander of traffic lights, traffic prohibitory sign, traffic marking and traffic-police, traffic letter
Signal lamp and traffic prohibitory sign position are generally all disposed in some regional scope of road.By counting a large amount of road view
Traffic lights and traffic prohibitory sign in frequency image are behind the spatial position of video image, it can be deduced that traffic lights and
Traffic prohibitory sign spatial position region general in video image, therefore, to the road scene figure of camera captured in real-time
A certain region nearby is chosen as ROI as being likely to occur traffic lights and traffic prohibitory sign position, which is typically all
Positioned at video image fixed part, such as upper right half.
Step S30 is based on RGB color, handles ROI, to obtain traffic signals candidate region;
Based on RGB color, a series of image processing techniques is carried out to the ROI of selection, ROI is handled, including
Triple channel normalization, triple channel variance, gray processing, noise reduction, binaryzation, opening operation, closed operation and profile screening etc., by above-mentioned
Region is constantly reduced in processing, to obtain the candidate region of traffic signals, which identifies object as traffic signals.
It should be noted that color is one of important feature of traffic signals, the detection based on color is common side
Method, and the key detected is that color is described in one suitable color space model of selection.Currently used color space
There are rgb space, riser operation to carry out HIS color space or hsv color space obtained from the conversion of space.Although HSV or
Color segmentation is carried out in HIS color space, can overcome the influence of illumination variation, but space conversion needs a large amount of floating-point fortune
It calculates, which takes a long time, so that real-time needed for intelligent driving be not achieved;And color segmentation is carried out in RGB color
Space conversion process is not needed, faster ROI can be handled, faster to obtain traffic signals candidate region,
To identify traffic signals to traffic signals candidate region, therefore the method for identifying traffic signals is carried out based on RGB color
With more good real-time, real-time needed for being more able to satisfy intelligent driving.
Step S40 passes through the histograms of oriented gradients HOG feature and default supporting vector of the traffic signals candidate region
Machine SVM identifies traffic signals.
In piece image, the presentation and shape of localized target can be by gradient or the direction Density Distributions at edge well
Description.Its essence are as follows: the statistical information of gradient, and gradient is primarily present in the place at edge.Small company is divided the image into first
Logical region, referred to as cell factory (cell), count the histogram of gradients of each cell, can form the HOG of each cell
(Histogram of Oriented Gradient, histograms of oriented gradients) feature descriptor.Multiple cell are formed one
Block, the HOG feature descriptor of all cell, which is together in series, in a block just obtains the HOG feature descriptor of the block.It will be in image
All pieces of HOG feature descriptor be together in series and can be obtained by the HOG feature descriptor of the image.
By the way that the HOG feature of candidate region is input to preset SVM (Support VectorMachine, supporting vector
Machine) in, the preset SVM is trained SVM;The classification mould that will have been created in the HOG feature and default SVM
The HOG feature of type compares, and judges the type that the HOG feature belongs to;It is identified by different preset SVM, is finally identified
The content of traffic signals in candidate region;Vehicle-mounted computer, hand of the traffic signals content that will identify that by display in the car
On machine and tablet computer or voice broadcast form informs driver.
The road scene image that the present embodiment passes through acquisition camera captured in real-time;It extracts interested in road scene image
Region ROI;Based on RGB color, ROI is handled, to obtain the candidate region of traffic signals;Pass through candidate region
HOG feature and default SVM, identify traffic signals in real time.To convert HIS color for RGB color compared with prior art
Space or hsv color space directly carry out traffic signals identification by RGB color, reduce the time of floating-point operation, energy
It is enough to realize the traffic signals quickly and in real time identified in road, assist safe driving.
Further, referring to Fig. 3, the first embodiment based on the application traffic signals recognition methods proposes the application traffic
The second embodiment of signal recognition method, in the present embodiment, the step S30 includes:
Step S311, when traffic signals are traffic lights, to ROI gray processing to obtain ROI grayscale image, and to described
ROI grayscale image carries out noise reduction process, to obtain the ROI grayscale image after noise reduction;
Traffic light color is accounted in RGB with the channel R, G leading therefore bright in order to highlight the traffic lights on image
Spend feature, we take the channel R, G maximum value, to image carry out gray processing, so as to exclude in ROI with traffic light color
The corresponding region of the very big color of difference, reduces region to be processed.
Step S312 carries out binaryzation to the ROI grayscale image after noise reduction, obtains ROI binary map;
Gaussian filtering process is carried out to grayscale image with the Gaussian kernel of Size (w, h), inhibits Normal Distribution in image
Noise.By calling Gaussian filter function interface, input parameter carries out noise reduction process.Its Gaussian filter function is as follows:
Wherein μxAnd δxRepresent the expected value and standard deviation of x coordinate, μy
And δyRepresent the standard deviation of y-coordinate.
Step S313 chooses all areas profile that gray value is 255 in ROI binary map, the region contour is mapped
Into the ROI, preliminary traffic lights candidate region in ROI is obtained;
Using a certain threshold value to the image binaryzation after noise reduction, which is after binaryzation as much as possible by institute
The gray value for having traffic lights region is 255, other regions are set to 0;Non- traffic lights region is further excluded, it is final to select
Taking gray value is that 255 region contour is mapped in ROI, obtains preliminary traffic lights candidate region.
Step S314 obtains R channel value, G channel value and the channel B value side of the preliminary traffic lights candidate region
The variance of R channel value, G channel value and channel B value in the preliminary traffic lights candidate region is greater than or equal to and corresponds to by difference
The region of preset threshold is as traffic lights secondary in ROI candidate region;
For fixed threshold bring background interference, such as highlighted background, street lamp and some inclined white light sources.We utilize
Biggish variance is presented in the attribute of traffic lights inherently, i.e. traffic lights three channels in rgb space, but right
RGB triple channel variance is less than normal for background and other inclined white light sources.And then most of highlighted background can be filtered, it is partially white
Light source obtains secondary traffic lights candidate region to further reduce candidate region range.
Step S315 carries out closed operation to the corresponding ROI two-value graph region in the secondary traffic lights candidate region, obtains
Secondary traffic lights candidate region binary map after obtaining closed operation;
Step S316 carries out profile screening to the secondary traffic lights candidate region binary map after the closed operation, will
Profile after screening is mapped in ROI, obtains the final candidate region of traffic lights, and by the final candidate region of traffic lights
As traffic signals candidate region.
Morphologic closed operation (first expanding post-etching) is carried out to the binary map of secondary traffic lights candidate region, in this way
Uneven, fixed threshold binaryzation meeting that the purpose done is that traffic lights itself will appear itself light emission luminance under natural scene
Light emitting region is allowed discontinuous aperture, gap etc. occur.Such consideration is based on using closed operation, by light emitting region two-value
The fritter of figure missing in turn ensures the original shape invariance in light emitting region while making up.
Traffic lights itself have certain characteristic, the size including traffic signals lamp profile, traffic lights
The length-width ratio of profile and the radius of traffic signals lamp profile.Using the inherent characteristic of traffic signals lamp profile itself, to profile
Area, length-width ratio and radius respectively preset a range, to the secondary traffic lights candidate region two after the closed operation
Profile in value figure is screened, and contour area, length-width ratio and the radius of detection are all in corresponding area in default range
Domain is as the final candidate region of traffic lights, and by the candidate region as traffic signals.
The present embodiment is by the color, shape, size characteristic based on RGB color and traffic lights, to selection
ROI successively carry out gray processing, noise reduction, RGB channel value variance, binaryzation, closed operation and edge analysis, obtain traffic candidate regions
Domain, so that traffic signals area to be tested is constantly reduced, it is final to obtain traffic signals candidate region, reduce subsequent identification pair
As number, and by the variance of the R, G, channel B value that calculate traffic candidate region, to reduce the influence of illumination, thus while not having
There is the scheme using the similar prior art, but the present embodiment still is able to accelerate entire traffic while reducing illumination effect
Signal identification process and the Stability and veracity for reinforcing identification.
Further, referring to Fig. 4, the first embodiment based on the application traffic signals recognition methods proposes the application traffic
The 3rd embodiment of signal recognition method, in the present embodiment, the step S30 includes:
Step S321, when traffic signals are traffic prohibitory sign, using normalization algorithm to the RGB channel value of ROI into
Row processing, RGB channel value after being normalized;
Step S322, at the difference and normalization in the RGB channel value after obtaining normalized between any two channel values
The difference of the ratio obtained in ROI and any two channel values is at correspondence by the ratio after reason between R channel value and G channel value
Preset range in the gray value in region be set as 255, the gray value in other regions is set as 0, to obtain ROI two-value
Figure;
Common prohibitory sign and speed(-)limit sign primary color are red in traffic prohibitory sign, are found by experimental analysis,
Under different brightness, within the scope of the difference of red corresponding three classification is limited to centainly, according to this distribution of color
ROI is normalized in feature:
Each channel components value r, g, b after being normalized;Difference and r and g are carried out to any two channel components values again
Ratio;Selection meets region corresponding to r, g, b of r-g>0.07&r-b>0.07&g-b<0.12&r/g>1.4, by these areas
The gray value in domain is set as 255, and the gray value in other regions is set as 0, obtains ROI binary map.It is white in ROI binary map
Region (i.e. gray value be 255 region) primary color in ROI original image be it is red, black region is in ROI original in ROI binary map
Color is non-red in figure, to distinguish, red is main region in ROI and non-red is main region.
Step S323 carries out noise reduction to ROI binary map, the ROI binary map after obtaining noise reduction;
Step S324 carries out opening operation to the ROI binary map after noise reduction, obtains ROI binary map after opening operation;
It is (first rotten that morphologic opening operation is carried out to the preliminary traffic prohibitory sign candidate region binary map after the closed operation
Expanded after erosion), the purpose for the arrangement is that will appear self color under natural scene uneven for traffic prohibitory sign itself, it is fixed
Threshold binarization can allow ROI binary map discontinuous aperture, gap etc. occur.Such consideration is based on using opening operation,
Original shape invariance is in turn ensured while the fritter that ROI binary map lacks is made up.Corrosion can make target area
Range " becomes smaller ", and essence causes the boundary contraction of image, can be used to eliminate small and meaningless object;Expansion can make mesh
It marks regional scope " becoming larger ", will be merged into the object in the background dot that target area contacts, expand object boundary to outside
?.Effect just can be used to fill up certain cavities and elimination in target area and make an uproar comprising little particle in the target area
Sound.
Step S325 carries out profile screening to ROI binary map after opening operation, the profile after screening is mapped in ROI, is obtained
Traffic prohibitory sign candidate region is obtained, and using traffic prohibitory sign candidate region as traffic signals candidate region.
Traffic prohibitory sign itself has certain characteristic, the size including traffic prohibitory sign profile, and traffic is prohibited
Enable the length-width ratio of mark profile and the radius of traffic prohibitory sign profile.Utilize the intrinsic spy of traffic prohibitory sign profile itself
Property, a range is preset respectively to the area of profile, length-width ratio and radius, to the wheel in the ROI binary map after the opening operation
Exterior feature is screened, and contour area, length-width ratio and the radius of detection are all in corresponding region in default range as traffic
Prohibitory sign candidate region, and by the candidate region as traffic signals.
The present embodiment is by the color, shape, size characteristic based on RGB color and traffic lights, to selection
ROI successively carry out color segmentation, binaryzation, noise reduction, opening operation and edge analysis, traffic candidate region is obtained, thus constantly
Diminution traffic signals area to be tested, it is final to obtain traffic signals candidate region, reduce subsequent identification object number, thus
Accelerate entire traffic signals identification process.
Further, referring to Fig. 5, the first embodiment based on the application traffic signals recognition methods proposes the application traffic
The fourth embodiment of signal recognition method, in the present embodiment, the step S40 includes:
Step S411 extracts the HOG feature of the traffic signals candidate region when traffic signals are traffic lights,
The HOG feature of extraction is inputted in the first default SVM, to classify to the traffic signals candidate region, to obtain institute
State the traffic lights light emitting region in traffic signals candidate region;
Experiment shows that, by a series of screening operation before, traffic lights candidate light emitting region sample presents certain
Similitude, negative sample are concentrated mainly on public transport tail-light, highlighted light emitting region, the light emitting regions such as night city yellow street lamp.
By extracting the HOG feature of the luminous candidate region of traffic lights, judge that traffic is believed with two classification method of support vector machines
Whether the otherness of signal lamp edge gradient signal and negative sample is traffic lights light emitting region to traffic lights candidate region
Confirmed;To exclude the public transport tail-light in traffic lights candidate region, highlighted light emitting region, night city yellow
The light emitting regions such as street lamp.
Step S412 is distributed according to default traffic light color rule to traffic lights light emitting region carry out area
Domain extends, and obtains traffic signals light panel candidate region;
Step S413 extracts the HOG feature of traffic signals light panel candidate region, which is input to
In two default SVM, to classify to traffic signals light panel candidate region, to obtain traffic lights panel area
Domain;
Confirmation of the SVM to traffic lights candidate region is preset by traffic lights first, is accurately handed over
Ventilating signal lamp light emitting region even if the first default SVM can guarantee 98% accuracy rate, but brings largely video flowing
Traffic lights light emitting region, this still remains a certain number of erroneous detections.Therefore we are embedded in black using traffic lights
The brass tacks of panel frame, we take the second default SVM to confirm traffic signals light panel region.First default SVM is obtained
The traffic lights light emitting region arrived is distributed according to traffic light color rule carries out region extension, obtains traffic lights face
Plate candidate region.By the positive negative sample in artificial screening traffic signals light panel candidate region, the office of traffic signals light panel is extracted
Portion's HOG feature does two classification to positive negative sample using supporting vector, to exclude rainbow in traffic signals light panel candidate region
Lamp, red light signboard etc. are not belonging to the region of traffic lights, to obtain traffic signals light panel region.
The traffic signals light panel region is mapped to the corresponding band of position in the ROI and is input to by step S414
In KCF multiple target tracking device, the output result of KCF multiple target tracking device is obtained;
The output result is input in targets manager, obtains the traffic signals light panel region by step S415
Location information;
Traffic lights detection is the image partition method based on traffic lights light emission luminance, this is past under complex environment
Toward not robustness can be presented, i.e., the next frame that previous frame detects may can't detect, in addition time-consuming brought by detection frame by frame
The real-time of system can be seriously affected, therefore multiple target tracking algorithm is added can largely to compensate for not connecting for detection
Continuous property, the high efficiency and real-time of KCF itself had not only improved the robustness of system but also had accelerated the speed of service of system.KCF is more
Target following is one kind typically based on the tracking of discriminate, the ridge regression of its core, the approximation of cyclic shift
Intensive sampling not only ensure that the speed of service but also have good effect.
Multiobjective management is screened to the result of KCF multiple target tracking device output, main according to spatial position, area
Etc. priori knowledges, finally will meet objective law target frame output, greatly ensure that traffic lights tracking accuracy rate.
Step S416 extracts location information described in the ROI according to the traffic signals light panel region location information
HOG feature, R channel value, G channel value and the channel B value of corresponding region;
Step S417 inputs the HOG feature of the location information corresponding region, R channel value, G channel value and channel B value
Third is preset in SVM, to identify traffic lights direction and color.
Traffic lights identification mainly includes the identification of traffic light color and traffic lights shape.Traffic lights
Color is identified by statistics traffic signals light panel region maximum value of R, G, B triple channel under RGB color.Test table
Bright, this statistical pixel is worth method identification traffic light color more stable, and required time is short.
Traffic lights shape recognition, by highlighting traffic signals light panel region binaryzation traffic lights and shining
The profile information in region.Traffic lights shape shines traffic lights profile and master die there are the Template Information of standard
Plate carries out template matching.Experiment shows to carry out traffic lights shape recognition with template matching, not only efficiently but also accurate.
The present embodiment carries out classifier screening by the histogram Gradient Features (HOG) of image and the more mesh of KCF is utilized
It marks tracker and carries out target following, do not need frame by frame and remove detection traffic lights, so that traffic lights identification both ensure that
Accuracy improves the speed of service, in turn ensures the stability and robustness of traffic lights identification, and the traffic that will identify that
Signal content is by showing vehicle-mounted computer, mobile phone or tablet computer or voice broadcast form informing driver in the car.
Further, referring to Fig. 6, the first embodiment based on the application traffic signals recognition methods proposes the application traffic
5th embodiment of signal recognition method, in the present embodiment, the step S40 further include:
Step S421, when traffic signals are traffic prohibitory sign, the HOG for extracting the traffic signals candidate region is special
Sign inputs the HOG feature in first order SVM, obtains traffic prohibitory sign and identifies candidate region for the first time;
The method of traditional detection circle is Hough loop truss, but in certain practical application scenes, such as: turn in vehicle
In curved process, traffic prohibitory sign is in ellipse in the ken;Or traffic prohibitory sign part is by branch, the barriers such as vehicle
It blocks;Or traffic prohibitory sign, there are the deflection of slight extent, damage and other other traffic prohibitory signs are not rounded
In the case where, traffic prohibitory sign can not be detected using Hough circle detection method.
Hough loop truss is replaced using the method for SVM identification circle, training sample is divided into single circle, two circles and three circles
In a connected region.Traffic prohibitory sign candidate region HOG feature is input to the first preset SVM, the HOG is special
The sample pattern HOG Characteristic Contrast for the foundation sought peace in the first preset SVM, so that Dan Yuan, two and multiple circles are in same company
The case where logical region, all identifies, then is split into single traffic prohibitory sign to two round and multiple circles, finally obtains
It obtains traffic prohibitory sign and identifies candidate region for the first time.
Step S422 extracts the HOG feature that the traffic prohibitory sign identifies candidate region for the first time, by the traffic ban
The HOG feature of the first identification candidate region of mark is input in the SVM of the second level, obtains the secondary identification region of traffic prohibitory sign;
Step S423 extracts the HOG feature of the secondary identification region of traffic prohibitory sign, which is input to
In third level SVM, traffic prohibitory sign is identified.
Second level SVM identifies that traffic prohibitory sign identifies that candidate region is specially common prohibitory sign, non-mark for the first time
Board and speed(-)limit sign, it includes common prohibitory sign board classifier and speed(-)limit sign board classifier that the third, which presets SVM, when second
When grade SVM identifies that traffic prohibitory sign identifies that candidate region is specially common prohibitory sign for the first time, preset in SVM using third
Common prohibitory sign board classifier carry out semantics recognition, to identify which specifically belongs in common prohibitory sign board
Traffic prohibitory sign, such as no parking, No entry;When the second level, SVM identifies that traffic prohibitory sign identifies candidate for the first time
When region is specially speed(-)limit sign, the speed(-)limit sign board classifier in SVM is preset using third and carries out semantics recognition, to identify
Specific speed limit speed out, such as speed limit 60.
The present embodiment, will be described by the way that the HOG feature of traffic prohibitory sign candidate region to be input in preset SVM
The HOG feature of the disaggregated model created in HOG feature and default SVM compares, and judges the class that the HOG feature belongs to
Type;It is identified by different preset SVM, finally identifies the interior of the traffic prohibitory sign in traffic prohibitory sign candidate region
Hold;The traffic prohibitory sign content that will identify that is by display vehicle-mounted computer in the car, mobile phone or tablet computer or language
Sound broadcasts form and informs driver.
The present invention also provides a kind of traffic signals identifying systems.
It is the functional block diagram of one embodiment of traffic signals identifying system of the present invention referring to Fig. 7, Fig. 7.
In a real-time example, the system comprises: it obtains image module 100, extract ROI module 200, image preprocessing mould
Block 300, identification module 400.
Image module 100 is obtained, for obtaining the road scene image of camera captured in real-time;
ROI module 200 is extracted, for extracting region of interest ROI in road scene image;
Image pre-processing module 300 is handled ROI, for being based on RGB color to obtain traffic signals time
Favored area;
Identification module 400 for the histograms of oriented gradients HOG feature by the traffic signals candidate region and is preset
Support vector machines identify traffic signals.
Further, in another embodiment, when the traffic signals are traffic lights, described image pre-processes mould
Block includes:
Noise reduction unit carries out at noise reduction for obtaining ROI grayscale image to ROI gray processing, and to the ROI grayscale image
Reason, to obtain the ROI grayscale image after noise reduction;
Binarization unit obtains ROI binary map for carrying out binaryzation to the ROI grayscale image after noise reduction;
Map unit, for choosing all areas profile that gray value is 255 in ROI binary map, by the region contour
It is mapped in the ROI, obtains preliminary traffic lights candidate region in ROI;
Computing unit, the variance of the three R channel value GB for obtaining the preliminary traffic lights candidate region will be described
The variance of three R channel value GB channel values is greater than or equal to the region conduct of preset threshold in preliminary traffic lights candidate region
Secondary traffic lights candidate region in ROI;
Closed operation unit, for being closed to the corresponding ROI two-value graph region in the secondary traffic lights candidate region
Operation, the secondary traffic lights candidate region binary map after obtaining closed operation;
Screening unit, for carrying out profile sieve to the secondary traffic lights candidate region binary map after the closed operation
Choosing, the profile after screening is mapped in ROI, obtains the final candidate region of traffic lights, and traffic lights are finally waited
Favored area is as traffic signals candidate region.
Further, in another embodiment, when traffic signals are traffic prohibitory signs, described image preprocessing module
Include:
Color segmentation unit, for carrying out color segmentation to ROI, to obtain the binary map of ROI;
Noise reduction unit, for carrying out noise reduction to ROI binary map, the ROI binary map after obtaining noise reduction;
Opening operation unit obtains ROI binary map after opening operation for carrying out opening operation to the ROI binary map after noise reduction;
Profile after screening is mapped to ROI for carrying out profile screening to ROI binary map after opening operation by screening unit
In, traffic prohibitory sign candidate region is obtained, and using traffic prohibitory sign candidate region as traffic signals candidate region.
Further, in another embodiment, the color segmentation unit includes:
Normalized subelement obtains normalizing for handling using normalization algorithm the RGB channel value of ROI
RGB channel value after change processing;
Computation subunit, for obtaining the difference in the RGB channel value after normalized between any two channel values and returning
Ratio after one change processing between R channel value and G channel value, the difference of the ratio obtained in ROI and any two channel values is all located
The gray value in the region in corresponding preset range is set as 255, and the gray value in other regions is set as 0, to obtain ROI
Binary map.
Further, in another embodiment, the default SVM includes the first default SVM, the second default SVM and the
Three default SVM;When traffic signals are traffic lights, the identification module includes:
Extraction unit, for extracting the HOG feature of the traffic signals candidate region, by the HOG feature of extraction input the
In one default SVM, to classify to the traffic signals candidate region, to obtain in the traffic signals candidate region
Traffic lights light emitting region;
Extension apparatus, for according to preset traffic light color rule distribution to the traffic lights light emitting region into
Row region extends, and obtains traffic signals light panel candidate region;
The extraction unit is also used to extract the HOG feature of traffic signals light panel candidate region, by HOG spy
Sign is input in the second default SVM, to classify to traffic signals light panel candidate region, to obtain traffic signals
Light panel region;
Real-time tracking unit, for presetting SVM knowledge to the traffic signals light panel region real-time tracking, and by third
Other traffic lights.
Further, in another embodiment, the real-time tracking unit includes:
Target following subelement, for the traffic signals light panel region to be mapped to corresponding position in the ROI
Region is input in KCF multiple target tracking device, obtains the output result of KCF multiple target tracking device;
Objective management subelement obtains the traffic signals for the output result to be input in targets manager
Light panel region location information;
Subelement is extracted, for extracting position described in the ROI according to the traffic signals light panel region location information
HOG feature, R channel value, G channel value and the channel B value of confidence breath corresponding region;
Subelement is identified, for by the HOG feature of the location information corresponding region, R channel value, G channel value and channel B
Value input third is preset in SVM, to identify traffic lights direction and color.
Further, in another embodiment, the default SVM includes the first default SVM, the second default SVM and the
Three default SVM;When traffic signals are traffic prohibitory sign, the identification module includes:
The HOG feature is inputted first for extracting the HOG feature of the traffic signals candidate region by extraction unit
In grade SVM, obtains traffic prohibitory sign and identify candidate region for the first time;
Recognition unit identifies the HOG feature of candidate region for extracting the traffic prohibitory sign for the first time, by the traffic
Prohibitory sign identifies that the HOG feature of candidate region is input in the SVM of the second level for the first time, obtains the secondary cog region of traffic prohibitory sign
Domain;
The recognition unit is also used to extract the HOG feature of the secondary identification region of traffic prohibitory sign, by the HOG
Feature is input in third level SVM, identifies traffic prohibitory sign.
The application also provides a kind of traffic signals identification equipment, and in one embodiment, the equipment includes communication module, deposits
Reservoir and processor, wherein the processor is connect with the memory, is stored with computer program on the memory.Institute
The computer program stored in memory can be called by stating processor, be realized such as traffic signals recognition methods in above-described embodiment
Overall Steps.
The present invention also proposes a kind of computer readable storage medium, is stored thereon with traffic signals recognizer, the friendship
The Overall Steps of the traffic signals recognition methods as described in above-described embodiment are realized when messenger recognizer is executed by processor.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are with so that traffic signals identification equipment executes this hair
Method described in bright each embodiment.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.