Distance Estimation Between Camera and Vehicles from an Image using YOLO and Machine Learning
Rattapoom Waranusast, Panomkhawn Riyamongkol, Pattanawadee Pattanathaburt · 2022 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC) · 2022
We have developed a device that can alert a motorcycle rider when other vehicles enter the rider's blind spot using a camera. This device is necessary for reducing the risk of motorcycling accidents. However, the camera-based approach from a single camera cannot determine the distance between the camera and the vehicles. This paper proposes an algorithm for estimating the distance between a camera and a vehicle from an image based on object detection and machine learning techniques. The algorithm starts with collecting vehicle images of different types and measuring their distances from the camera with a laser measuring device. Each vehicle in an image is then detected by the YOLO algorithm and results in locations bounding boxes. Twelve features are computed from the bounding boxes for machine learning algorithms to predict distance or classify ranges of distance. The experimental results found that when treating the inference as a regression problem or predicting the distance in meters, the lowest error was 0.47 m. for car images and 0.62 m. for motorcycle images. When treating the problem as a classification problem or classifying ranges of distance, the highest accuracy was 96.28% for car images and 94.57% for motorcycle images. Considering the performance with the ease of further development on a small computer in the developing device, it is found that the decision tree algorithm is suitable due to its high accuracy, ease of development, and computational speed.