Search

CN-122024207-A - Traffic signal lamp identification method based on multiple features

CN122024207ACN 122024207 ACN122024207 ACN 122024207ACN-122024207-A

Abstract

The invention discloses a traffic signal lamp identification method based on multiple features, which comprises the following steps of A, obtaining an image to be identified, B, extracting an image area in the image a through regionprops functions in matlab software to obtain an image area b, C, extracting color distance features of the image a in the image area b to obtain color distance features c, D, processing the image a to obtain a gray scale image of the image a, and then obtaining texture features of the gray scale image through convolution of Gabor kernel function and Fourier transformation to obtain texture features d, E, identifying the color distribution form and texture frequency of the image area b by taking the color distance features c and the texture features d as basis to obtain an identification result. The invention can reduce the identification range of the image area and improve the identification accuracy of the traffic signal lamp.

Inventors

  • LI YICUN
  • LI DAPENG
  • ZHONG BINGDA
  • WANG HONGDA
  • WANG YANQI

Assignees

  • 浙大城市学院
  • 杭州目博科技有限公司
  • 杭州伊园科技有限公司

Dates

Publication Date
20260512
Application Date
20260408

Claims (10)

  1. 1. The traffic signal lamp identification method based on the multiple characteristics is characterized by comprising the following steps of: A. acquiring an image to be identified to obtain an image a; B. Extracting an image area in the image a based on the saturation and brightness values of pixels in the image a through regionprops functions in matlab software, wherein the image area comprises an area, a centroid and a boundary box, and obtaining an image area b; C. Extracting color distance features of the image a in the image b region, wherein the color distance features are color distance feature vectors of 1 x 9N, and obtaining color distance features c; D. processing the image a to obtain a gray level image of the image a, and then obtaining texture features of an image area b in the gray level image through convolution of Gabor kernel function and Fourier transform, wherein the texture features are Gabor texture feature vectors of 1 x 2MK, so as to obtain d texture features; E. and identifying the color distribution form and the texture frequency of the b image area by taking the c color distance feature and the d texture feature as the basis, wherein the c color distance feature is used for displaying the color distribution form of the pixels in the b image area, and the d texture feature is used for displaying the texture frequency of the pixels in the b image area, so as to obtain an identification result.
  2. 2. The method for identifying traffic lights based on multiple features according to claim 1, wherein said step B specifically comprises the steps of: B1. converting the image a into an hsv color space to obtain an image a1 color space; B2. Separating hue channels in the a1 color space image, and performing median filtering treatment on saturation channels and brightness channels in the a1 color space image to obtain an a2 color space image; B3. Extracting pixels in the a2 color space image according to the set saturation condition and brightness condition, so that pixels meeting the saturation condition and brightness condition are marked as white, and pixels not meeting the saturation condition are marked as black, thus obtaining an a3 binary image; B4. Extracting a graph area in the a3 binary image through regionprops functions in matlab software, wherein the graph area comprises an area, a centroid and a boundary box, the area describes the actual pixel number of the graph area, the centroid describes the centroid of the graph area, and the boundary box describes a rectangle circumscribing the graph area to obtain the b image area.
  3. 3. The method for identifying traffic lights based on multiple features according to claim 1, wherein said step C specifically comprises the steps of: C1. dividing the b image area into N grid intervals according to the set grid size to obtain N b1 grid intervals; C2. Calculating first-order color moment, second-order color moment and third-order color moment of the image in each b1 grid interval in three RGB channels, so as to obtain a 9*N characteristic value and obtain a b2 characteristic value; C3. and integrating the characteristic values of b2 to form a color distance characteristic vector of 1x 9N, and obtaining a c color distance characteristic.
  4. 4. The traffic light recognition method based on multiple features according to claim 1, wherein the specific steps of step D are as follows: D1. carrying out graying treatment on the image a to obtain a c1 gray scale image; D2. presetting and generating a Gabor kernel function to obtain a c2 kernel function value; D3. performing two-dimensional Fourier transform on the c2 kernel function value, performing two-dimensional Fourier transform on the c1 gray scale image, and then convolving the two to obtain a c3 convolution value; D4. performing inverse conversion on the c3 convolution value, and performing modulo extraction on the inverse conversion result to obtain c4 modulo values of the c1 gray scale map at different pixel points; D5. According to the set grid size, carrying out grid division on the b image area, so that the b image area is divided into M grid intervals to obtain M c5 grid intervals; D6. Calculating the mean value of c4 module values of different pixel points in each c5 grid interval, and simultaneously calculating the standard deviation of the c4 module values of different pixel points in each c5 grid interval to obtain M c6 mean value vectors and M c7 standard deviation vectors; D7. Repeatedly calculating c6 mean vectors and c7 standard deviation vectors of the K times of c1 gray maps according to the steps D1-D6, and changing the scale parameters of the Gabor kernel function during each calculation to obtain M x K c6 mean vectors and M x K c7 standard deviation vectors; D8. And splicing M x K c6 mean vectors and M x K c7 standard deviation vectors to form Gabor texture feature vectors of 1 x 2MK, so as to obtain d texture features.
  5. 5. The traffic light recognition method based on multiple features according to claim 1, wherein in the step E, the c color distance feature and the d texture feature are imported into a trained SVM model for recognition, and a recognition result is obtained.
  6. 6. The multi-feature based traffic light recognition method according to claim 5, wherein the training method of the SVM model specifically comprises the following steps: E11. Collecting images of a plurality of traffic lights, classifying the images, wherein each classification corresponds to a label value, and an e11 image is obtained; E12. extracting color distance features and texture features of each e11 image, and combining to obtain feature vectors of the e11 images to obtain e12 feature vectors; E13. Combining the e12 feature vectors of the e11 images to obtain an e13 feature matrix; E14. And training the SVM model based on the e13 feature matrix and the label value to obtain the trained SVM model.
  7. 7. The method for identifying traffic signals based on multiple features according to claim 6, wherein the types of the traffic signals in the step E11 are classified into interference, red-right, red-left, red-light, green-upper, green-right, green-left, green-light, yellow-upper, yellow-right, huang Zuo and yellow-light, and the images corresponding to the types of the interference are non-traffic signal images.
  8. 8. The traffic light identification method based on the multiple features is characterized by comprising the specific steps of classifying traffic lights, and identifying the corresponding traffic light type based on the c color distance feature and the d texture feature through a trained bagging algorithm to obtain an identification result.
  9. 9. The traffic light recognition method based on multiple features according to claim 8, wherein the training mode of the bagging algorithm is specifically as follows: E21. Combining the color distance features and the texture features to serve as sample features, and randomly selecting a plurality of repeatable sample features to form a training set Then for training set Evaluating sample characteristics in the model, and selecting a plurality of optimal sample characteristics to form an optimal characteristic subset Obtaining e21 optimal feature subsets; E22. Set Nt basic learning device Each base learner Taking the e21 optimal feature subset as a sample for classification training to obtain Nt e22 base classifiers; E23. Classifying the c color distance features and the d texture features by using Nt e22 base classifiers, and then selecting the classification result with the largest occurrence number as the recognition result of the bagging algorithm.
  10. 10. The method for identifying traffic signals based on multiple features according to claim 9, wherein the optimal feature subset in step E21 The selection method of (a) specifically comprises the following steps: E211. training set For a collection of sample features Initial selected feature subset Dividing the training set obtained by random resampling into training subsets And verify subset ; E212. Base learner in select and step E22 The same model is used as a base model, the sample features are iteratively screened by the base model, the iteration number is set as k, and if the current selected feature subset Equal to training set Then the selected feature subset Terminating the iteration as the optimal feature subset to be selected, if the feature subset is currently selected Is not equal to training set Step E213 is entered; E213. traversing all unselected feature sets Each unselected sample feature is compared with a selected feature subset Combining to form temporary feature set, training the subset Taking the temporary feature set as an input feature to train a base model as a sample, and verifying the subset Calculating performance index values of the base model, thereby completing independent evaluation of all unselected sample characteristics; E214. Selecting sample features which can enable the performance index value of the temporary feature set corresponding to the base model to reach the optimal value from all the unselected sample features, and adding the sample features into the currently selected feature subset Obtaining updated selected feature subsets ; E215. Setting a performance boost threshold Computing updated selected feature subsets Performance index values corresponding to the base model and feature subsets before update A difference value of the performance index values corresponding to the base model, if the difference value is smaller than a preset performance improvement threshold value The pre-update selected feature subset is then used As an optimal feature subset Terminating the iteration if the difference is not less than the performance improvement threshold Order-making The process returns to step E212 to continue execution.

Description

Traffic signal lamp identification method based on multiple features Technical Field The invention relates to a traffic signal lamp identification method, in particular to a traffic signal lamp identification method based on multiple characteristics. Background At present, an unmanned inspection trolley for a roadside parking charging system needs to inspect according to a specified inspection route in the working process, so that vehicle information and parking time on a roadside parking space are identified and recorded. The inspection route often covers occasions with traffic lights such as intersections, so that the inspection trolley needs to have the identification function of the traffic lights, and the safety and the standardization of the inspection trolley in the inspection process are ensured. On the basis, the existing method for identifying the traffic signal lamp by the unmanned trolley is to identify the colors and the shapes of different areas in the image, so that the image area with a specific hue and shape is judged to be the traffic signal lamp, and the traffic signal lamp is identified. As shown in patent 201510208977.7, the color features and HOG features in the image are extracted, and then the SVM model identifies corresponding traffic light information based on the two features. However, the defect of the identification mode is that the mode only focuses on the colors and the edge shapes of different areas in the image, so that misjudgment is easily caused when the mode identifies the image with partial colors and edge shapes close to the traffic signal lamp, for example, red arrow patterns appearing in roadside billboards, and red round marks on buildings, red round tail lamps at the tail parts of vehicles and the like are easily misjudged as the traffic signal lamp. Or when the traffic signal lamp is shielded by external objects such as branches, wires, billboards and the like at the edge position, and when the traffic signal lamp is deformed due to lens distortion, the traffic signal lamp is easily misjudged as not being the traffic signal lamp due to the dissimilarity of the graph shape. In addition, in order to reduce the recognition range and the recognition difficulty of the image and reduce the possibility of false judgment, the method also limits the height range of the traffic signal lamp area in the image, namely the image area which is not in the set height range is considered to have a low possibility of having the traffic signal lamp, and the subsequent recognition is not performed. However, this setting mode is relatively crude, and once the situation that the position of the traffic signal area in the image is not high or the actual installation position of the specific traffic signal is low due to lens conversion occurs, the identification mode is completely disabled. If the limitation on the identification range is eliminated, the difficulty and accuracy of identifying the traffic light area in the image are increased, and the reason is that the ratio of the traffic light area in the whole image is very small and the ratio of the traffic light area in part of the image is even less than 1/100 in the image shot by the unmanned inspection trolley. On the basis, if the color and shape recognition is performed on the basis of the whole picture, a large number of interference patterns with obvious color boundaries in the image are required to be distinguished, so that the workload of the model and the possibility of misjudgment are greatly increased. Therefore, the existing traffic signal lamp identification method has the problems of large workload and low identification accuracy. Disclosure of Invention The invention aims to provide a traffic signal lamp identification method based on multiple characteristics. The method can reduce the identification range of the image area and improve the identification accuracy of the traffic signal lamp. The technical scheme of the invention is that the traffic signal lamp identification method based on multiple characteristics comprises the following steps: A. acquiring an image to be identified to obtain an image a; B. Extracting an image area in the image a based on the saturation and brightness values of pixels in the image a through regionprops functions in matlab software, wherein the image area comprises an area, a centroid and a boundary box, and obtaining an image area b; C. Extracting color distance features of the image a in the image b region, wherein the color distance features are color distance feature vectors of 1 x 9N, and obtaining color distance features c; D. processing the image a to obtain a gray level image of the image a, and then obtaining texture features of an image area b in the gray level image through convolution of Gabor kernel function and Fourier transform, wherein the texture features are Gabor texture feature vectors of 1 x 2MK, so as to obtain d texture features; E. and identifying the color dist