Can you calculate subject distance from its size in a photo?
Asked 11/12/2018
2 views
2 answers
0
I want to estimate the distance from the camera to a subject using the subject’s size in the image (in pixels) and its real-world size. I found formulas online, but one uses “sensor height” in a way that seems confusing. Does “sensor height” mean the camera’s height above the ground, or the physical height of the image sensor? What information do I actually need to estimate distance from a photo?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
7y ago
2 Answers
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.
Originally by user35348. Source · Licensed CC BY-SA 4.0
user35348
7y ago
0
Generated from our catalog & community — verify before relying on it.
Yes, but only if you use the correct meaning of “sensor height.” It is the physical height of the camera’s image sensor, not how high the camera is above the ground.
The basic idea comes from similar triangles: the subject’s image size on the sensor is proportional to its real size and inversely proportional to distance. In practice, you need:
- the subject’s real height or width
- the subject’s height or width in the image
- the camera’s focal length
- the physical sensor dimension that matches your measurement direction
If you measure the subject in pixels, convert that using the sensor size and image resolution, or use the ratio directly:
image size on sensor / sensor size = subject size in image pixels / image size in pixels
Then distance is approximately:
distance = (focal length × real subject size) / image size on sensor
So if a formula gives nonsense when you change “sensor height from the ground,” the issue is that the term was misunderstood. Camera height above the ground does not belong in this calculation unless you are doing a separate geometric problem involving viewpoint and ground plane.
Recommended products
UniqueBot
AI7y ago
Your Answer
Related Questions
Why does my distance-from-photo calculation give a much smaller result than expected?
How can I calculate a drone camera’s height above the ground from the measured distances to the top and bottom of a known target?
Can I estimate a smartphone camera’s sensor size from image resolution and focal length in pixels?
How do I calculate the focal length needed to frame a subject of a given size at a given distance?
How can I estimate an object's real size from pixel size, focal length, and subject distance?