Let a line segment in three-dimensional space be projected on to a two-dimensional plane, with a given centre of perspective. The mid-point of the projected line segment has a corresponding inverse point in the original line segment. Foreshortening usually causes this apparent mid-point to differ from the actual mid-point of the original line segment. The apparent mid-point and the two end-points of the original line segment each has a depth coordinate in a Cartesian system which has the origin at the centre of perspective and a depth axis perpendicular to the plane of projection.
Proposition: the depth coordinate of the apparent mid-point is the harmonic mean of the depth coordinates of the end-points.
This proposition is useful in photography, as depth of field is optimised if the camera is focused at the harmonic mean of the distances of the nearest and farthest objects required to be sharp. This proposition means that optimal depth of field can be obtained by focusing on an object midway in the viewfinder between near and far objects, provided that this object is on a straight line in the scene between the near and far objects.
On 1996-05-28, Martin Tai posted an article Hyperfocusing the Tulips in rec.photo.technique.misc news group proving the harmonic mean relationship for the special case when focusing on an object at the centre of the viewfinder, with the near and far points at the top and bottom of the viewfinder. Our proposition shows that this technique can be used with objects anywhere in the viewfinder.
An elementary proof follows. In the figure below, the 3D line segment has end-points (x1,y1,z1) and (x3,y3,z3). The plane of projection is z = 1, perpendicular to the depth axis z, and the centre of perspective is at the Cartesian origin (0,0,0). In the plane of projection, the 2D line segment has end-points (X1,Y1) and (X3,Y3) and the mid-point is (X2,Y2). The apparent mid-point of the 3D line segment is at (x2,y2,z2).
I. For the perspective projection of the end-points and the apparent mid-point:-
X1 = x1 / z1
Y1 = y1 / z1
X2 = x2 / z2
Y2 = y2 / z2
X3 = x3 / z3
Y3 = y3 / z3
II. For the actual mid-point of the line segment in the plane of projection:-
X2 = (X1 + X3) / 2
Y2 = (Y1 + Y3) / 2
III. Using the perspective equations [I] to eliminate the projected points from the mid-point equations [II]:-
x2 = (z2 / 2z1)x1 + (z2 / 2z3)x3
y2 = (z2 / 2z1)y1 + (z2 / 2z3)y3
IV. The incidence of (x2,y2,z2) on the line joining (x1,y1,z1) and (x3,y3,z3) can be expressed using the parameter t, where 0 ≤ t ≤ 1:-
x2 = (t)x1 + (1 - t)x3
y2 = (t)y1 + (1 - t)y3
z2 = (t)z1 + (1 - t)z3
V. Comparing the first two of equations [IV] with equations [III]:-
t = z2 / 2z1
1 - t = z2 / 2z3
VI. Eliminating t gives:-
z2 / 2z1 = 1 - z2 / 2z3
VII. Multiplying by 2z1z3 gives:-
z2z3 = 2z1z3 - z2z1
z2 = 2z1z3 / (z1 + z3)
z2 is the harmonic mean of z1 and z3, QED.
Christopher B. Jones