| Road resource utilization can be maximized by realizing traffic light machine vision and real time traffic control according to real situation. The current problem is that the traffic light control system is usually time-fixed and static, the lights change by presetted period, but can't execute real-time control according to real situation, so noneffective waiting time is increased and road resources are wasted.Background subtraction method is an effective way to realize machine vision: after the background is extracted successfully, the foreground information (eg. vehicle, people) is extracted by subtracting the background picture from the current picture, and then the system processes the foreground information to judge the real traffic situation, at last the traffic light is switched by real time, and road resource utilization is maximized.This paper is based on engineering application, and analyses the common problems of background subtraction methods, and makes improvement. It focuses on the algorithm of background subtraction, environment light change interference restraining, and tree waving interference restraining. The main jobs are:(1) Getting background and updating, an algorithm is designed to choose the grayscale with maximum quantity as the background grayscale. By calculation of actual traffic pictures, at peak time (vehicle speed is about 20kmh, vehicle distance is about 10m, 1 vehicle passes by every 3s in average), 233 picture frames are calculated within about 18s sampling period, and the correct background grayscale value 139 is got. At non peak time, this algorithm will have a even better result.(2) Environment light change, a computing strategy is designed as follows, the whole scene is divided into non traffic area and traffic area, because the grayscale of the non traffic area won't change greatly, if the grayscale of the whole scene changed, it should be caused by evironment light change, the grayscale change of non traffic area can be used as reference for evironment light change, to calculate the average of the change percent of all the pixels in non traffic area, and multiply the background pixel grayscale in traffic area one by one by this average, the calculated background picture can be got. By calculation of actual traffic pictures, when evironment light change is about 17%, after calculation, the error of the single pixel (335, 175) is reduced from 17% to 0.04%, and in the whole traffic area, the percentage of pixels with error within±5% was 0.10%, after the calculation, it's increased to 90.54%, it's a good result to reduce sudden great environment light change.(3) Tree waving, a computing strategy to calculate and compare the grayscale sum of the changed area is designed, if it's less than the threshold value, it's the tree waving, otherwise it's a traffic object change. By calculation of actual traffic pictures, a tree waving area is chosen, the grayscale sum of the 28800 pixels of the current frame in this area is 3257028, and it's 3253350 after some time, the variance is -0.11%, it's a small change, so it's caused by tree waving or something like this, the influence on traffic scene judgement is removed.The algorithms above go through system emulation and testing, and get good results. They're feasible for engineering application. |