Hi, I'm trying to solve the problem of vehicle speed detection (car, truck, bus, cycle...) using modern object detection.
It is quite easy to track objects with YOLO and estimate their speed in pixels.
But then, it's harder to convert this virtual speed to a real km/h speed. In a perfect setup, where the camera is filming the road from the side, one pixel = x meter on all the screen.
For this kind of setup, Ultralytics's `yolo solutions speed meter_per_pixel=0.013` suffices.
But most videos will be taken from a spot filming the road in a non-perpendicular direction.
This [video](https://youtu.be/uWP6UjDeZvY?feature=shared&t=522) suggests to build a matrix of pixel to meter conversion, and applies it to transform the virtual speed to the real one. It works, runs well on a cloud notebook.
But I find it quite cumbersome to have to estimate by hand this size matrix : I'm quite sure that algorithms could detect the size of the matrix automatically with better accuracy than I. Moreover, this would avoid making the algorithm dependent on this measurement step, enabling speed estimation from any angle with a simple smartphone's camera.
Speed detection is a lot more interesting if it can be measured from dynamic spots, to get a better overall survey of a neighborhood. And avoid vehicles to adapt to a costly definitive setup and alter the survey.
Did someone already solve this challenge ? Do you have any ideas ? Thanks !