1. A system implemented in a vehicle to detect a lead vehicle comprising: a camera which captures an image of the rear of the lead vehicle; and an image processing system that receives image data from the camera, the image processing system being implemented with an algorithm that includes a preprocessing layer, an image segmentation layer, and a detection layer to analyze the image data to determine the relative distance between the vehicle and the lead vehicle.