This is rather specialized, but people do ask how to determine the distance to an object or subject in an image. The DSLR Exif data may tell you Focus Distance, except you should realize that the focus distance reported is often seriously incorrect, especially for zoom lenses. You probably want to verify what actual distance is required for this lens to report that distance at that zoomed value.
Otherwise, the calculator here will do this, but you must know a few things about the situation:
You need the original digital image. Size of Object can't work from a cropped image or a paper print. OK, it can work from a resampled image, if it still the UNCROPPED full frame view (can work using original sensor mm, and the resampled image and object pixel dimensions, if Not cropped).
If using a simple compact camera, smart phone camera, or camcorder, you may not know all of the numbers. Especially not the precise size of the sensor in mm, especially not if in movie video mode. And this part may be rather confusing for novices without a basic understanding of digital images.
Then simple cameras normally specify their minimum and maximum zoom focal length, but we don't know any other value. These do reset to one default focal length when turned on, and then we can zoom them wider or more telephoto. But often we use the default focal length, which we don't know, so manually zoom them to the widest or narrowest view first. But if any Digital Zoom effects are in play, then that is cropping, and all bets are off.
If it is a still photo image (not a movie file), the focal length should be in the Exif data, which you can see there. If a camcorder, and if you think you can duplicate the first focal length (maybe the default focal length), you can take any still picture with it now, and see that focal length in its Exif data (of the still image).
But seeing a specification that your sensor is 2/3 inch or 1/1.8 inch means nothing in terms of actual sensor size (it is just a way to NOT tell us how tiny the sensor size is). If you cannot come up with accurate sensor size as width x height in mm, then your best bet is to use crop factor, which probably is available.
Focal Length: 4.5 (W) - 81.0 (T) mm (35mm film equivalent: 25-450 mm).
From these numbers, we know this crop factor is 25mm/4.5mm or 450mm/81mm, either one is 5.55 crop factor (ratio of Equivalent/Real focal length). This is due to sensor size, and since we know 35mm film size, then this ratio specifies sensor size. One choice below can compute sensor size from this Crop Factor (independent of focal length). Note that 720 or 1080 HD video shots are a different size than still pictures in a 3:2 or 4:3 still camera, but the Crop Factor choice includes this.
Numbers only. A NaN result will mean an input is Not A Number. Decimal points are OK.
You can use object size in feet or meters, cubits or whatever... The Distance result will be in the same units.
Example: In this image, the tape on the floor measures 30 feet.
Nikon D800 camera: Sensor 35.9 x 24 mm. 7360x4912 pixels. 60mm f/2.8 D lens.
The Exif says this Focus distance was 3.76 meters, which is 12.33 feet (when it was actually 30 feet). And this was a 60mm lens, not even a zoom lens, so the cameras distance report is a real crap shoot (worse than useless).
The door measures 80 inches tall, 6.667 feet (or the height or the width might be reasonably estimated, for a distance estimation). The cropped door is 2724 pixels tall (crop it, then look at image size).
So the calculator input specified 24mm sensor height, 2724 pixel object height, 4912 pixel sensor height, 60 mm lens, and 6.667 feet estimated real object height.
The tape on the floor measures 30 feet, and the calculator says 30.069 feet (0.23%). That 0.069 foot is 0.83 inches. This distance is computed to the Thin Lens node somewhere in the lens, not really known (but this calculated value here is Not to the focal plane at rear of camera). I guessed the node was at the middle of lens, so that could be an inch error. Still, the accuracy seems very adequate.
The small resampled image copy which is shown here is 450x300 pixels, and it can work too (only because the image is still full frame view, NOT cropped at all).
Then (in this resampled smaller image) the cropped door is 168 pixels tall, sensor height is 300 pixels tall (but still 24 mm in camera), and calculator says 29.777 feet (0.75%). Less precision in a smaller image or object due to less possible cropping accuracy. Still, even this is very near 30 feet.
Note this 168/300 pixels or 2724/4912 pixels is simply computing the size is 56% of the 24mm height of the camera sensor. Then knowing this height in the camera, and also the real life height, and the focal length distance in camera, it calculates distance to the subject.
Then it is similar triangles, just equal opposite angles, which have equal tangents, which are similar height/distance ratios.
Object height on image sensor (mm)/ focal length = Real Object height / Distance to Object.
The size of the Object image in mm is:
sensor height in mm x Object height in pixels / sensor height in pixels.
The calculator will do all of this, but it needs your accurate numbers.
The math the calculator uses is from this diagram:
If we measure that the object size (height or width) is say 10% of the image pixels, then we know it is also 10% of the sensor mm dimension. Then if we know the size of the sensor in mm, and if we know focal length in mm, then trigonometry can compute the distance to the object (Field of view is computed the same way). If we know the actual real life size dimension of the subject, then we can scale the distance accurately too.
Again, three points.
Maximum Image Sizes for 24.0 mp
Aspect ratio 1:1 / 4899 x 4899 pixels = 24.000 mp
Aspect ratio 4:3 / 5657 x 4243 pixels = 24.003 mp
Aspect ratio 3:2 / 6000 x 4000 pixels = 24.000 mp
Aspect ratio 16:9 / 6532 x 3674 pixels = 23.999 mp
16:9 in 4:3 chip: / 5657 x 3182 pixels = 18.001 mp
16:9 in 3:2 chip: / 6000 x 3375 pixels = 20.250 mp
(16:9 video will be resampled to 1920x1080 or 1280x720)