Projective transformation
From Wikipedia, the free encyclopedia
A projective transformation is a transformation used in projective geometry: it is the composition of a pair of perspective projections. It describes what happens to the perceived positions of observed objects when the point of view of the observer changes. Projective transformations do not preserve sizes or angles but do preserve incidence and cross-ratio: two properties which are important in projective geometry. A projective transformation can also be called a projectivity.
A projective transformation can be in the (real) one-dimensional projective line RP1, the two-dimensional projective plane RP2, and the three-dimensional projective 3-space RP3.
Contents |
[edit] Transformations on the projective line
Let X be a point on the x-axis. A projective transformation can be defined geometrically for this line by picking a pair of points P, Q, and a line m, all within the same x-y plane which contains the x-axis upon which the transformation will be performed.
Draw line l through points P and X. Line l crosses line m at point R. Then draw line n through points Q and R: line n will cross the x-axis at point T. Point T is the transform of point X [Paiva].
Points P and Q represent two different observers, or points of view. Point R is the position of some object they are observing. Line m is the objective world which they are observing, and the x-axis is the subjective perception of m.
[edit] Analysis
The above is a synthetic description of a one-dimensional projective transformation. It is now desired to convert it to an analytical (Cartesian) description.
Let point X have coordinates (x0,0). Let point P have coordinates (Px,Py). Let point Q have coordinates (Qx,Qy). Let line m have slope m (m is being overloaded in meaning).
The slope of line l is
- ,
so an arbitrary point (x,y) on line l is given by the equation
- ,
On the other hand, any point (x,y) on line m is described by
The intersection of lines l and m is point R, and it is obtained by combining equations (1) and (2):
Joining the x terms yields
and solving for x we obtain
x1 is the abscissa of R. The ordinate of R is
Now, knowing both Q and R, the slope of line n is
We want to find the intersection of line n and the x-axis, so let
The value of λ must be adjusted so that both sides of vector equation (3) are equal. Equation (3) is actually two equations, one for abscissas and one for ordinates. The one for ordinates is
- Qy + λ(y1 − Qy) = 0
Solve for lambda,
The equation for abscissas is
- x = Qx + λ(x1 − Qx)
which together with equation (4) yields
which is the abscissa of T.
Substitute the values of x1 and y1 into equation (5),
Dissolve the fractions in both numerator and denominator:
Simplify and relabel x as t(x):
t(x) is the projective transformation.
Transformation t(x) can be simplified further. First, add its two terms to form a fraction:
Then, define the coefficients α, β, γ and δ to be the following
- α = mQxPy − QyPy + bQy,
- β = bQxPy − bQyPx,
- γ = m(Py − Qy),
- δ = mPxQy + Py(b − Qy).
Substitute these coefficients into equation (6), in order to produce
This is the Möbius transformation or bilinear transformation (so called because it has a linear numerator and a linear denominator. Actually, it is bilinear because the composition of projections is a binary linear operator, similar to matrix multiplication).
[edit] Inverse transformation
It is clear from the synthetic definition that the inverse transformation is obtained by exchanging points P and Q. This can also be shown analytically. If P ↔ Q, then α → α′, β → β′, γ → γ′, and δ → δ′, where
- α' = mPxQy − PyQy + bPy = δ,
- β' = bPxQy − bPyQx = − β,
- γ' = m(Qy − Py) = − γ,
- δ' = mQxPy + bQy − QyPy = α.
Therefore if the forwards transformation is
then the transformation t′ obtained by exchanging P and Q (P ↔ Q) is:
Then
- .
Dissolve the fractions in both numerator and denominator of the right side of this last equation:
-
- .
Therefore t′(x) = t−1(x): the inverse projective transformation is obtained by exchanging observers P and Q, or by letting α ↔ δ, β → −β, and γ → −γ. This is, by the way, analogous to the procedure for obtaining the inverse of a two-dimensional matrix:
where Δ = α δ − β γ is the determinant.
[edit] Identity transformation
Also analogous with matrices is the identity transformation, which is obtained by letting α = 1, β = 0, γ = 0, and δ = 1, so that
- tI(x) = x.
[edit] Composition of transformations
It remains to show that there is closure in the composition of transformations. One transformation operating on another transformation produces a third transformation. Let the first transformation be t1 and the second one be t2:
The composition of these two transformations is
Define the coefficients α3, β3, γ3 and δ3 to be equal to
- α3 = α2α1 + β2γ1,
- β3 = α2β1 + β2δ1,
- γ3 = γ2α1 + δ2γ1,
- δ3 = γ2β1 + δ2δ1.
Substitute these coefficients into t2(t1(x)) to obtain
Projections operate in a way analogous to matrices. In fact, the composition of transformations can be obtained by multiplying matrices:
Since matrices multiply associatively, it follows that composition of projections is also associative.
Projections have: an operation (composition), associativity, an identity, an inverse and closure, so they form a group.
[edit] The cross-ratio defined by means of a projection
Let there be a transformation ts such that ts(A) = , ts(B) = 0, ts(C) = 1. Then the value of ts(D) is called the cross-ratio of points A, B, C and D, and is denoted as [A, B, C, D]s:
- [A,B,C,D]s = ts(D).
Let
then the three conditions for ts(x) are met when
Equation (7) implies that γA + δ = 0, therefore δ = − γA. Equation (8) implies that αB + β = 0, so that β = − αB. Equation (9) becomes
which implies
Therefore
In equation (10), it is seen that ts(D) does not depend on the coefficients of the projection ts. It only depends on the positions of the points on the "subjective" projective line. This means that the cross-ratio depends only on the relative distances among four collinear points, and not on the projective transformation which was used to obtain (or define) the cross-ratio. The cross ratio is therefore
[edit] Conservation of cross-ratio
Transformations on the projective line preserve cross ratio. This will now be proven. Let there be four (collinear) points A, B, C, D. Their cross-ratio is given by equation (11). Let S(x) be a projective transformation:
where . Then
Therefore [S(A) S(B) S(C) S(D)] = [A B C D], Q.E.D.
[edit] Transformations on the projective plane
Two-dimensional projective transformations are a type of automorphism of the projective plane onto itself.
Planar transformations can be defined synthetically as follows: point X on a "subjective" plane must be transformed to a point T also on the subjective plane. The transformations uses these tools: a pair of "observation points" P and Q, and an "objective" plane. The subjective and objective planes and the two points all lie in three-dimensional space, and the two planes can intersect at some line.
Draw line l1 through points P and X. Line l1 intersects the objective plane at point R. Draw line l2 through points Q and R. Line l2 intersects the projective plane at point T. Then T is the projective transform of X.
[edit] Analysis
Let the xy-plane be the "subjective" plane and let plane m be the "objective" plane. Let plane m be described by
- z = f(x,y) = mx + ny + b
where the constants m and n are partial slopes and b is the z-intercept.
Let there be a pair of "observation" points P and Q,
- P:(Px,Py,Pz),
- Q:(Qx,Qy,Qz).
Let point X lie on the "subjective" plane:
- X:(x,y,0).
Point X must be transformed to a point T,
- T:(Tx,Ty,0)
also on the "subjective" plane.
The analytical results are a pair of equations, one for abscissa Tx and one for ordinate Ty:
There are (at most) nine degrees of freedom for defining a 2D transformation: Px, Py, Pz, Qx, Qy, Qz, m, n, b. Notice that equations (12) and (13) have the same denominators, and that Ty can be obtained from Tx by exchanging m with n, and x with y (including subscripts of P and Q).
[edit] Trilinear transformations
Let
- α = − mQxPz − nQzPy + Qz(Pz − b),
- β = n(QzPx − QxPz),
- γ = b(QzPx − QxPz),
- δ = m(Qz − Pz),
- ε = n(Qz − Pz),
- ζ = − (mPx + nPy)Qz + (Qz − b)Pz,
so that
Also let
- η = m(QzPy − QyPz),
- θ = − mQzPx − nQyPz + Qz(Pz − b),
- κ = b(QzPy − QyPz),
so that
Equations (14) and (15) together describe the trilinear transformation.
[edit] Composition of trilinear transformations
If a transformation is given by equations (14) and (15), then such transformation is characterized by nine coefficients which can be arranged into a coefficient matrix
If there are a pair T1 and T2 of planar transformations whose coefficient matrices are and , then the composition of these transformations is another planar transformation T3,
such that
- T3(x,y) = T2(T1(x,y)).
The coefficient matrix of T3 can be obtained by multiplying the coefficient matrices of T2 and T1:
[edit] Proof
Given T1 defined by
and given T2 defined by
then T3 can be calculated by substituting T1 into T2,
Multiply numerator and denominator by the same trinomial,
Group the coefficients of x, y, and 1:
These six coefficients of T3 are the same as those obtained through the product
The remaining three coefficients can be verified thus
Multiply numerator and denominator by the same trinomial,
Group the coefficients of x, y, and 1:
The three remaining coefficients just obtained are the same as those obtained through equation (16). Q.E.D.
[edit] Planar transformations of lines
The trilinear transformation given be equations (14) and (15) transforms a straight line
- y = mx + b
into another straight line
- Ty = nTx + c
where n and c are constants and equal to
and
[edit] Proof
Given y = m x + b, then plugging this into equations (14) and (15) yields
and
If Ty = n Tx + c and n and c are constants, then
so that
Calculation shows that
and
therefore
We should now obtain c to be
- c = Ty − nTx
-
Add the two fractions in the numerator:
Distribute binomials in parentheses in the numerator, then cancel out equal and opposite terms:
Factor the numerator into a pair of terms, only one of them having the numerus cossicus (x). There is another numerus cossicus in the denominator. The objective now is to get both of these to cancel out.
Factor the numerator,
The terms with the numeri cossici cancel out, therefore
is a constant. Q.E.D.
Comparing c with n, notice that their denominators are the same. Also, n is obtained from c by exchanging the following coefficients:
There is also the following exchange symmetry between the numerator and denominator of n:
The numerator and denominator of c also have exchange symmetry:
The exchange symmetry between n and c can be chunked into binomials:
All of these exchange symmetries amount to exchanging pairs of rows in the coefficient matrix.
[edit] Planar transformations of conic sections
A trilinear transformation such as T given by equations (14) and (15) will convert a conic section
into another conic section
[edit] Proof
Let there be given a conic section described by equation (17) and a planar transformation T described by equations (15) and (16) which converts points (x,y) into points (Tx,Ty).
It is possible to find an inverse transformation T′ which converts back points (Tx,Ty) to points (x,y). This inverse transformation has a coefficient matrix
Equation (17) can be expressed in terms of the inverse transformation:
The denominators can be "dissolved" by multiplying both sides of the equation by the square of a trinomial:
- A(α'Tx + β'Ty + γ')2 + B(η'Tx + θ'Ty + κ')2 + C(α'Tx + β'Ty + γ')(δ'Tx + ε'Ty + ζ') + D(η'Tx + θ'Ty + κ')(δ'Tx + ε'Ty + ζ') + E(α'Tx + β'Ty + γ')(η'Tx + θ'Ty + κ') + F(δ'Tx + ε'Ty + ζ')2 = 0.
Expand the products of trinomials and collect common powers of Tx and Ty:
Equation (19) has the same form as equation (18).
What remains to do is to express the primed coefficients in terms of the unprimed coefficients. To do this, apply Cramer's rule to the coefficient matrix MT to obtain the primed matrix of the inverse transformation:
where Δ is the determinant of the unprimed coefficient matrix.
Equation (20) allows primed coefficients to be expressed in terms of unprimed coefficients. But performing these substitutions on the primed coefficients of equation (19) it can be noticed that the determinant Δ cancels itself out, so that it can be ignored altogether. Therefore
- A' = A(θζ − κε)2 + B(κδ − ηζ)2 + C(θζ − κε)(ηε − θδ) + D(κδ − ηζ)(ηε − θδ) + E(θζ − κε)(κδ − ηζ) + F(ηε − θδ)2
- B' = A(εγ − ζβ)2 + B(ζα − δγ)2 + C(εγ − ζβ)(δβ − εα) + D(ζα − δγ)(δβ − εα) + E(εγ − ζβ)(ζα − δγ) + F(δβ − εα)2
- C' = 2A(θζ − κε)(βκ − γθ) + 2B(κδ − ηζ)(γη − ακ) + C[(θζ − κε)(αθ − βη) + (βκ − γθ)(ηε − θδ)] + D[(κδ − ηζ)(αθ − βη) + (γη − ακ)(ηε − θδ)] + E[(θζ − κε)(γη − ακ) + (βκ − γθ)(κδ − ηζ)] + 2F(ηε − θδ)(αθ − βη)
- D' = 2A(εγ − ζβ)(βκ − γθ) + 2B(ζα − δγ)(γη − ακ) + C[(εγ − ζβ)(αθ − βη) + (βκ − γθ)(δβ − εα)] + D[(ζα − δγ)(αθ − βη) + (γη − ακ)(δβ − εα)] + E[(εγ − ζβ)(γη − ακ) + (βκ − γθ)(ζα − δγ)] + 2F(δβ − εα)(αθ − βη)
- E' = 2A(θζ − κε)(εγ − ζβ) + 2B(κδ − ηζ)(ζα − δγ) + C[(θζ − κε)(δβ − εα) + (εγ − ζβ)(ηε − θδ)] + D[(κδ − ηζ)(δβ − εα) + (ζα − δγ)(ηε − θδ)] + E[(θζ − κε)(ζα − δγ) + (εγ − ζβ)(κδ − ηζ)] + 2F(ηε − θδ)(δβ − εα)
- F' = A(βκ − γθ)2 + B(γη − ακ)2 + C(βκ − γθ)(αθ − βη) + D(γη − ακ)(αθ − βη) + E(βκ − γθ)(γη − ακ) + F(αθ − βη)2
The coefficients of the transformed conic have been expressed in terms of the coefficients of the original conic and the coefficients of the planar transformation T. Q.E.D.
[edit] Planar projectivities and cross-ratio
Let four points A, B, C, D be collinear. Let there be a planar projectivity T which transforms these points into points A′, B′, C′, and D′. It was already shown that lines are transformed into lines, so that the transformed points A′ through D′ will also be collinear. Then it will turn out that the cross-ratio of the original four points is the same as the cross-ratio of their transforms:
[edit] Proof
If the two-dimensional coordinates of four points are known, and if the four points are collinear, then their cross-ratio can be found from their abscissas alone. It is possible to project the points onto a horizontal line by means of a pencil of vertical lines issuing from a point on the line at infinity:
The same is true for the ordinates of the points. The reason is that any mere rescaling of the coordinates of the points does not change the cross-ratio.
Let
- A:(x1,mx1 + b),
- B:(x2,mx2 + b),
- C:(x3,mx3 + b),
- D:(x4,mx4 + b).
Clearly these four points are collinear. Let
be the first half of a trilinear transformation. Then
The original cross-ratio is
It is not necessary to calculate the transformed cross-ratio. Just let
be a bilinear transformation. Then S(x) is a one-dimensional projective transformation. But Tx(A)=S(A), Tx(B)=S(B), Tx(C)=S(C), and Tx(D)=S(D). Therefore
but it has already been shown that bilinear transformations preserve cross-ratio. Q.E.D.
[edit] Example
The following is a rather simple example of a planar projectivity:
The coefficient matrix of this projectivity T is
and it is easy to verify that MT is its own inverse.
The locus of points described parametrically as describe a circle, due to the trigonometric identity
- cos2θ + sin2θ = 1
which has the same form as the canonical equation of a circle. Applying the projectivity T yields the locus of points described parametrically by which describe a hyperbola, due to the trigonometric identity
- sec2θ − tan2θ = 1
which has the same form as the canonical equation of a hyperbola. Notice that points and (1,0) are fixed points.
Indeed, this projectivity transforms any circle, of any radius, into a hyperbola centered at the origin with both of its foci lying on the x-axis, and vice versa. This projectivity also transforms the y-axis into the line at infinity, and vice versa:
The ratio of infinity over infinity is indeterminate which means that it can be set to any value y desired.
This example emphasizes that in the real projective plane, RP2, a hyperbola is a closed curve which passes twice through the line at infinity. But what does the transformation do to a parabola?
Let the locus of points (x,x2) describe a parabola. Its transformation is
which is a hyperbola whose asymptotes are the x-axis and the y-axis and whose wings lie in the first quadrant and the third quadrant. Likewise, the hyperbola
is transformed by T into the parabola
- .
On the other hand, the parabola described by the locus of points is transformed by T into itself: this demonstrates that a parabola intersects the line at infinity at a single point.
[edit] Transformations in projective 3-space
Three-dimensional transformations can be defined synthetically as follows: point X on a "subjective" 3-space must be transformed to a point T also on the subjective space. The transformations uses these elements: a pair of "observation points" P and Q, and an "objective" 3-space. The subjective and objective spaces and the two points all lie in four-dimensional space, and the two 3-spaces can intersect at some plane.
Draw line l1 through points X and P. This line intersects the objective space at point R. Draw line l2 through points R and Q. Line l2 intersects the projective plane at point T. Then T is the transform of X.
[edit] Analysis
Let
- X:(x,y,z,0),
- T:(Tx,Ty,Tz,0),
- P:(Px,Py,Pz,Pt),
- Q:(Qx,Qy,Qz,Qt).
Let there be an "objective" 3-space described by
- t = f(x,y,z) = mx + ny + kz + b
Draw line l1 through points P and X. This line intersects the objective plane at R. This intersection can be described parametrically as follows:
- (1 − λ1)X + λ1P = (Rx,Ry,Rz,mRx + nRy + kRz + b).
This implies the following four equations:
- Rx = x + λ1(Px − x)
- Ry = y + λ1(Py − y)
- Rz = z + λ1(Pz − z)
- Rt = λ1Pt = mRx + nRy + kRz + b
Substitute the first three equations into the last one:
- (mx + ny + kz) + λ1(mPx + nPy + kPz − mx − ny − kz − Pt) + b = 0
Solve for λ1,
Draw line l2 through points R and Q. This line intersects the subjective 3-space at T. This intersection can be represented parametrically as follows:
- (1 − λ2)R + λ2Q = (Tx,Ty,Tz,0)
This implies the following four equations:
- Tx = Rx + λ2(Qx − Rx),
- Ty = Ry + λ2(Qy − Ry),
- Tz = Rz + λ2(Qz − Rz),
- Rt + λ2(Qt − Rt) = 0.
The last equation can be solved for λ2,
which can then be substituted into the other three equations:
Substitute the values for Rx, Ry, Rz, and Rt obtained from the first intersection into the above equations for Tx, Ty, and Tz,
Multiply both numerators and denominators of the above three equations by the denominator of lambda1: λ1D,
Plug in the values of the numerator and denominator of lambda1:
- λ1N = b + mx + ny + kz
- λ1D = Pt + m(x − Px) + n(y − Py) + k(z − Pz)
to obtain
- ,
- TyN = (b + mx + ny + kz)[PtQy − Qt(Py − y)] − yQt[Pt + m(x − Px) + n(y − Py) + k(z − Pz)],
- .
The numerator TxN can be expanded. It will be found that second-degree terms of x, y, and z will cancel each other out. Then collecting terms with common x, y, and z yields
- TxN = x(mPtQx + nPyQt + kPzQt + Qt(b − Pt)) + yn(PtQx − PxQt) + zk(PtQx − PxQt) + b(PtQx − PxQt)
Likewise, the denominator becomes
- TxD = (mx + ny + kz)(Pt − Qt) + (mPx + nPy + kPz)Qt + Pt(b − Qt).
The numerator TyN, when expanded and then simplified, becomes
- TyN = xm(PtQy − PyQt) + y(mPxQt + nPtQy + kPzQt + Qt(b − Pt)) + zk(PtQy − PyQt) + b(PtQy − PyQt).
Likewise, the numerator TzN becomes
- TzN = xm(PtQz − PzQt) + yn(PtQz − PzQt) + z(mPxQt + nPyQt + kPtQz + Qt(b − Pt)) + b(PtQz − PzQt).
[edit] Quadrilinear transformations
Let
- α = mPtQx + nPyQt + kPzQt + Qt(b − Pt),
- β = n(PtQx − PxQt),
- γ = k(PtQx − PxQt),
- δ = b(PtQx − PxQt),
- ε = m(Pt − Qt),
- ζ = n(Pt − Qt),
- η = k(Pt − Qt),
- θ = (mPx + nPy + kPz)Qt + Pt(b − Qt),
- ι = m(PtQy − PyQt),
- κ = mPxQt + nPtQy + kPzQt + Qt(b − Pt),
- λ = k(PtQy − PyQt),
- μ = b(PtQy − PyQt),
- ν = m(PtQz − PzQt),
- ξ = n(PtQz − PzQt),
- o = mPxQt + nPyQt + kPtQz + Qt(b − Pt),
- ρ = b(PtQz − PzQt).
Then the transformation in 3-space can be expressed as follows,
The sixteen coefficients of this transformation can be arranged in a coefficient matrix
Whenever this matrix is invertible, its coefficients will describe a quadrilinear transformation.
Transformation T in 3-space can also be represented in terms of homogeneous coordinates as
This means that the coefficient matrix of T can operate directly on 4-component vectors of homogeneous coordinates. Transformation of a point can be effected simply by multiplying the coefficient matrix with the position vector of the point in homogeneous coordinates. Therefore, if T transforms a point on the plane at infinity, the result will be
If ε, ζ, and η are not all equal to zero, then T will transform the plane at infinity into a locus of points which lie mostly in affine space. If ε, ζ, and η are all zero, then T will be a special kind of projective transformation called an affine transformation, which transforms affine points into affine points and ideal points (i.e. points at infinity) into ideal points.
The group of affine transformations has a subgroup of affine rotations whose matrices have the form
such that the submatrix
is orthogonal.
[edit] Properties of quadrilinear transformations
Given a pair of quadrilinear transformations T1 and T2, whose coefficient matrices are and , then the composition of these pair of transformations is another quadrilinear transformation T3 whose coefficient matrix is equal to the product of the first and second coefficient matrices,
The identity quadrilinear transformation TI is the transformation whose coefficient matrix is the identity matrix.
Given a spatial projectivity T1 whose coefficient matrix is , the inverse of this projectivity is another projectivity T−1 whose coefficient matrix is the inverse of T1′s coefficient matrix,
- .
Composition of quadrilinear transformations is associative, therefore the set of all quadrilinear transformations, together with the operation of composition, form a group.
This group of quadrilinear transformations contains subgroups of trilinear transformations. For example, the subgroup of all quadrilinear transformations whose coefficient matrices have the form
is isomorphic to the group of all trilinear transformations whose coefficient matrices are
This subgroup of quadrilinear transformations all have the form
This means that this subgroup of transformations will act on the plane z = 0 just like a group of trilinear transformations.
[edit] Spatial transformations of planes
Projective transformations in 3-space transform planes into planes. This can be demonstrated more easily using homogeneous coordinates.
Let
- z = mx + ny + b
be the equation of a plane. This is equivalent to
Equation (21) can be expressed as a matrix product:
A permutation matrix can be interposed between the two vectors, in order to make the plane vector have homogeneous coordinates:
A quadrilinear transformation should convert this to
where
Equation (22) is equivalent to where
- etc.
Applying equation (24) to equation (25) yields
Combining equations (26) and (23) produces
Solve for [Tm:Tn:Tb:1]T,
Equation (27) describes how 3-space transformations convert a plane (m, n, b) into another plane (Tm, Tn, Tb) where