D = f*H/h

D = distance from lens to object
(d = distance from lens to 35mm film)
f = focal length
H = height of object
h = height of object's image on 35mm film

I've seen some form of this equation in several places including these two threads:

How do I calculate the distance of an object in a photo?
Is the formula for object image size given focal length, etc. independent of sensor size?

The problem I'm having is with f. From the magnification for a thin lens:

M = D/d = H/h = f/(f-D)

I can't figure out how to arrive at

D = f*H/h

Any help? Thanks.

  • Are you concerned with macro distances (i.e., within inches in front of the camera), or longer distances, such as portraiture, etc.? – scottbb May 15 '17 at 12:08

An object 1 meter (1000mm) in height is photographed with a 50mm focal length lens. The object distance is 5meter (5000mm).

H = actual height = 1000

D = actual distance = 5000

We can trace out a triangle with the vertex at the lens. The base of this triangle is the objects height; the height of this triangle is object distance. The ratio of height to distance is 1000 ÷ 5000 = 0.200.

Inside the camera, we can trace a similar triangle. A similar triangle means the angles of both triangles have identical angles and the ratio of corresponding sides will be identical.

The height of this image triangle is the focal length of the lens d = 50

The base of this triangle is unknown. We can calculate; 50 X 0.2 = 10

Thus h = 10mm

Prove formula D = f(H/h)




h = 10

D = 50 X (1000/10)

D =50 X 100

D = 5000 (actual object distance = 5 meters)

| improve this answer | |
  • Thanks, Alan. I guess maybe I don't understand focal length as well as I thought I did. You appear to be using the distance between lens and film surface as focal length. It was my understanding that the focal length is the distance between lens and focal point. Wouldn't the image projected onto film surface need to be some distance BEYOND the focal point? Thanks, again. – Taro May 15 '17 at 16:23
  • 1
    The focal length is the distance between lens and focused image when the lens is targeting a far away object. As you ocus on nearby objects, the lens to focused image increases. At "unity" (magnification 1), lens to focused image is 2 X the focal length. Technically the measurements you need is distance from rear nodal to focused image and distance to front nodal and the object. I think for your calculations, the differences between object and front of lens and rear of lens to focused image will do just find. OK to use focal length for distance lens to focused image. – Alan Marcus May 15 '17 at 18:21
  • Thanks again, Alan. This is for an object estimated to be 37-metres from a 55mm lens. So, how would I go about determining the object-to-camera distance where this factor becomes negligible? – Taro May 15 '17 at 23:19
  • You must know focal length of the lens. An object 37 meters distant can be assumed to be at infinity. If we know image height is 18mm than ratio is 18/55=0.3273. Height is 37 X 0.3273 =12.1091meters. Suppose you know the height is 4 meters & distance = 37 meters, object ratio is 4/37=0.1081. Then image size is 55 X 0.1081 = 5.9459mm. – Alan Marcus May 16 '17 at 0:46
  • Thank you, Alan. Just to be clear, the object is considered at infinity if it is beyond the hyperfocal distance, correct? – Taro May 16 '17 at 2:52

What you're trying to arrive at can't be right. Since D/d = H/h

D = f*H/h

is equivalent to

D = f*D/d

Dividing both sides by D

1 = f/d

d = f

Which clearly isn't correct

| improve this answer | |
  • 1
    In complement: it's incorrect, except when the object is at infinity (or "far away enough"), in which case d = f (or d ≈ f) holds. – Matthieu Moy May 15 '17 at 17:21
  • 3
    @MatthieuMoy bingo. The OP's "D = f*H/h" only holds for all distances for idealized pinhole cameras (in which case, d = f always). – scottbb May 15 '17 at 18:16
  • One or both of you should add that as an answer and I'll delete mine. – MikeW May 15 '17 at 18:32
  • Thanks, Mike, Matthieu and Scott. All these comments are very helpful. So, what I'm getting is that for a lens, d approaches f as D increases, correct? If that's the case, I'll need to determine the D at which point df. – Taro May 15 '17 at 23:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.