# Measuring angular distance with photographs

Is length in a photograph proportional to angular distance in the photographed scene?

Example: I take a picture with the horizon vertically centered. In the picture, I know that the point 1 inch above the center corresponds to 10 degrees above the horizon. Does that mean the point 2 inches above corresponds to 20 degrees above the horizon?

If not, what is the correct formula?

I'm primarily interested in the answer for 35 and 50mm photographic lenses, but a general formula (based on lens parameters) would be good too.

Astrophotography makes me think that angular distance in reality isn't proportional to linear distance in a photograph, but I wasn't sure.

No, it isn't. Distance in a photograph taken with a regular lens is (ideally) proportional to actual distance in the scene, not angular distance.

From the angle and the height above the horizon you can calculate the distance to the scene in the scale of the photo:

``````y = x * tan(v)

x = y / tan(v)

y = 1", v = 10  =>  x ~ 5.67"
``````

Then you can calculate the angle for the other point:

``````y = x * tan(v)

tan(v) = y / x

v = atan(y / x)

y = 2"  =>  v ~ 19.43
``````

As you see, it's close to 20 degrees, but not quite. The longer from the horison you measure, the larger the difference gets.

• What exactly are y, x, and v? Are you sure you want to use the sine and not the tangent? – whuber Dec 28 '10 at 17:58
• @whuber: The x would be the distance to the scene, y is the height above the horison and v is the angle. I think that you might be right that it should be tangent instead of sine, I will look into that. – Guffa Dec 29 '10 at 18:50
• This is correct, except in the case of an object at infinity, where an ideal lens does indeed map the angular position of the object, not its physical height, to location in the image. – Colin K Dec 30 '10 at 21:21
• @Colin K And at what distance, then, does @Guffa's analysis break down? (I think you are incorrect.) – whuber Dec 30 '10 at 22:17
• @whuber: I was thinking of an answer, when I realized I didn't go far enough in my first comment, so you're not going to like this:) An ideal lens maps the angular position of the object to location in the image, in all cases. Really it's the tangent of the angle but we can ignore that for the moment. The hang up here is that image location is proportional to angle, but if you assume a fixed object distance then angle is also proportional to object height. But at "infinity" there can actually be a variety of object distances in the same photo. – Colin K Dec 30 '10 at 22:33

It won't be proportional because most lenses are designed to be rectilinear not equiangular. Add barrel distortion on top of that and now the relationship between location on the image and angular position becomes quite messy. These are the sorts of calculations that panorama stitching programs are based on.

• (deleted last comment because I was wrong) I want to mention that panorama stitching is not primarily concerned with correcting lens distortion. Distortion correction may be done in conjunction with stitching, of course, but the primary work in stitching is to find the relative position of two images their overlapping regions match each other as closely as possible. This is most commonly done by a technique called cross-correlation (en.wikipedia.org/wiki/Cross-correlation). – Colin K Dec 30 '10 at 21:18

Photographic lenses reproduce a scene in complicated ways due to their complex structure. However, analysis of a simple lens gives reasonable guidance, at least as an approximation, except for specialty lenses (like fisheye lenses) and distances extremely close to a lens.

The geometry of a simple lens is straightforward: when an object in a plane perpendicular to the lens's optical axis is projected onto an image plane also perpendicular to the axis (which is usually the case in photography except for tilting lenses), the image is geometrically similar to the object. Therefore, distances in the image are directly proportional to distances in the scene as measured perpendicular to the optical axis. It also follows that the distance (in either plane) from the optical axis is proportional to the tangent of the angle from that axis. The constant of proportionality is the distance between the plane and the plane of the lens.

• This is mostly correct, but it is important to point out that for small angles the tangent of the angle is nearly the same as the angle itself (expressed in radians). – Colin K Dec 30 '10 at 21:01
• And also that, in lenses which are designed to have a very large field of view, where the x=tan(x) approximation can no longer be made, the lens is typically designed intentionally to have distortion such that the image location is proportional to the object angle. This is because it is nearly impossible to make a lens that maintains low distortion at wide angles while also having sufficient optical qualities. – Colin K Dec 30 '10 at 21:15
• @Colin K Good points, both of them. I trust that readers will find my response worded carefully enough to accommodate your refinements without any modification at all. But "mostly correct" implies some of it is incorrect. Which parts? – whuber Dec 30 '10 at 22:15
• Sorry, there is nothing wrong with your answer. I shouldn't have said "Mostly." – Colin K Dec 30 '10 at 22:20