Using yolov3 & yolov4 weights objects are being detected from live video frame along with the measurement of the object from the camera without the support of any extra hardware device.
The formula for the distance estimation is mentioned as distancei = (2 x 3.14 x 180) ÷ (w + h x 360) x 1000 + 3. I have a counterexample in mind. Please let me know if I have made a mistake. Suppose you take two objects, one much larger than the other. Place the smaller object close to the camera and the larger object far away from the camera while ensuring the fact that both the objects take up the same bounding box space in the camera. In this case, the distance estimate will be the same for both objects when one of them is in fact much farther than the other.
The example that you gave is completely dependent on the performance of the object detector you are using. For instance, many modern object detectors face problems while detecting large and medium objects. You can read my answers in Issue#16 and Issue#18.
The formula for the distance estimation is mentioned as
distancei = (2 x 3.14 x 180) ÷ (w + h x 360) x 1000 + 3
. I have a counterexample in mind. Please let me know if I have made a mistake. Suppose you take two objects, one much larger than the other. Place the smaller object close to the camera and the larger object far away from the camera while ensuring the fact that both the objects take up the same bounding box space in the camera. In this case, the distance estimate will be the same for both objects when one of them is in fact much farther than the other.