How to estimate real distance between two detected objects in an image?

You may think this is a duplicate, but my situation is different than previously asked questions. The only information I have is the width and height of the bounding boxes of detected people. The dataset I'm working on has images captured in different environments (street, garden, mall, ...). In other words, there is no fixed object in all images I can use as scale. The angle at which each image is captured varies drastically from almost parallel to the ground to prependicular to the ground. This means that bounding boxes don't always mimic the real size of a person. My objective is to measure the real distance between people. Any hints on how I can do this ? I am starting to think it is not feasible

Thank you!

Topic distance computer-vision

Category Data Science


Distance in an image is based on pixels. You will need to convert this distance to the actual real world metric like cm or inch. To make this happen, you will also need a reference object in your image whose real world dimensions are already known to you. Or you will need the distance between the object and camera. If you manage to get this distance using your camera lens, then you won't need any reference object. And then, it is very complex to get distances between objects placed in 3D space.

This is a great article that explains the aforementioned approaches in 2D space. It might be a good start for you.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.