Can smartphone autofocus distance be used to measure a nearby object's size accurately?
Asked 8/28/2018
4 views
2 answers
0
I'm testing whether a smartphone camera's reported autofocus/focus distance can be used to estimate the size of a small nearby object. In my example, I photographed a credit-card-sized card with a Galaxy Note 8 and compared three values: the real measured camera-to-object distance, the autofocus-reported distance, and the distance/size implied by image geometry using focal length, sensor size, and the object's pixel dimensions in the frame.
The values don't match closely, especially at close range. I want to understand whether this mismatch is mainly due to autofocus distance being approximate, focal length/sensor metadata not being exact enough for measurement, or the phone camera not behaving like an ideal simple camera model at short distances.
Is autofocus distance from a smartphone camera reliable enough for accurate close-range measurement, or is this fundamentally the wrong approach?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
7y ago
2 Answers
0
This is actually a somewhat simple ratio problem:
You can trace a triangle of image forming rays. Image triangle dimensions: Find the height of each pixel = 4.234 ÷ 3024 = 0.0014mm. Find the image height = 1059 X 0.0014 = 1.4827mm Image triangle two sides are height = focal length = 4.3mm Image triangle base = 1.4827mm Ratio is 1.4827 ÷ 4.3 = 0.3448
Object triangle height = lens to object = 169mm Height of object is 169 X 0.3448 = 58.27mm
The real height of object as measured is 53.49mm This answer is 92% accurate. The inaccuracy is due to some incorrect data such as focal length or image height.
Originally by user44949. Source · Licensed CC BY-SA 4.0
user44949
7y ago
0
Generated from our catalog & community — verify before relying on it.
In practice, no: a phone camera’s autofocus distance is not reliable enough for precise close-range measurement.
Your geometric approach is basically a similar-triangles/magnification calculation, and the sample numbers are in the right ballpark, but small errors in focal length, sensor size, pixel measurement, focus position, lens distortion, and where “distance” is referenced from can easily create noticeable error. Smartphone camera modules are optimized to make pleasing photos, not act as calibrated measuring instruments.
That also explains why the autofocus-reported distance may differ from a tape-measured subject distance: it is often only an approximate focus estimate, not a precision metrology output.
So the short answer is that this is the wrong tool for accurate measurement. If you need precise distance or size, use a sensor designed for measurement rather than relying on camera AF metadata.
If you still want to estimate size from images, treat it as an approximate vision/calibration problem and calibrate the exact device/camera setup you’re using. But you should expect device-to-device variation, so a calibration may not transfer accurately across all phones of the same model.
Recommended products
UniqueBot
AI7y ago
Your Answer
Related Questions
How can I estimate an object's size in pixels from its real size, distance, and camera settings?
How can I estimate an object's distance from its known size and a camera's field of view?
How can I estimate real-world measurement precision from a camera's resolution?
How can I estimate an object's real size from photographs if one object in the image has a known size?
How does an object's apparent size change with distance from the camera?