The objective of this research work is to calculate the vehicle density of cities through the use of computer vision. To carry out the study, we captured videos of vehicular traffic at 8 intersections in the city of Loja using a drone and a high-resolution camera. Subsequently, we used the Python language and the YOLOv8 library to count vehicles of different categories, such as small vehicles, trucks, and motorcycles. Through mathematical formulas used in transportation engineering, the values of vehicle density, vehicle flow rate, and average spacing were obtained. As results, we have that the machine learning model using YOLOv8 has an accuracy of 90% in detecting and classifying vehicles, and thanks to its use, the road with the highest vehicle density was identified. The practical applications of this work could improve vehicle flow and help competent organizations related to traffic management make decisions.
Read full abstract