针对城市交通公交车辆视频检测问题,本文建立一种基于Adaboost算法和车窗颜色特征的公交车辆视频检测算法。首先采用前景检测方法寻找运动的车辆,这种方法是对经过滤波、膨胀的三帧差分法和经过滤波、阈值法去阴影、膨胀处理的混合高斯法这两种方法获取的前景进行"与"操作。并对前景检测算法中获取的运动车辆使用Adaboost算法和haar特征训练的分类器进行检测,将公交车辆和大客车车辆与其他小客车车辆进行分类。然后,考虑到公交车辆相对于大客车车辆,其车窗具有明显的用于标示公交线路等信息的特征颜色,采用canny算子边缘检测法,结合连通域处理进行车窗定位,将车窗区域转入HSV颜色空间,统计特征颜色像素占车窗总像素的比率,并与设定的阈值进行比较,若大于该阈值,则判断为公交车辆,否则为非公交车辆。在visual studio 2010和opencv测试平台上,对包含公交车辆的城市交通流视频进行实验,测试结果显示,本文的运动检测算法能较好地适应视频序列中的噪声,比单一的三帧差分或混合高斯法具有更高的鲁棒性,经测试大量包含公交车辆视频序列后获取的canny边缘检测及连通域阈值,能够让车窗定位的准确率达到95%以上,车窗特征颜色的识别算法能够有效、准确地区分公交车辆和大客车车辆,从而实现对公交车辆的检测和识别。
A bus video detection method for urban public transport is proposed based on AdaBoost algorithm and window color feature.Firstly,the foreground detection method is used to find the motion of vehicle.This method is the "and" operation of two methods:three frame difference method of filtering and expansion and the mixed Gauss method after filtering,threshold method to remove shadow and expansion processing,whcih classifies vehicles in motion detected by the foreground detection algorithm into public transport vehicles,buses and other passenger vehicles,using the Adaboost algorithm and Haar feature training classifie.Compared with the large bus,the window of a public transport vehicle has obvious color characteristics indicating the bus lines and other information.The edge detection of canny operator and connected domain processing are used to locate the windows,then transfer the windows area into HSV color space,count the ratio of characteristic color pixels from windows area,and compare the ratio with threshold that has been set.If the ratio is larger than threshold,then believe it is a public transport bus,otherwise it is not.The experiments are performed using the traffic flow video that contains bus in a city.Experimental results show that,motion detection algorithm in this article has better adaptation with noise from video sequence than Three-frame differencing method or Gaussian mixture model.The threshold of connected domain processing and canny operator from a lot of video sequence contains bus lead to window positioning accuracy rate of more than 95%.Algorithm of characteristic color of windows can distinguish bus and motor coach effectively and accurately.