# Thread: Distance of objects in photos

1. Are there any known methods for calculating/estimating the distances of objects from the camera in photos?
More specifically I'm looking for a method that estimates the distance from the camera to the object of every pixel in the image - creating a sort of height/distance map of the photo?
I'm not looking for a perfect methodology; estimates will do.

Thanks

2.

3. if you have something else in the photo that you know the size of, then you can triangulate distance

it would help to draw a grid over some photos, if your using a computer, experiment by taking picutures of things you know the size of and distance in between. Then you can learn how to draw the grid to calculate size and distance based on relative size of things you know in the photo.

For example if you want to know the distance between two trees. Grab a stick and lay it on the ground pointing from one tree to the other, take the picture of the trees and include the stick. Then bring the stick with you, measure it, and do some math. You should be able to get roughly close to the actuall distance between the trees.

If you don't know the size of anything in the picture, you can only guess distance.

4. The problem with your suggestion is that it requires object recognition. I'm looking for an automatic process that creates a depth map of the whole photo rather than specific objects. So while I can myself distinguish that this object in my photo is a tree, my computer cannot without some very clever programming.

5. I believe what you are trying to do is impossible. Maybe not though.

As far as I know, you need a reference to measure the size of anything reliably. Without a reference you are guessing, because you don't know how far away the camera was and what type of lens was used(I'm sure there are other variables too)

You might be able to figure out every angle, but this won't help you without at least one measurment of distance to work with.

Anyway, you should post this in the mathematics forum.

6. You are trying to reinvent computer stereo vision. And you have a very idealized view of what it can achieve.

If you cannot use two photos (a stereo pair), or more, but are stuck with just one picture, you can still try "depth from focus", "shape from texture" and "shape from shading" (search the net for these terms) to get some information about the 3D structure of whatever you are looking at.

Another option, if you have the money, is to use a 3D scanner.

I don't think a computing technique will be developed, ever, that would allow the distance to be estimated at every pixel of a normal 2D digital photo. The information is simply not there. Unless, as has already been pointed out, you already know the exact shapes and sizes of the objects in your picture.

Good luck anyway, and have fun,
Leszek.

 Bookmarks
##### Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement