With the rapid development of the economy, vehicles have become the primary mode of transportation in people's daily lives. Among the various types of car accidents, rear-end collisions are quite common. Installing a rear-facing camera on the back of a vehicle can provide valuable assistance to drivers, including collision warning systems. By incorporating rear-end detection, drivers no longer need to look behind them. This system can detect objects on the road when the car is traveling at speeds over 80 km/h on a highway. Once activated, the system pre-processes the camera image to identify objects within it. If another vehicle is less than ten feet away and traveling in the same lane, a beep will sound. This is achieved by determining the lane the vehicle is in, estimating the object's distance from the camera, and utilizing the YOLOv5 object detection algorithm. To address the issue of the YOLOv5 vehicle detection algorithm missing detections for small and dense objects in complicated situations, the YOLOv5 vehicle detection method has been developed. The third-order B-spline curve model and the canny edge detection method were employed to fit the lane lines. This method has strong flexibility and resilience, and can describe lane lines of various shapes. The distance can be approximated by considering the labeled region found in the video. An alarm will sound to alert the driver if the distance is less than 3 meters. This technology will eliminate the vehicle's rear blind spot, ensuring the driver's safety.