Respuesta :

The only other factor you need is the height of the object in real life (otherwise you could be photographing a model which is much closer to the camera).

The maths isn't actually that complex, the ratio of the size of the object on the sensor and the size of the object in real life is the same as the ratio between the focal length and distance to the object.

To work out the size of the object on the sensor, work out it's height in pixels, divide by the image height in pixels and multiply by the physical height of the sensor.

So the whole sum is:

Distance to object equation