3D Transformation PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

534 APPENDIX C APPENDIX C 535

Calculation of residual matrix V gives the following:

FIGURE C-5
XYZ and xyz right-handed three-dimensional
Since all the residuals have small magnitudes, the solution is deemed acceptable coordinate systems.
and the transformed coordinates of points 1,2, and 3 are then computed as follows:

transformation equations can be expressed in terms of seven independent parameters: the


three rotation angles omega (w), phi (4). and kappa ( K ) ; a scale factors; and three trans-
lation parameters T,, T,, and T,. Before proceeding with the development of the trans-
formation equations, it is important to define sign conventions. All coordinates shall be
defined as right-handed, i.e., systems in which positive X, Y, and Z are as shown in
Fig. C-5. Rotation angles w, 4 , and K are positive if they are counterclockwise when
viewed from the positive end of their respective axes. For example, positive w rotation
about the x' axis, is shown in Fig. C-5.
The transformation equations will be developed in the following two basic steps:
In computing affine transformations, it is strongly recommended that more than
( I ) rotation and (2) scaling and translation.
the minimum number of common points be used, and that the solution be obtained by
least squares. In addition to other benefits, least squares can reveal the presence of mea-
surement mistakes through calculation of residuals. Step 1: Rotation
In Fig. C-5 an x'y'z' coordinate system parallel to the XYZ object system is constructed
C-7 THREE-DIMENSIONAL CONFORMAL with its origin at the origin of the xyz system. In the development of rotation formulas,
COORDINATE TRANSFORMATION it is customary to consider the three rotations as taking place so as to convert from the
x'y'z' system to the xyz system. The rotation equations are developed in a sequence of
As implied by its name, a three-dimensional conformal coordinate transformation three independent two-dimensional rotations. These rotations, illustrated in Fig. C-6,
involves converting from one three-dimensional system to another. In the transfor- are, first, w rotation about the x' axis which converts coordinates from the x'y'z' system
mation, true shape is retained. This type of coordinate transformation is essential in to an xly,z, system; second, 4 rotation about the once-rotated 4, axis which converts co-
analytical or computational photogrammetry for two basic problems: (1) to transform ordinates from the xlylz, system to an .r,y,z2 system; and third, K rotation about the
arbitrary stereomodel coordinates to a ground or object space system and (2) to form twice-rotated z, axis which converts coordinates from the x,y2z2 system to the xyz
continuous three-dimensional "strip models" from independent stereomodels. Three- system of Fig. C-5. The exact amount and direction of the rotations for any three-
dimensional conformal coordinate transformation equations are developed here in dimensional coordinate transformation will depend upon the orientation relationship
general, while their application to specific photogrammetry problems is described between the .vz and XYZ coordinate systems.
elsewhere in the text where appropriate. The development of the rotation formulas is as follows:
In Fig. C-5 it is required to transform coordinates of points from an xyz system
to an XYZ system. As illustrated in the figure, the two coordinate systems are at diff- 1. Rotation through the angle w about the x' axis is illustrated in Fig. C-7. The coor-
erent scales, they are not parallel, and their origins do not coincide. The necessary dinates of any point A in the once-rotated x,y,z, system, as shown graphically in
APPENDIX C 539

where

The matrix M is commonly called the rotation matrix. The individual elements of
the rotation matrix are direction cosines which relate the two axis systems. These matrix
elements, expressed in terms of direction cosines, are

FIGURE C-9
cos xr' cos xyf cos .xzf
cos yx' cos yy' cos yz'
COS a' COS zyr COS zz' I (C-35)

In the above matrix, cos xr' is the direction cosine relating the x and x' axes, cos xy' re-
lates the x and y' axes, etc. Direction cosines are simply the cosines of the angles in
I\ Kappa rotation about the z2 axis.
space between the respective axes, the angles being taken between 0" and 180". It is an
important property that the sum of the squares of the three direction cosines in any row
o r in any column is unity. This property may be used to check the computed elements of
Factoring Eqs. (C-30) gives the rotation matrix for correctness.
The rotation matrix is an orthogonal matrix, which has the property that its in-
+
x = x' (cos 4 cos K) y' (sin w sin 4 cos K + cos o sin K) verse is equal to its transpose, or
+ zl(-cos o sin 4 cos K + sin w sin K)
y = x f ( - c o s 4 s i n ~ ) + y ' ( - S ~ ~ W ~ ~ ~ ~ ~ ~ ~ K + C O (C-31)
SWCOSK) By using this property, Eq. (C-34) may rewritten, expressing x'y'z' coordinates in terms
+ +
zl(cos w sin 4 sin K sin o cos K) of xyz coordinates as follows:
z = xl(sin 4 ) + yl(-sin w cos 4 ) + z' (cos o cos 4 ) X' = M ' X (C-37)
Substituting m's for the coefficients of x', y', and z' in Eqs. (C-31) gives In expanded form this equation is:

x = mllxf + mI2yr+ mI3z1


y = m2,xf + m,y' + m2,z1 (C-32)

z = m3,x1 + m3,yr + m33~'

where m,, = cos 4 cos K Step 2: Scaling and Translation


m,, = sin o sin 4 cos K + cos w sin K To arrive at the final three-dimensional coordinate transformation equations, i.e., equa-
+
m,, = -cos w sin 4 cos K sin w sin K tions that yield coordinates in the XYZ system of Fig. C-5, it is necessary to multiply
m,, = -cos 4 sin K each of Eqs. (C-38) by a scale factors and to add the translation factors T,, Ty, and T,.
m,, = -sin w sin 4 sin K + cos w cos K [Recall that the x'y'z' coordinates given by Eqs. (C-38) are in a system that is parallel
m,, = cos w sin 4 sin K +
sin w cos K the X Y Z system.] This step makes the lengths of any lines equal in both coordinate
systems, and it translates from the origin of x'y'z' to the origin of the XYZ system.
m,, = sin 4
Performing this step yields
m,, = -sin w cos 4
m33 = cos w cos 4 X = sx' + Tx = s(m,,x + m,,y + m3,z) + Tx
Equations (C-32) may be expressed in matrix form as Y = sy' + T, = s ( r n , ~+ m,,y + rn,,z) + T y (C-39)
X = MX' Z = sz' + T, = s(rn,,x + m,,y + m,,z) + T,
In matrix form, Eqs. (C-39) are In Eqs. (C-41), (X,),, (Y,),, and (Z,), are the right-hand sides of Eqs. (C-39) eval-
X = sMTX+ T (C-40) uated at the initial approximations; (aX,/ds),, (aXP/aw),, etc., are the partial deriva-

[:]
tives with respect to the indicated unknowns evaluated at the initial approximations; and
In Eq. (C-40), matrices M and X are as previously defined, s is the scale factor, and , dTy,and dT, are corrections to the initial approximations which will
ds, dw, d 4 , d ~dTx,

i = and T= [$] be computed during the solution. The units of dw, d 4 , and d~ are radians.
Substituting letters for partial derivative coefficients, adding residuals to make the
equations suitable for a least squares solution, and rearranging terms, the following
equations result.
In Eqs. (C-39), the nine m's are not independent of one another, but rather, as seen
in Eqs. (C-33), they are functions of the three rotation angles w, 4 , and K . In addition to
these three unknown angles, there are three unknown translations and one scale factor a,, ds + a,,dw + a,, d$ + a,, d~ + aZsdTx + aZ6dTY + a,, dTz = [Y, - (Y,),] + vyp
in Eqs. (C-39), for a total of seven unknowns. A unique solution is obtained for the un-
knowns if the x and y coordinates of two horizontal points and the z coordinates of three f l , ~ds a32 dw f fl3, d$ + a,, d~ + 035 dTx + fl,, dTy + a37 dTz = [Zp - (Zp),] f vzp

vertical points are known in both coordinate systems. If more than the minimum of (C-42)
seven coordinates are known in both systems, redundant equations may be written,
which makes possible an improved solution through least squares techniques. To clarify the coefficients of Eqs. (C-42), the partial derivative terms, which must be
Solution of the three-dimensional conformal coordinate transformation is more evaluated at the initial approximations, are as follows:
complex than that of the two-dimensional transformations presented earlier in this ap-
pendix. This added complexity is due to the fact that Eqs. (C-39) are nonlinear in terms
of the unknowns s, w ,4 , and K. While it is possible to directly compute values for the a,, = 0
translation factors since their terms exist in a linear form, it is more convenient to treat
them as if they appeared in a nonlinear form. To solve these equations, they are
a,, = [(-sin 4 cos K)xp + sin 4 sin K (yp) + cos 4 ( ~ p ) l s
linearized by using a Taylor series expansion including only the first-order terms. Ap- = (m21xP - mll~P)s
plication of Taylor's series requires that initial approximations be obtained for each of
the seven unknowns. Each point P contributes as many as three equations (two if the a,, = a,, = a,, = 1
point is horizontal only and one if the point has just vertical control) which are
a I 6 = a,, = az5 = a2, = = a36= 0
linearized as shown in Eqs. (C-41).
= m ~ 2 x+
~ n122y~+ m3zz~
02, = (-m,,xp - m23yp - m33zp)x
a2, = [(sin w cos + cos K)x, + (-sin w cos 4 sin K)y, + (sin w sin 4 ) zp]s

In a least squares solution, each point contributes up to three rows of coefficients to the
A matrix, as well as terms in the L and Vmatrices. In general, assuming points 1,2, . . . ,n
are three-dimensional control points, the following matrix equation results:
542 APPENDIX c APPENDIX C 543

where corrections get larger with each subsequent iteration instead of smaller), or the solu-
tion may converge to an erroneous set of transformation parameters. In cases involv-
ing stereomodels formed from near-vertical photography, o and 4 may be assumed to
be zero. An approximation for K may be determined from the difference in azimuths
of a common line in both systems, and an approximation for s may be determined
from the ratio of the lengths of a common line. Approximations for the translation
factors may then be found by rearranging Eqs. (C-39) so that T,, T,, and T, are iso-
lated on the left side. By using previously determined initial approximations for s, o,
4, and K , and the coordinates of a common point on the right-hand side, initial ap-
proximations for the translations may thus be determined. When the assumption of
near-vertical photography is invalid, such as when one is dealing with' terrestrial pho-
tography, an alternative method must be used. The reader may consult Dewitt (1996)
in the references for a description of this technique.

C-8 TWO-DIMENSIONAL PROJECTIVE


COORDINATE TRANSFORMATION
Two-dimensional projective transformation equations enable the analytical computa-
tion of the XY coordinates of points after they have been projected onto a plane from an-
other nonp&allel plane. The most common use of these equations is in analytical recti-
fication, i.e., calculating coordinates of points in a rectified-ratioed photo plane based
upon their coordinates in a tilted photograph. This situation is illustrated in Fig. C-10. In
the figure, a tilted photo with its xy fiducial coordinate axis system (shown in the plane
of the photo) is illustrated. The fiducial coordinates of the principal point o arexoyo. The
projection center (the origin of the x'y'z' system) is at L, which is on the end of a per-
pendicular to the photo plane from point o, such as Lo = f. The x'y' axes are parallel to
the fiducial xy axes. The projection of points a, b, c, and d from the tilted photo onto the
plane of the rectified-ratioed photo occurs as A, B, C, and D, respectively. Positions of
Equation (C-43) may be solved by using 1least squares Eq. (B-.I l), giving corrections projected points in the rectified-ratioed photo plane are expressed in the XYZ coordinate
which are then added to the initial approximations for the unknowns, resulting in a bet- system shown in the figure.
ter set of approximations. The solution must be iterated (since only the first-order terms In a simplified development of the equations for the two-dimensional projective
of Taylor's series were used) until negligibly small values are obtained in matrix X. transformation, an X'Y'Z' coordinate system is adopted which is parallel to the XYZsys-
Other techniques of testing for the convergence of an iterative solution, such as conver- tem and has its origin at L. Using Eqs. (C-32), which were developed in the preceding
gence of the computed estimate of the standard deviation of unit weight [see Eq. (B-15) section, the x'y'z' coordinates of any point, such a s p of Fig. C-10, can be expressed in
for an unweighted adjustment or Eq. (B-16) for a weighted adjustment], may also be terms of X'Y'Z' coordinates as follows:
used. The reader may consult references listed at the end of this appendix for a discus- xi = + m,,Yl, + m13Zi
m,,Xi
sion of these convergence techniques.
Once the solution has reached satisfactory convergence, the latest approximations y; = mzlX; + rn,,Yl, + rn2,z; (C-4.4)
for the unknowns are the values for the transformation parameters. Then the trans- zl, = m31Xi+ m3,Yi + m3,Zi
formed coordinates for each point whose coordinates are known only in the original sys-
tem are obtained by applying Eqs. (C-39). In Eqs. (C-44), the m's are functions of the rotation angles omega, phi, and kappa which
In solving nonlinear equations using Taylor's theorem, it is important that good define the tilt relationships between the two plane coordinate systems xy and XY. These
initial approximations be obtained. If approximations are chosen that are not ieason- functions are described in the preceding section. The other terms in Eqs. (C-44) are
ably close to the final computed values, the solution will generally diverge (i.e., the coordinates as previously described. Consider now Fig. C-1 I, which shows the parallel

You might also like