# Can we calculate object distances by changing camera position and “measuring” pixel sizes of objects

I am not sure if this is a telemetry question or simple geometry but came across to similar questions in this forum, but I think this is a bit different; and actually "simpler" (compared to "autofocus" solutions) since I move the camera itself by a given amonut of dX and somehow "measure" the image height and observe a dI amount of image size change. Hence I believe make it camera independent. I am not sure if it depends on focal length. Does it help using more than one object image ratios for a given dX?

Image below is a hypothetic one with E0, E1 being camera positions with a difference of dX. O1 , O2 are different objects at positions x1, x2; and I10, I 11, I 20, I21 are image sizes for O1, O2 for E0, E1. Then the question comes down to, if there is any relationship for dX and dI1 and/or dI2? FOLLOW-UP:

Yes; mathematically speaking I have ended up with such an equation:

`x1**2 + x1*dX = O1**2/(I10*I11)`

Here the O1 represents the object height, which we need but do not have.

On the other hand again in this forum I had seen a piece of information which said the image size is inversly proportional with distance, i.e.,

O1 = a/x1

But my original drawing was not drawn with this logic, to be able to display a larger image for a nearer object (for x1- dX case). Hence I can not use these to equations as one set to solve for x1. I just could not manage to combine the two (I can not comment to an answer to my question, so I had to answer my question again to ask a question).

So I have managed to put up a better drawing, which I believe is correct: Here we have one object only. Camera moves forward to take image I2. Normally, I believe f1 and f2 are different; but compared to x1 distance, if we assume f1 = f2, then we get a set of two equations, to solve for x1 in the form of:

``````a*x1**2 + b*x1 + c = 0
``````

where

``````a = (I2/I1)
b = - a*dX
c = -1
``````

and then we can solve this quadratic equation and find the roots. Is this a viable solution? You may well argue that I2 >> I1 as f2 >> f1, and we gain nothing out of these equations.

• I don't know the correct equations, but I think that a prime lens used with the aperture stopped down may help, taking focal length out of the equation and increasing depth of field to avoid effects of re-focusing. – Jahaziel Mar 2 '17 at 18:48
• I'm voting to close this question as off-topic because this is about using a camera as a tool for a purpose other than photography. – mattdm May 1 '17 at 18:57