MATLAB Answers


How can I find an object distance in an image??

Asked by Tomas
on 8 Dec 2012

Hi,To find the an object distance (working distance) in an image, I can do this

object distance = focal length*((1/magnification) + 1)


  1 Comment

Jan Simon
on 8 Dec 2012

Currently I do not see the relation between your question and Matlab. Because this is a Matlab forum, your problem might be off-topic.



No products are associated with this question.

1 Answer

Answer by Jürgen
on 8 Dec 2012
Edited by Jürgen
on 8 Dec 2012

hi, first Your question is not clear? second, on a single image you can not extract object distance,=> you need stereovision, or other techniques like depth from focus or special cameras( Time Of Flight) I suppose you refer to the thin lens equation but this is only for an object in focus

regards, J


on 8 Dec 2012

what's the difference between camera distance, image distance and working distance in this link

Hi, to be honnest I do not have the time to read the link but for me: image distance is the distance between the plane where the image is formed and the lens center, and object distance is the distance between the object in focus and the lens center , camera distance is not so clear define for me , I do not use it actually, if you want to do measurements on images start by looking at the pinhole camera model , there you have the image plane at focal length of the lens center

Jan Simon
on 8 Dec 2012

@Thomas: Please read the text of the posted link again. The term "camera distance" is defined and in the previous chapter you find "image distance" also.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!