| With the increase in the number of vehicles,which brings convenience to people,but the incidence of vehicle accidents has also increased year by year.Therefore,the safety of vehicles has become more and more important.Active safety has played an important role in improving the safety of vehicle driving.And the active safety of the car must detect the surrounding environment.The most important of which is the detection,positioning,and early warning of the vehicle in front.Currently,lidars and camera sensors are mainly used in vehicle detection.Because lidars are too expensive,but the cameras have the advantages of low cost and can detect rich information.Therefore,this article chooses a monocular camera as the data acquisition device.The main content of this article is as follows:(1)This article first uses lane detection methods to provide road information for vehicles.Because of the characteristics that are strongly affected by strong light and shadow during lane line detection,the integral map method is used for image binarization.The skeleton extraction method is used to reduce the number of corner points.The randomness of the RANSAC calculation method in the lane line fitting process was limited and the outer points were deleted.Experimental results show that the method has good robustness and real-time performance.(2)To accurately detect ahead vehicle and provide reliable information for the vehicle’s active safety system,this article uses a deep learning network with strong feature extraction capabilities to extract vehicle features in the Caffe framework and uses an SSD target detection network with better detection speed and detection accuracy to detect ahead vehicles.By evaluating the trained SSD network model,the model has higher detection accuracy and good real-time performance.For the phenomenon that the detection accuracy of vehicles nearer to the subject vehicle is greatly affected by shadows when backlighting.A method using HSV color space to select the color gamut and performing contrast enhancement in YCr Cb space is provided,which effectively improves the ability of the detection network to cope with such backlighting effects.(3)According to the characteristics of the small change in the center of the bounding box in two consecutive frames,the Hungarian algorithm is used to determine whether the vehicles appearing in the video are the same vehicle.To improve the accuracy of dynamic ranging during vehicle driving,the bounding box is filtered by the Kalman filter to reduce joggle and track the detected vehicle.In terms of monocular distance measurement,the initial distance is calculated based on the pixel distance between the bottom edge of the bounding box and the bottom edge of the image using the fitted distance measurement method.To resist the influence of pitch angle and road slope on monocular distance measurement,based on the principle of small hole imaging,the vehicle distance is corrected by using the characteristics of constant vehicle height,and the accuracy of the method is proved by experiments.Finally,using the frame difference method to calculate the relative speed of the ahead vehicle and the subject vehicle.Collision warning based on distance and relative speed. |