C H A P T E R
1
Cameras
PROBLEMS
1.1. Derive the perspective equation projections for a virtual image located at a distance
f 0 in front of the pinhole.
Solution We write again ¡¡!OP 0 = ‚¡¡!OP but this time impose z0 = ¡f 0 (since
the image plane is in front of the pinhole and has therefore negative depth). The
perspective projection equations become
x0 = ¡f 0 x
y0 = ¡f 0 y
z
z
;
:
8><
>:
Note that the magniflcation is positive in this case since z is always negative.
1.2. Prove geometrically that the projections of two parallel lines lying in some plane
ƒ appear to converge on a horizon line H formed by the intersection of the image
plane with the plane parallel to ƒ and passing through the pinhole.
Solution Let us consider two parallel lines ¢1 and ¢2 lying in the plane ƒ and
deflne ¢0 as the line passing through the pinhole that is parallel to ¢1 and ¢2.
The lines ¢0 and ¢1 deflne a plane ƒ1, and the lines ¢0 and ¢2 deflne a second
plane ƒ2. Clearly, ¢1 and ¢2 project onto the lines –1 and –2 where ƒ1 and ƒ2
intersect the image plane ƒ0. These two lines intersect at the point p0 where ¢0
intersects ƒ0. This point is the vanishing point associated with the family of lines
parallel to ¢0, and the projection of any line in the family appears to converge on
it. (This is true even for lines parallel to ¢0 that do not lie in ƒ.)
Now let us consider two other parallel lines ¢0
2 in ƒ and deflne as before
the corresponding line ¢0
0 line in a
plane parallel to ƒ that intersects the image plane along a line H passing through
p0 and p0
0. This is the horizon line, and any two parallel lines in ƒ appears to
intersect on it. They appear to converge there since any image point above the
horizon is associated with a ray issued from the pinhole and pointing away from ƒ.
Horizon points correspond to rays parallel to ƒ and points in that plane located at
an inflnite distance from the pinhole.
0 and vanishing point p0
0. The lines ¢0 and ¢0
1 and ¢0
1.3. Prove the same result algebraically using the perspective projection Eq. (1.1). You
can assume for simplicity that the plane ƒ is orthogonal to the image plane.
Solution Let us deflne the plane ƒ by y = c and consider a line ¢ in this plane
with equation ax + bz = d. According to Eq. (1.1), a point on this line projects
onto the image point deflned by
x0 = f 0 x
z
y0 = f 0 y
z
= f 0 d ¡ bz
az
;
= f 0 c
z
:
8><
>:
1
课后答案网 www.khdaw.com
2
Chapter 1
Cameras
This is a parametric representation of the image – of the line ¢ with z as the
parameter. This image is in fact only a half-line since when z ! ¡1, it stops
at the point (x0; y0) = (¡f 0b=a; 0) on the x0 axis of the image plane. This is the
vanishing point associated with all parallel lines with slope ¡b=a in the plane ƒ.
All vanishing points lie on the x0 axis, which is the horizon line in this case.
1.4. Derive the thin lens equation.
Hint: consider a ray r0 passing through the point P and construct the rays r1 and
r2 obtained respectively by the refraction of r0 by the right boundary of the lens
and the refraction of r1 by its left boundary.
Solution Consider a point P located at (negative) depth z and distance y from
the optical axis, and let r0 denote a ray passing through P and intersecting the
optical axis in P0 at (negative) depth z0 and the lens in Q at a distance h from the
optical axis.
P1
1r
0r’
0P’
-y’
P’
z1
z’0
z’
Q
h
O
0r
r
-z
P
y
-z
0
P0
Before constructing the image of P , let us flrst determine the image P 0
0 of P0 on
the optical axis: after refraction at the right circular boundary of the lens, r0 is
transformed into a new ray r1 intersecting the optical axis at the point P1 whose
depth z1 verifles, according to (1.5),
1
¡ z0
+
n
z1
=
n ¡ 1
R
:
The ray r1 is immediately refracted at the left boundary of the lens, yielding a new
ray r0
0. The paraxial refraction equation can
be rewritten in this case as
0 that intersects the optical axis in P 0
n
¡ z1
and adding these two equation yields:
+
1
z0
0
=
1 ¡ n
¡ R
;
1
0 ¡
z0
1
z0
=
1
f
; where
f =
R
2(n ¡ 1)
:
(1.1)
Let r denote the ray passing through P and the center O of the lens, and let P 0
denote the intersection of r and r0, located at depth z0 and at a distance ¡y0 of the
optical axis. We have the following relations among the sides of similar triangles:
= (1 ¡
z
z0
);
z ¡ z0
¡ z0
=
z0 ¡ z0
0
z0
0
y
=
h
¡ y0
h
y0
z0 =
8>>>>>><
>>>>>>:
y
z
:
= ¡(1 ¡
z0
z0
0
);
(1.2)
课后答案网 www.khdaw.com
3
Combining Eqs. (1.2) and (1.1) to eliminate h, y, and y0 flnally yields
1
z0 ¡
1
z
=
1
f
:
1.5. Consider a camera equipped with a thin lens, with its image plane at position z 0
and the plane of scene points in focus at position z. Now suppose that the image
plane is moved to ^z0. Show that the diameter of the corresponding blur circle is
djz0 ¡ ^z0j
z0
;
where d is the lens diameter. Use this result to show that the depth of fleld (i.e.,
the distance between the near and far planes that will keep the diameter of the
blur circles below some threshold ") is given by
D = 2"f z(z + f )
d
f 2d2 ¡ "2z2 ;
and conclude that, for a flxed focal length, the depth of fleld increases as the lens
diameter decreases, and thus the f number increases.
Hint: Solve for the depth ^z of a point whose image is focused on the image plane at
position ^z0, considering both the case where ^z0 is larger than z0 and the case where
it is smaller.
Solution If " denotes the diameter of the blur circle, using similar triangles im-
mediately shows that
" = djz0 ¡ ^z0j
:
z0
Now let us assume that z0 > ^z0. Using the thin lens equation to solve for the depth
^z of a point focused on the plane ^z0 yields
^z = f z
d ¡ "
df + "z
:
By the same token, taking z0 < ^z0 yields
^z = f z
d + "
df ¡ "z
:
Finally taking D to be the difierence of these two depths yields
D =
2"df z(z + f )
f 2d2 ¡ "2z2 :
Now we can write D = kd=(f 2d2 ¡ "2z2), where k > 0 since z0 = f z=(f + z) > 0.
Difierentiating D with respect to d for a flxed depth z and focal length f yields
@D
@d
= ¡k
f 2d2 + "2z2
(f 2d2 ¡ "2z2)2 < 0;
which immediately shows that D decreases when d increases, or equivalently, that
D increases with the f number of the lens.
课后答案网 www.khdaw.com
4
Chapter 1
Cameras
1.6. Give a geometric construction of the image P 0 of a point P given the two focal
points F and F 0 of a thin lens.
Solution Let us assume that the point P is ofi the optical axis of the lens. Draw
the ray r passing through P and F . After being refracted by the lens, r emerges
parallel to the optical axis. Now draw the ray r0 passing through P and parallel to
the optical axis. After being refracted by the lens, r0 must pass through F 0. Draw
the two refracted rays. They intersect at the image P 0 of P . For a point P on the
optical axis, just construct the image of a point ofi-axis with the same depth to
determine the depth of the image of P 0. It is easy to derive the thin lens equation
from this geometric construction.
1.7. Derive the thick lens equations in the case where both spherical boundaries of the
lens have the same radius.
Solution The diagram below will help set up the notation. The thickness of the
lens is denoted by t. All distances here are taken positive; if some of the points
changed side in a difierent setting, all formulas derived below would still be valid,
with possibly negative distance values for the points having changed side.
C
A
a
B
c
t
b
Let us consider a point A located on the optical axis of the thick lens at a distance
a from its right boundary. A ray passing through A is refracted at the boundary,
and the secondary ray intersects the optical axis in a point B located a distance
b from the boundary (here B is on the right of the boundary, recall that we take
b > 0, if B were on the left, we would use ¡b for the distance). The secondary
ray is then refracted at the left boundary of the lens, and the ternary ray flnally
intersects the optical axis in a point C located at (positive) distance c from the left
lens boundary.
Applying the paraxial refraction Eq. (1.5) yields
;
n ¡ 1
R
n ¡ 1
R
=
:
1
a ¡
n
t + b
n
b
=
+
1
c
8><
>:
To establish the thick lens equation, let us flrst postulate the existence of the
focal and principal points of the lens, and compute their positions. Consider the
diagram below. This time A is the right focal point F of the lens, and any ray
passing through this point emerges from the lens parallel to its optical axis.
课后答案网 www.khdaw.com
5
c
h’
H
t
h
d
V
F
a
f
B
b
This corresponds to 1=c = 0 or
We can now write
or
b =
nR
n ¡ 1 ¡ t =
nR ¡ (n ¡ 1)t
n ¡ 1
:
1
a
=
n
b
+
n ¡ 1
R
=
n ¡ 1
R
[1 +
nR
nR ¡ (n ¡ 1)t
];
a =
R
n ¡ 1
[1 ¡
nR
2nR ¡ (n ¡ 1)t
]:
Now let us assume that the right principal point H of the lens is located on the
left of its right boundary, at a (positive) distance d from it. If h is the distance
from the optical axis to the point where the flrst ray enters the lens, and if h0 is
the distance between the optical axis and the emerging ray, using similar triangles
shows that
Substituting the values of a and b obtained earlier in this equation shows that
d =
Rt
2Rn ¡ (n ¡ 1)t
:
The focal length is the distance between H and F and it is thus given by
or
f = d + a =
nR2
(n ¡ 1)[2Rn ¡ (n ¡ 1)t]
;
1
f
= 2
n ¡ 1
R ¡
(n ¡ 1)2
n
t
R2 :
For these values of a, b, c, d, and f , it is now clear that any ray passing through F
emerges parallel to the optical axis, and that the emerging ray can be constructed
by pretending that the primary ray goes undeected until it intersects the principal
plane passing through H and perpendicular to the optical axis, where refraction
turns it into a secondary ray parallel to the axis.
h0
d + a
h0
t + b
=
=
h
a
h
b
d + a
t + b
=
a
b
=)
=) d = t
a
b
:
8>><
>>:
课后答案网 www.khdaw.com
6
Chapter 1
Cameras
An identical argument allows the construction of the left focal and principal planes.
By symmetry, these are located at distances a and d from the left boundary, and
the left focal length is the same as the right one.
We gave in Ex. 1.6 a geometric construction of the image P 0 of a point P given
the two focal points F and F 0 of a thin lens. The same procedure can be used for a
thick lens, except for the fact that the ray going through the points P and F (resp.
P 0 and F 0) is \refracted" into a ray parallel to the optical axis when it crosses
the right (resp.
left) boundary of
the lens (Figure 1.11). It follows immediately that the thin lens equation holds for
thick lenses as well, i.e.,
left) principal plane instead of the right (resp.
1
z0 ¡
1
z
=
1
f
;
where the origin used to measure z is in the right principal plane instead of at the
optical center, and the origin used to measure z0 is in the left principal plane.
课后答案网 www.khdaw.com
C H A P T E R
2
Geometric Camera Models
PROBLEMS
2.1. Write formulas for the matrices A
BR when (B) is deduced from (A) via a rotation
of angle about the axes iA, jA, and kA respectively.
Solution The expressions for the rotations are obtained by writing the coordi-
nates of the vectors iB, jB and kB in the coordinate frame (A). When B is
deduced from A by a rotation of angle about the axis kA, we obtain
0
A
0
0
sin
cos
Note that A
When B is deduced from A by a rotation of angle about the axis iA, we have
BR =ˆcos ¡ sin
1!:
BR is of course the inverse of the matrix B
AR given by Eq. (2.4).
0
cos !:
cos ¡ sin
sin
BR =ˆ1
0
0
A
0
0
Finally, when B is deduced from A by a rotation of angle about the axis j A, we
have
A
BR =ˆ cos
¡ sin
0
0
1
0
sin
cos !:
0
2.2. Show that rotation matrices are characterized by the following properties: (a) the
inverse of a rotation matrix is its transpose and (b) its determinant is 1.
Solution Let us flrst show that the two properties are necessary. Consider the
rotation matrix
B
AR = (B iA
B jA
B kA):
Clearly,
RT R =0
@
B iA ¢ B iA
B jA ¢ B iA
B kA ¢ B iA
B iA ¢ B jA
B jA ¢ BjA
B kA ¢ B jA
BiA ¢ B kA
B jA ¢ B kA
B kA ¢ B kA
1
A = Id;
thus RT is the inverse of R. Now Det(R) = (B iA £ B jA) ¢ B kA = 1 since the
vectors iA, jA, and kA form a right-handed orthonormal basis.
Conversely, suppose that the matrix R =¡u v w¢ verifles the properties RT R =
Id and Det(R) = 1. Then, reversing the argument used in the \necessary" part
of the proof shows that the vectors u, v, and w form a right-handed orthonormal
basis of R3. If we write u = B iA, v = B jA, and w = B kA for some right-handed
orthonormal basis (B) = (iB; jB; kB) of E3, it is clear that the dot product of any
two of the vectors iA, jA, and kA is the same as the dot product of the corre-
sponding coordinate vectors, e.g., iA ¢ iA = u ¢ u = 1, and jA ¢ kA = v ¢ w = 0. By
7
课后答案网 www.khdaw.com
8
Chapter 2
Geometric Camera Models
the same token, (iA £ jA) ¢ kA = (u £ v) ¢ w = 1. It follows that the vectors iA,
jA, and kA form a right-handed orthonormal basis of E3, and that R is a rotation
matrix.
2.3. Show that the set of matrices associated with rigid transformations and equipped
with the matrix product forms a group.
Solution Since the set of invertible 4£4 matrices equipped with the matrix prod-
uct already forms a group, it is su–cient to show that (a) the product of two rigid
transformations is also a rigid transformation, and (b) any rigid transformation
admits an inverse and this inverse is also a rigid transformation. Let us flrst prove
(a) by considering two rigid transformation matrices
T = R t
0T
1¶ T 0 =R0
0T
t0
1¶
and their product
T 00 =R00
0T
t00
1¶ =RR0 Rt0 + t
1 ¶:
0T
The matrix R00 is a rotation matrix since R00T R00 = R0T RT RR0 = R0T R0 = Id
and Det(R00) = Det(R)Det(R0) = 1. Thus T 00 is a rigid transformation matrix.
To prove (b), note that T 00 = Id when R0 = RT and t0 = ¡RT t. This shows that
any rigid transformation admits an inverse and that this inverse is given by these
two equations.
2.4. Let AT denote the matrix associated with a rigid transformation T in the coordi-
nate system (A), with
AT =AR At
1¶:
0T
Construct the matrix BT associated with T in the coordinate system (B) as a
function of AT and the rigid transformation separating (A) and (B).
Solution Let P 0 = T P be the image of the point P under the mapping T .
Rewriting this equation in the frame (A) yields
AP 0 = AT AP;
or
A
BT BP 0 = AT A
BT BP :
In turn, this can be rewritten as
BP 0 = A
BT
¡1 AT A
BT BP = BT BP ;
or, since A
BT
¡1
= B
AT
AT AT A
It follows that an explicit expression for BT is
BT = B
BT :
BT =B
AR AR A
BR B
0T
AR AR AOB + B
1
AR At + BOA
¶:
课后答案网 www.khdaw.com