| With the development of China’s economy and the progress of manufacturing,the number of cars owned is increasing year by year.Consistently,the rate of traffic accidents also increased with each passing year.To further ensure safety and prevent traffic accidents,it is urgent to explore vehicle detection and distance measurement technologies that can enhance the safety and reliability of driving.To ensure that drivers can sense the distance of vehicles in front of them in time and effectively maintain a safe distance,this paper studies the vehicle detection algorithm and vehicle ranging algorithm based on YOLOv4-tiny.To address the shortcomings of the YOLOv4-tiny algorithm in traffic scene detection,this paper designs a YOLOv4-tiny-based Squeeze-and-Excitation Path Aggregation Tiny Network(SEPATNet)vehicle detection algorithm avoids high false detection rate and poor detection capability of small targets at long distances.By augmenting the output feature layer,introducing an attention mechanism,redesigning the backbone network,the aim is to quickly locate the area to which the target belongs.In terms of feature fusion,the path aggregation network is used to enhance the fusion of shallow detail information with deeper features,further improving the detection algorithm’s ability to localize the detected targets in the image.Applying the adjusted augmented long-range small target with the vehicle detection dataset of nighttime driving scenario for training,it is found that the SEPATNet vehicle detection algorithm proposed in this paper achieves an average correct rate of 84.98% in traffic scenarios,an improvement of 8.89% compared to the YOLOv4-tiny algorithm,and a detection speed of 84 fps,which can fully satisfy the task of vehicle detection.The distance measurement algorithm based on license plate detection has a high accuracy at close range,but the accuracy at long range decreases and is prone to range failure;the landing point distance measurement algorithm is prone to inaccurate positioning due to occlusion,and the camera yaw angle affects the distance measurement accuracy.In this paper,we redesigned the full-attitude landing point coordinate ranging algorithm by considering the camera pitch angle and yaw angle and realized the cooperative ranging algorithm of license plate height positioning and full-attitude landing point coordinates.The experimental results show that with the detection results of the SEPATNet algorithm,the maximum error of the forward vehicle cooperative ranging algorithm in the range is 3.39% within100 meters,and the average error is 1.52%,which effectively guarantees the demand of ranging accuracy. |