# Distance between two objects in a picture

lets say I have a photo that has a picture on a wall and a book upright on the desk. now i know the size of both of these objects. I want to find the distance between two of them on the photo, I was wondering if there were any guides or any good explanations on how to do this?

I plan to use this for a project app that slightly knows the location of an object(in a setroom) in an image by knowing the distance between object A(onthewall) and object B(somewhere randomly in the room) and the distance between object A and the camera.

sorry if the tags are quite right will fix them if you comment on it thanks for any advice

-
Knowing the actual size and size in the camera image will help you find the distance from the camera. But this is not sufficient to find the distance between the two objects as you need to know how they are located in 3-D space. For example, if you fix the distance of the book and the picture from the camera, you can still move them around without affecting the size in the camera image. –  mythealias Nov 11 '12 at 4:13
As @mythealias said, this is a highly nontrivial problem; ideally you'd have pictures from a bunch of different angles to try and interpolate an answer with. I'd suggest asking on stackoverflow.com to see if people can direct you towards pre-made solutions/good approaches, but this sounds like a hard problem. –  Mark S. Nov 12 '12 at 14:13
ok thanks i can see i was being a little innocent on it, i know ideally more than one cams needed but i was trying to think of solutions using one cam/pic i'll ask stackoverflow and see what they think –  user23012 Nov 20 '12 at 3:24