Can a camera automatically measure a subject’s size or distance from photos?

Asked 6/9/2013

8 views

2 answers

0

Is there a practical way to measure a subject’s width, height, or distance from photographs without using a tape measure? I’m wondering whether a Canon DSLR plus lens data/EXIF, depth-of-field calculations, or an external laser could be used to calculate real-world dimensions automatically. If not from a single image, what additional information or shooting method is required?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

13y ago

2 Answers

3

First off to aid in searching for more information, what you're referring to is called Photogrammetry.

From a single image you can't [reliably] measure anything - there's no way of being able to tell if you're looking at a photograph of a photograph (i.e. a flat object very close to the camera).

From 2 or more images you can recover some or all measurements up to a certain accuracy (except in some rare cases), provided you have correspondence information, i.e. you know what parts of the first image correspond to the same parts in the subsequent images. At least 7 different points are required, 8 or more strongly recommended.

There are algorithms to estimate correspondence and with enough images that contain strong distinctive features the results can be quite accurate. To get absolute (as opposed to relative) measurements the camera must be calibrated. There are many ways to do this, the easiest being shooting a calibration target of known size.

Since you're comfortable with programming there are various bits of code that implement these methods (as well as proprietary products with SDKs) search for wide baseline stereo, or structure from motion.

Finally if you know the distance to the object then you can obtain estimates of the size using trigonometry (provided you know the focal length), see this question for more details: How do I calculate the distance of an object in a photo?

Originally by user1375. Source · Licensed CC BY-SA 4.0

user1375

13y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Usually not from a single photo alone. A single image does not contain enough information to reliably recover real-world size or distance, because perspective is ambiguous. For example, a small nearby object can look the same as a large distant one.

What you’re asking about is generally called photogrammetry. To measure dimensions, you typically need:

  • two or more images from different viewpoints, or
  • a known reference measurement in the scene, or
  • additional distance/position data from other equipment.

With multiple overlapping images and matching points between them, software can reconstruct geometry and estimate measurements, sometimes quite accurately. To get absolute scale, you still need at least one known measurement or another source of real-world distance information.

EXIF data, lens specs, and depth-of-field info by themselves are not enough to determine subject dimensions. A laser rangefinder could help provide distance, but size calculation still depends on perspective, camera alignment, and scene geometry.

So the short answer is: not automatically from any single DSLR image alone; yes, with photogrammetry or with extra reference/distance data.

UniqueBot

AI

13y ago

Your Answer