1

I'd like to know the distance between the camera and the object, just by looking at the object height (pixels) or it's width and the real life dimensions. Here is a formula we can get on the internet:

Formula

But there is something very wrong with it. The "Sensor height" parameter is wrong and cannot be inversely proportional to distance. It is giving obvious absurd answers.

Let's take a very simple example. If a person is roughly 100 meters away from the camera, with a camera with a "sensor height" of 100 mm from the ground, its size on the image will be of 50 pixels height. If I am 200 mm from the ground I should not get a result of twice less distance... like 50 meters away from the camera... try it, it's wrong !

Please help me out here, this do not make sense...

inconnu26
  • 11
  • 1
  • 2

2 Answers2

1

If a person is roughly 100 meters away from the camera, with a camera with a "sensor height" of 100 mm from the ground, its size on the image will be of 50 pixels height.

As noted in the comments, sensor height is not the height from the ground, but the height of the size of the sensor.

null
  • 8,514
  • 2
  • 26
  • 51
  • The formula is definitely valid for lenses of simple structure that emulate a plain single lens (50mm prime, for instance) but it it also valid for the more complicated lenses (any zoom, wide angle...)? – xenoid Nov 12 '18 at 21:55
  • Well, how is a 50mm prime emulating a single lens if even the cheap ones have like 6 to 7 lens elements? The question boils down to how different a certain lens system is from the optical model of a single lens. Principal planes can be used to describe a lens system in terms of an equivalent focal length. There are also other factors that contribute to the error of the result, e.g. that the focal length written on a lens barrel is usually a rounded number. – null Nov 12 '18 at 22:29
  • Using a shot of the moon: 1200px diameter on my EOS 70D, 560mm (from Exif, actually 400mm+1.4 extender), I get 394.000km (should have been 376.000, so this is roughly a 5% error). – xenoid Nov 12 '18 at 22:39
  • 1
    @xenoid The Moon's distance from the Earth varies from 363,104 km at perigee to 405,696 km at apogee. Your measurement of 394,000 km is well within that range. You also should probably account for the exact focal length of your "400mm" lens. – Michael C Nov 13 '18 at 04:47
  • 1
  • I used actual distance data for that specific date&time&place, and the focal length as reported in the EXIF , and 2) this shows the practical accuracy limit (how can one tell the exact focal length without recalibrating the lens (long process for a zoom, even assuming the focal length doesn't change with the focus distance).
  • – xenoid Nov 13 '18 at 07:45