Yankun Yang

An Invitation to 3-D Vision: Appendix A

Algebra is very generous: she often gives more than is asked for.

Jean d'Alembert

We assume that the reader already has basic training in linear algebra. 1 This appendix provides a brief review of some of the important facts that are used in this book. For a more complete introduction, the reader should resort to a book such as [Strang, 1988].

In this book, we deal mostly with finite-dimensional (typically two-, three-, or four-dimensional) linear spaces, which are also often called linear vector spaces. For generality, we consider the linear space to be n -dimensional. A linear space is typically denoted by the letter V (for "vector space"). Although most of the time we will deal with vectors of real numbers ℝ , occasionally, we will encounter vectors of complex numbers 2ℂ . For simplicity, our review will be conducted for linear spaces over the field ℝ of real numbers with the understanding that most definitions and results generalize to the complex case with little change.

Definition A. 1 (A linear space or a vector space). A set (of vectors) V is considered a linear space over the field ℝ if its elements, called vectors, are closed under two basic operations: scalar multiplication and vector summation "+." That is, given any two vectors v1,v2∈V and any two scalars α,β∈ℝ , the linear combination v=αv1+βv2 is also a vector in V . Furthermore, the addition is commutative and associative, it has an identity 0, and each element has an inverse,"-v," such that v+(−v)=0 . The scalar multiplication respects the structure of ℝ ; i.e. α(β)v=(αβ)v,1v=v and 0v=0 . The addition and scalar multiplication are related by the distributive laws: (α+β)v=αv+βv and α(v+u)=αv+αu .


1 Some familiarity with the numerical software Matlab is also encouraged.

2 For instance, the eigenvalues or eigenvectors of a real matrix could be complex.


For example, ℝn is a linear space over the field of real numbers ℝ . To be consistent, we always use a column to represent a vector:

[x1,x2,…,xn]T=[x1x2⋮xn]∈ℝn,\tagA.1

where [x1,x2,…,xn]T means "the (row) vector [x1,x2,…,xn] transposed." Given two scalars α,β∈ℝ and two vectors v1=[x1,x2,…,xn]T∈ℝn and v2=[y1,y2,…,yn]T∈ℝn , their linear combination is a componentwise summation weighted by α and β :

αv1+βv2=α[x1,x2,…,xn]T+β[y1,y2,…,yn]T=[αx1+βy1,αx2+βy2,…,αxn+βyn]T.

A.1 Basic notions associated with a linear space

We will now provide a brief review of basic notions and frequently used notation associated with a linear vector space V (i.e. ℝn ).

A.1.1 Linear independence and change of basis

Definition A. 2 (Subspace). A subset W of a linear space V is called a subspace if the zero vector 0 is in W and αw1+βw2∈W for all α,β∈ℝ and w1,w2∈W .

Definition A. 3 (Spanned subspace). Given a set of vectors S={vi}i=1m , the subspace spanned by S is the set of all finite linear combinations ∑i=1mαivi for all α1,α2,…,αm∈ℝ . This subspace is usually denoted by span(S) .

For example, the two vectors v1=[1,0,0]T and v2=[1,1,0]T span a subspace of ℝ3 whose vectors are of the general form v=[x,y,0]T .

Definition A. 4 (Linear independence). A set of vectors S={vi}i=1m is linearly independent if the equation

α1v1+α2v2+⋯+αmvm=0

implies

α1=α2=⋯=αn=0.

On the other hand, a set of vectors {vi}i=1m is said to be linearly dependent if there exist α1,α2…,αm∈ℝ not all zero such that

α1v1+α2v2+⋯+αmvm=0.

Definition A. 5 (Basis). A set of vectors B={bi}i=1n of a linear space V is said to be a basis if B is a linearly independent set and B spans the entire space V ; i.e. V=span(B) .

Fact A. 6 (Properties of a basis). Suppose B and B′ are two bases for a linear space V . Then:

  1. B and B′ contain exactly the same number of linearly independent vectors. This number, say n , is the dimension of the linear space V .

  2. Let B={bi}i=1n and B′={bi′}i=1n . Then each basis vector of B can be expressed as a linear combination of those in B′ ; i.e.

bj=a1jb1′+a2jb2′+⋯+anjbn′=∑i=1naijbi′,\tagA.2

for some aij∈ℝ,i,j=1,2,…,n .

  1. Any vector v∈V can be written as a linear combination of vectors in either of the bases:
v=x1b1+x2b2+⋯+xnbn=x1′b1′+x2′b2′+⋯+xn′bn′,\tagA.3

where the coefficients {xi∈ℝ}i=1n and {xi′∈ℝ}i=1n are uniquely determined and are called the coordinates of v with respect to each basis.

In particular, if B and B′ are two bases for the linear space ℝn , we may put the basis vectors as columns of two n×n matrices and also call them B and B′ , respectively:

B≐[b1,b2,…,bn],B′≐[b1′,b2′,…,bn′]∈ℝn×n.\tagA.4

Then we can express the relationship between them in the matrix form B=B′A as

[b1,b2,…,bn]=[b1′,b2′,…,bn′][a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮an1an2⋯ann].\tagA.5

The role of the n×n matrix A is to transform one basis (B′) to the other (B) . Since such a transformation can go the opposite way, the matrix A must be invertible. So we can also write B′=BA−1 .

If v is a vector in V , it can be expressed in terms of linear combinations of either basis as

v=x1b1+x2b2+⋯+xnbn=x1′b1′+x2′b2′+⋯+xn′bn′.\tagA.6

Thus, we have

v=[b1,b2,…,bn][x1x2⋮xn]=[b1′,b2′,…,bn′][a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮an1an2⋯ann][x1x2⋮xn].

Since the coordinates of v with respect to B′ are unique, we obtain the following transformation of coordinates of a vector from one basis to the other:

[x1′x2′⋮xn′]=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮an1an2⋯ann][x1x2⋮xn]\tagA.7

Let x=[x1,x2,…,xn]T∈ℝn and x′=[x1′,x2′,…,xn′]T∈ℝn denote the two coordinate vectors. We may summarize in matrix form the relationships between two bases and coordinates with respect to the bases as

B′=BA−1,x′=Ax.\tagA.8

Be aware of the difference in transforming bases from transforming coordinates!

A.1.2 Inner product and orthogonality

Definition A. 7 (Inner product). A function

⟨·,·⟩:ℝn×ℝn→ℝ

is an inner product 3 if

  1. ⟨u,αv+βw⟩=α⟨u,v⟩+β⟨u,w⟩,∀α,β∈ℝ,

  2. ⟨u,v⟩=⟨v,u⟩ ,

  3. ⟨v,v⟩≥0 , and ⟨v,v⟩=0⇔v=0 .

For each vector v,⟨v,v⟩ is called its norm.

The inner product is also called a metric, since it can be used to measure length and angles.

For simplicity, a standard basis is often chosen for the vector space ℝn as the set of vectors

e1=[1,0,0,…,0]T,e2=[0,1,0,…,0]T,en=[0,0,…,0,1]T.\tagA.9

The matrix I=[e1,e2,…,en] with these vectors as columns is exactly the n×n identity matrix.


3 In some literature, an inner product is also called a dot product, denoted by u·v . However, in this book, we will not use that name.


Definition A. 8 (Canonical inner product on ℝn ). Given any two vectors x=[x1,x2,…,xn]T and y=[y1,y2,…,yn]T in ℝn , we define the canonical inner product to be

⟨x,y⟩≐xTy=x1y1+x2y2+⋯+xnyn.\tagA.10

This inner product induces the standard 2-norm, or Euclidean norm, ∥·∥2 , which measures the length of each vector as

∥x∥2≐xTx=x12+x22+⋯+xn2.\tagA.11

Notice that if we choose another basis B′ related to the above standard basis I as I=B′A , then the coordinates of the vectors x,y related to the new basis are x′ and y′ , respectively, and they relate to x,y by x′=Ax and y′=Ay . The inner product in terms of the new coordinates becomes

⟨x,y⟩=xTy=(A−1x′)T(A−1y′)=(x′)TA−TA−1(y′).\tagA.12

We denote this expression of the inner product with respect to the new basis by

⟨x′,y′⟩A−TA−1≐(x′)TA−TA−1(y′).\tagA.13

This is called an induced inner product from the matrix A . Knowing the matrix A−TA−1 , we can compute the canonical inner product directly using coordinates with respect to the nonstandard basis B′ .

Definition A. 9 (Orthogonality). Two vectors x,y are said to be orthogonal if their inner product is zero: ⟨x,y⟩=0 . This is often indicated as x⊥y .

A.1.3 Kronecker product and stack of matrices

Definition A. 10 (Kronecker product of two matrices). Given two matrices A∈ℝm×n and B∈ℝk×l , their Kronecker product, denoted by A⊗B , is a new matrix

A⊗B≐[a11Ba12B⋯a1nBa21Ba22B⋯a2nB⋮⋮⋱⋮am1Bam2B⋯amnB]∈ℝmk×nl.\tagA.14

If A and B are two vectors, i.e. n=l=1 , the product A⊗B is also a vector but of dimension mk .

In Matlab, one can easily compute the Kronecker product by using the command C=kron(A,B) .

Definition A. 11 (Stack of a matrix). Given an m×n matrix A∈ℝm×n , the stack of the matrix A is a vector, denoted by As , in ℝmn obtained by stacking its n column vectors, say a1,a2,…,an∈ℝm , in order:

As≐[a1a2⋮an]∈ℝmn.\tagA.15

As mutually inverse operations, As is called A "stacked," and A is called As "unstacked."

The Kronecker product and stack of matrices together allow us to rewrite algebraic equations that involve multiple vectors and matrices in many different but equivalent ways. For instance, the equation

uTAv=0\tagA.16

for two vectors u,v and a matrix A of proper dimensions can be rewritten as

(v⊗u)TAs=0.\tagA.17

The second equation is particularly useful when A is the only unknown in the equation.

A.2 Linear transformations and matrix groups

Linear algebra studies the properties of the linear transformations, or linear maps, between different linear spaces. Since such transformations can be represented as matrices, linear algebra to a large extent studies the properties of matrices.

Definition A. 12 (Linear transformation). A linear transformation from a linear (vector) space ℝn to ℝm is defined as a map L:ℝn→ℝm such that

With respect to the standard bases of ℝn and ℝm , the map L can be represented by a matrix A∈ℝm×n such that

L(x)=Ax,∀x∈ℝn.\tagA.18

The i th column of the matrix A is then nothing but the image of the standard basis vector ei∈ℝn under the map L ; i.e.

A=[L(e1),L(e2),…,L(en)]∈ℝm×n.

The set of all (real) m×n matrices is denoted by ℳ(m,n) . When viewed as a linear space, ℳ(m,n) can be identified as the space ℝmn . When there is little ambiguity, we refer to a linear map L by its matrix representation A . If n=m , the set ℳ(n,n)≐ℳ(n) forms an algebraic structure called a ring (over the field ℝ ). That is, matrices in ℳ(n) are closed under both matrix multiplication and summation: If A,B are two n×n matrices, so are C=AB and D=A+B .

Linear maps or matrices that we encounter in computer vision often have a special algebraic structure called a group.

Definition A. 13 (Group). A group is a set G with an operation " ∘ " on the elements of G that:

Definition A. 14 (The general linear group GL(n) ). The set of all n×n nonsingular (real) matrices with matrix multiplication forms a group. Such a group of matrices is usually called the general linear group and denoted by GL(n) .

Definition A. 15 (Matrix representation of a group). A group G has a matrix representation or can be realized as a matrix group if there exists an injective map4

ℛ:G→GL(n);g↦ℛ(g),

which preserves the group structure 5 of G . That is, the inverse and composition of elements in G are preserved by the map in the following way:

ℛ(e)=In×n,ℛ(g∘h)=ℛ(g)ℛ(h),∀g,h∈G.\tagA.19

Below, we identify a few important subsets of ℳ(n) that have special algebraic structures (as examples of matrix groups) and nice properties.

The group GL(n) itself can be identified as the set of all invertible linear transformations from ℝn to ℝn in the sense that for every A∈GL(n) , we obtain a linear map

L:ℝn→ℝn;x↦Ax.\tagA.20

Notice that if A∈GL(n) , then so is its inverse: A−1∈GL(n) . We know that an n×n matrix A is invertible if and only if its determinant is nonzero. Therefore, we have

det(A)≠0,∀A∈GL(n).\tagA.21

The general linear group, when matrices are considered to be known only up to a scalar factor, GL(n)/ℝ , is referred to as the projective transformation group, whose elements are called projective matrices or homographies.


4A map f(·) is called injective if f(x)≠f(y) as long as x≠y .

5 Such a map is called a group homomorphism in algebra.


Matrices in GL(n) of determinant +1 form a subgroup called the special linear group, denoted by SL(n) . That is, det(A)=+1 for all A∈SL(n) . It is easy to verify that if A∈SL(n) , then so is A−1 , since det(A−1)=det(A)−1 .

Definition A. 16 (The affine group A(n) ). An affine transformation L from ℝn to ℝn is defined jointly by a matrix A∈GL(n) and a vector b∈ℝn such that

L:ℝn→ℝn;x↦Ax+b.\tagA.22

The set of all such affine transformations is called the affine group of dimension n and is denoted by A(n) .

Notice that the map L so-defined is not a linear map from ℝn to ℝn unless b=0 . Nevertheless, we may "embed" this map into a space one dimension higher so that we can still represent it by a single matrix. If we identify an element x∈ℝn with [x1]∈ℝn+1,6 then L becomes a map from ℝn+1 to ℝn+1 in the following sense:

L:ℝn+1→ℝn+1;[x1]↦[Ab01][x1].\tagA.23

Thus, a matrix of the form

[Ab01]∈ℝ(n+1)×(n+1),A∈GL(n),b∈ℝn,\tagA.24

fully describes an affine map, and we call it an affine matrix. This matrix is an element in the general linear group GL(n+1) . In this way, A(n) is identified as a subset (and in fact a subgroup) of GL(n+1) . The multiplication of two affine matrices in the set A(n) is

[A1b101][A2b201]=[A1A2A1b2+b101]∈ℝ(n+1)×(n+1),\tagA.25

which is also an affine matrix in A(n) and represents the composition of two affine transformations.

Given ℝn and its standard inner product structure, ⟨x,y⟩=xTy,∀x,y∈ℝn , let us consider the set of linear transformations (or matrices) that preserve the inner product.

Definition A. 17 (The orthogonal group O(n) ). An n×n matrix A (representing a linear map from ℝn to itself) is called orthogonal if it preserves the inner product, i.e.

⟨Ax,Ay⟩=⟨x,y⟩,∀x,y∈ℝn.\tagA.26

The set of all n×n orthogonal matrices forms the orthogonal group of dimension n , and it is denoted by O(n) .


6 This is the so-called homogeneous representation of x . Notice that this identification does not preserve the vector structure of ℝn .


Obviously, O(n) is a subset (and in fact a subgroup) of GL(n) . If R is an orthogonal matrix, we must have RTR=RRT=I . Therefore, the orthogonal group O(n) can be characterized as

O(n)={R∈GL(n)∣RTR=I}.\tagA.27

The determinant det(R) of an orthogonal matrix R can be either +1 or -1 . The subgroup of O(n) with determinant +1 is called the special orthogonal group and is denoted by SO(n) . That is, for any R∈SO(n) , we have det(R)=+1 . Equivalently, one may define SO(n) as the intersection SO(n)=O(n)∩SL(n) . In the case n=3 , the special orthogonal matrices are exactly the 3×3 rotation matrices (studied in Chapter 2).

The affine version of the orthogonal group gives the Euclidean (transformation) group:

Definition A. 18 (The Euclidean group E(n) ). A Euclidean transformation L from ℝn to ℝn is defined jointly by a matrix R∈O(n) and a vector T∈ℝn such that

L:ℝn→ℝn;x↦Rx+T.\tagA.28

The set of all such transformations is called the Euclidean group of dimension n and is denoted by E(n) .

Obviously, E(n) is a subgroup of A(n) . Therefore, it can also be embedded into a space one-dimension higher and has a matrix representation

[RT01]∈ℝ(n+1)×(n+1),R∈O(n),T∈ℝn.\tagA.29

If R further belongs to SO(n) , such transformations form the special Euclidean group, which is traditionally denoted by SE(n) . When n=3,SE(3) represents the conventional rigid-body motion in ℝ3 , where R is the rotation of a rigid body and T is the translation (with respect to a chosen reference coordinate frame).

Since all the transformation groups introduced so far have natural matrix representations, they are matrix groups. 7 To summarize their relationships, we have

SO(n)⊂O(n)⊂GL(n),SE(n)⊂E(n)⊂A(n)⊂GL(n+1).\tagA.30

A.3 Gram-Schmidt and the QR decomposition

A matrix in GL(n) has n independent rows (or columns). A matrix in O(n) has orthonormal rows (or columns). The Gram-Schmidt procedure can be viewed as a map from GL(n) to O(n) , for it transforms a nonsingular matrix into an orthogonal one. Call ℒ+(n) the subset of GL(n) consisting of lower triangular matrices with positive elements along the diagonal. Such matrices form a subgroup of GL(n) .


7 Since these groups themselves admit a differential structure, they belong to the Lie groups.


Theorem A.19 (Gram-Schmidt procedure). For every A∈GL(n) , there exists a lower triangular matrix L∈ℝn×n and an orthogonal matrix E∈O(n) such that

A=LE . \tagA.31

Proof. Contrary to the convention of the book, for simplicity in this proof all vectors indicate row vectors. That is, if v is an n -dimensional row vector, it is of the form: v=[v1,v2,…,vn]∈ℝn . Denote the i th row vector of the given matrix A by ai for i=1,2,…,n . The proof consists in constructing L and E iteratively from the row vectors ai :

l1≐a1→e1≐l1/‖l1‖2l2≐a2−⟨a2,e1⟩e1→e2≐l2/‖l2‖2⋮⋮⋮⋮ln≐an−∑i=1n−1⟨ai+1,ei⟩ei→en≐ln/‖ln‖2

Then E=[e1T,…,enT]T , and the matrix L is obtained as

L=[‖l1‖20…0⟨a2,e1⟩‖l2‖2…0⋮⋱⋱⋮⟨a2,e1⟩…⟨an,en−1⟩‖ln‖2].

By construction E is orthogonal; i.e. EET=ETE=I .

Remark A.20. The Gram-Schmidt's procedure has the peculiarity of being causal, in the sense that the ith row of the transformed matrix E depends only upon rows with index j≤i of the original matrix A . The choice of the name E for the orthogonal matrix above is not accidental. In fact, we will view the Kalman filter (to be reviewed in the next appendix) as a way to perform a Gram-Schmidt orthonormalization in a special Hilbert space, and the outcome E of the procedure is traditionally called the innovation.

There are a few useful variations to Gram-Schmidt procedure. By transposing A=LE , we get AT=ETLT≐QR . Notice that R=LT is an upper triangular matrix. Thus, by applying Gram-Schmidt procedure to the transpose of a matrix, we can also decompose it into the form QR where Q is an orthogonal matrix and R an upper triangular matrix. Such a decomposition is called the QR decomposition. In Matlab, this can be done by the command [Q,R]=qr(A) . Furthermore, by inverting AT=ETLT , we get A−T=L−TE≐KE . Notice that K=L−T is still an upper triangular matrix. Thus, we can also decompose any matrix into the form of an upper triangular matrix followed by an orthogonal one. The latter one is the kind of "QR decomposition" we use in Chapter 6 for camera calibration.

A.4 Range, null space (kernel), rank and eigenvectors of a matrix

Let A be a general m×n matrix that also conveniently represents a linear map from the vector space ℝn to ℝm .

Definition A. 21 (Range, span, null space, and kernel). Define the range or span of A , denoted by range (A) or span (A) , to be the subspace of ℝm such that y∈range(A) if and only if y=Ax for some x∈ℝn . Define the null space of A , denoted by null (A) , to be the subspace of ℝn such that x∈null(A) if and only if Ax=0 . When A is viewed as an abstract linear map, null (A) is also referred to as the kernel of the map, denoted by ker(A) .

Notice that the range of a matrix A is exactly the span of all its column vectors; the null space of a matrix A is exactly the set of vectors which are orthogonal to all its row vectors (for a definition of orthogonal vectors see Definition A.9). The notion of range or null space is useful whenever the solution to a linear equation of the form Ax=b is considered. In terms of range and null space, this equation will have a solution if b∈range(A) and will have a unique solution only if null(A)=∅ (the empty set).

In Matlab, the null space of a matrix A can be computed using the command Z = null(A).

Definition A. 22 (Rank of a matrix). The rank of a matrix is the dimension of its range:

rank(A)≐dim(range(A)).\tagA.32

Fact A.23 (Properties of matrix rank). For an arbitrary m×n matrix A , its rank has the following properties:

  1. rank(A)=n−dim(null(A)) .

  2. 0≤rank(A)≤min{m,n} .

  3. rank(A) is equal to the maximum number of linearly independent column (or row) vectors of A .

  4. rank(A) is the highest order of a nonzero minor 8 of A .

  5. Sylvester’s inequality: Let B be an n×k matrix. Then AB is an m×k matrix and

rank(A)+rank(B)−n≤rank(AB)≤min{rank(A),rank(B)}.\tagA.33

8A minor of order k is the determinant of a k×k submatrix of A .


  1. For any nonsingular matrices C∈ℝm×m and D∈ℝn×n , we have
rank(A)=rank(CAD) . \tagA.34

In Matlab, the rank of a matrix A is just rank (A) .

Definition A. 24 (Orthogonal complement to a subspace). Given a subspace S of ℝn , we define its orthogonal complement to be the subspace S⊥⊆ℝn such that x∈S⊥ if and only if xTy=0 for all y∈S . We write ℝn=S⊕S⊥ .

The notion of orthogonal complement is used in this book to define the "coim-age" of an image of a point or a line. Also, with respect to any linear map A from ℝn to ℝm , the space ℝn can be decomposed as a direct sum of two subspaces,

ℝn=null(A)⊕null(A)⊥,

and ℝm can be decomposed similarly as

ℝm=range(A)⊕range(A)⊥.

We also have the following not so obvious relationships:

Theorem A.25. Let A be a linear map from ℝn to ℝm . Then:

(a) null(A)⊥=range(AT) ,

(b) range(A)⊥=null(AT) ,

© null(AT)=null(AAT) ,

(d) range(A)=range(AAT) .

Proof. To prove part c : null (AAT)=null(AT) , we have

To prove part d , range(AAT)=range(A) , we first need to prove that ℝn is a direct sum of range(AT) and null(A) , i.e. part a of the theorem. Part b can then be proved similarly. We prove this by showing that a vector x is in null(A) if and only if it is orthogonal to range(AT):x∈null(A)⇔⟨Ax,y⟩=0,∀y⇔⟨x,ATy⟩=0,∀y . Hence null (A) is exactly the subspace that is the orthogonal complement to range (AT) (denoted by range (AT)⊥ ). Therefore, ℝn is a direct sum of range (AT) and null (A) . Now to complete our proof of part d , let ImgA(S) denote the image of a subspace S under the map A . Then we have range (A)=ImgA(ℝn)=ImgA(range(AT))=range(AAT) (in the second equality we used the fact that ℝn is a direct sum of range(AT) and null(A) ). These relations are depicted by Figure A.1.

In fact, the same result holds even if the domain of the linear map A is replaced by an infinite-dimensional linear space with an inner product (i.e. ℝn is replaced by a Hilbert space). In that case, this theorem is also known as the finite-rank operator fundamental lemma [Callier and Desoer, 1991]. We will later use this result to prove the singular value decomposition. But already it implies a result that is extremely useful in the study of multiple-view geometry:

12_343_287_855_523_0.jpg

Figure A.1. The orthogonal decomposition of the domain and codomain of a linear map A .

Lemma A.26 (Rank reduction lemma). Let A∈ℝn×n be a matrix and let W be a matrix of the form

W=[M0ABAAT]∈ℝ(m+n)×(k+n)\tagA.35

for some matrices M∈ℝm×k and B∈ℝn×k . Then, regardless of what B is, we always have

rank(M)=rank(W)−rank(A).\tagA.36

The proof is easy using the fact range (AB)⊆range(A)=range(AAT) with the second identity from the previous theorem, and we leave the rest of the proof to the reader as an exercise.

A linear map from ℝn to itself is represented by a square n×n matrix A . For such a map, we sometimes are interested in subspaces of ℝn that are "invariant" under the map. 9 This notion turns out to be closely related to the eigenvectors of the matrix A .

Definition A. 27 (Eigenvalues and eigenvectors of a matrix). Let A be an n×n complex matrix 10 in ℂn×n . A nonzero vector v∈ℂn is said to be its (right) eigenvector if

Av=λv\tagA.37

for some scalar λ∈ℂ;λ is called an eigenvalue of A . Similarly, a nonzero row vector ηT∈ℂn is called a left eigenvector of A if ηTA=ληT for some λ∈ℂ .


9 More rigorously speaking, a subspace S⊂ℝn is A -invariant if A(S)⊆S .

10 Although A will mostly be a real matrix in this book, to talk about its eigenvectors, it is more convenient to think of it as a complex matrix (with all entries that happen to be real).


Unless otherwise stated, an eigenvector in this book by default means a right eigenvector. The set of all eigenvalues of a matrix A is called its spectrum, denoted by σ(A) . The Matlab command [V,D]=eig(A) produces a diagonal matrix D of eigenvalues and a full-rank matrix V whose columns are the corresponding eigenvectors, so that AV=VD .

We give the following facts about eigenvalues and eigenvectors of a matrix without a proof.

Fact A.28 (Properties of eigenvalues and eigenvectors). Given a matrix A∈ℝn×n , we have:

  1. If Av=λv , then for the same eigenvalue λ , there also exists a left eigenvector ηT such that ηTA=ληT and vice versa. Hence σ(A)=σ(AT) .

  2. The eigenvectors of A associated with different eigenvalues are linearly independent.

  3. All its eigenvalues σ(A) are the roots of the (characteristic) polynomial equation det(λI−A)=0 . Hence det(A) is equal to the product of all eigenvalues of A .

  4. If B=PAP−1 for some nonsingular matrix P , then σ(B)=σ(A) .

  5. If A is a real matrix, then λ∈ℂ is an eigenvalue implies that its conjugate λ― is also an eigenvalue. Simply put, σ(A)=σ―(A) for real matrices.

A.5 Symmetric matrices and skew-symmetric matrices

Definition A.29 (Symmetric matrix). A matrix S∈ℝn×n is called symmetric if ST=S . A symmetric matrix S is called positive (semi-)definite, if xTSx>0 (or xTSx≥0 ) for all x∈ℝn , denoted by S>0 (or S≥0 ).

Fact A. 30 (Properties of symmetric matrices). If S is a real symmetric matrix, then:

  1. All eigenvalues of S must be real, i.e. σ(S)⊂ℝ .

  2. Let (λ,v) be an eigenvalue-eigenvector pair. If λi≠λj , then vi⊥vj ; i.e. eigenvectors corresponding to distinct eigenvalues are orthogonal.

  3. There always exist n orthonormal eigenvectors of S , which form a basis for ℝn .

  4. S>0(S≥0) if λi>0(λi≥0)∀i=1,2,…,n ; i.e. S is positive (semi-)definite if all eigenvalues are positive (nonnegative).

  5. If S≥0 and λ1≥λ2≥⋯≥λn , then max∥x∥2=1⟨x,Sx⟩=λ1 and min∥x∥2=1⟨x,Sx⟩=λn

From point 3, we see that if V=[v1,v2,…,vn]∈ℝn×n is the matrix of all the eigenvectors, and Λ=diag{λ1,λ2,…,λn} is the diagonal matrix of the corresponding eigenvalues, then we can write

S=VΛVT,

where V is an orthogonal matrix. In fact, V can be further chosen to be in SO(n) (i.e. of determinant +1) if n is odd, since VΛVT=(−V)Λ(−V)T and det(−V)=(−1)ndet(V).

Definition A. 31 (Induced 2-norm of a matrix). Let A∈ℝm×n . We define the induced 2-norm of A (as a linear map from ℝn to ℝm ) as

∥A∥2≐max∥x∥2=1∥Ax∥2=max∥x∥2=1⟨x,ATAx⟩.

Similarly, other induced operator norms on A can be defined starting from different norms on the domain and codomain spaces on which A operates.

Let A be as above. Then ATA∈ℝn×n is clearly symmetric and positive semidefinite, so it can be diagonalized by a orthogonal matrix V . The eigenvalues, being nonnegative, can be written as σi2 . By ordering the columns of V so that the eigenvalue matrix Λ has decreasing eigenvalues on the diagonal, we see, from point 5 of the preceding fact, that ATA=Vdiag{σ12,σ22,…,σn2}VT and

∥A∥2=σ1.

The induced 2-norm of a matrix A∈ℝm×n is different from the "2-norm" of A viewed as a vector in ℝmn . To distinguish them, the latter one is conventionally called the Frobenius norm of A , precisely defined as ∥A∥f=∑i,jaij2 . Notice that ∑i,jaij2 is nothing but the trace of ATA (or AAT ). Thus, we have

∥A∥f≐trace(ATA)=σ12+σ22+⋯+σn2.

The inverse problem of retrieving A from the symmetric matrix S=ATA is usually solved by Cholesky factorization. For the given S , its eigenvalues must be nonnegative. Thus, we have S=VΛVT=ATA for A=Λ(12)VT , where Λ(12)=diag{σ1,σ2,…,σn} is the "square root" of the diagonal matrix Λ . Since RTR=I for any orthogonal matrix, the solution for A is not unique: RA is also a solution. Cholesky factorization then restricts the solution to be an upper-triangular matrix (exactly what we need for camera calibration in Chapter 6). In Matlab, the Cholesky factorization is given by the command A = chol (S).

Definition A.32 (Skew-symmetric (or antisymmetric) matrix). A matrix A∈ℝn×n is called skew-symmetric (or antisymmetric) if AT=−A .

Fact A.33 (Properties of a skew-symmetric matrix). If A is a real skew-symmetric matrix, then:

  1. All eigenvalues of A are either zero or purely imaginary, i.e. of the form iω for i=−1 and some ω∈ℝ .

  2. There exists an orthogonal matrix V such that

A=VΛVT,\tagA.38

where Λ is a block-diagonal matrix Λ=diag{A1,…,Am,0,…,0} , where each Ai is a 2×2 real skew-symmetric matrix of the form

Ai=[0ai−ai0]∈ℝ2×2,i=1,2,…,m.\tagA.39

From point 2, we conclude that the rank of any skew-symmetric matrix must be even. A commonly used skew-symmetric matrix in computer vision is associated with a vector u∈ℝ3 , denoted by

u^=[0−u3u2u30−u1−u2u10]∈ℝ3×3.\tagA.40

The reason for such a definition is that u^v is equal to the conventional cross product u×v of two vectors in ℝ3 . Then we have rank(u^)=2 if u≠0 and the (left and right) null space of u^ is exactly spanned by the vector u itself. That is, u^u=0 and uTu^=0 . In other words, columns and rows of the matrix u^ are always orthogonal to u .

Obviously, ATu^A is also a skew-symmetric matrix. Then ATu^A=v^ for some v∈ℝ3 . We want to know what the relationship between v and A,u is.

Fact A. 34 (Hat operator). If A is a 3×3 matrix of determinant 1, then we have

ATu^A=A−1u ⏜ .\tagA.41

This is an extremely useful fact, which will be extensively used in our book. For example, this property allows us to "push" a matrix through a skew-symmetric matrix in the following way: u^A=A−TATu^A=A−TA−1u^ . We leave to the reader as an exercise to think about how this result needs to be modified when the determinant of A is not 1, or when A is not even invertible.

A.6 Lyapunov map and Lyapunov equation

An important type of linear equation that we will encounter in our book is of Lyapunov type: 11 Find a matrix X∈ℂn×n that satisfies the equation

AX+XB=0\tagA.42

for a given pair of matrices A,B∈ℂn×n . Although solutions to this type of equation can be difficult in general, simple solutions exist when both A and B have n independent eigenvectors. Suppose {ui∈ℂn}i=1n are the n right eigenvectors of A , and {vj∈ℂn}j=1n are the n left eigenvectors of B ; i.e.

Aui=λiui;vj*B=ηjvj*\tagA.43

11 It is also called Sylvester equation in some literature.


for eigenvalues λi,ηj for each i,j . Here v* means the complex-conjugate and transpose of v , since v can be complex.

Fact A. 35 (Lyapunov map). For the above matrix A and B , the n2 eigenvectors of the Lyapunov map

L:X↦AX+XB\tagA.44

are exactly Xij=uivj*∈ℂn×n , and the corresponding eigenvalues are λi+ηj∈ℂ,i,j=1,2,…,n.

Proof. The n2 matrices {Xij}i,j=1n are linearly independent, and they must be all the eigenvectors of L .

Due to this fact, any matrix X that satisfies the Lyapunov equation AX+XB= 0 must be in the subspace spanned by eigenvectors Xij that have zero eigenvalues: λi+ηj=0 . In Matlab, the command X=lyap(A,B,C) solves the more general Lyapunov equation AX+XB=−C .

In this book, we often look for solutions X with extra requirements on its structure. For instance, X needs to be real and symmetric (Chapter 6), or X has to be a rotation matrix (Chapter 10). If so, we have only to take the intersection of the space of solutions to the Lyapunov equation with the space of symmetric matrices or rotation matrices.

A.7 The singular value decomposition (SVD)

The singular value decomposition (SVD) is a useful tool to capture essential features of a matrix (that represents a linear map), such as its rank, range space, null space, and induced norm, as well as to "generalize" the concept of "eigenvalue- eigenvector" pair to non-square matrices. The computation of the SVD is numerically well conditioned, making it extremely useful for solving many linear-algebraic problems such as matrix inversion, calculation of the rank, linear least-squares estimate, projections, and fixed-rank approximations. Since this book will use the SVD quite extensively, here we give a detailed proof of its properties.

A.7.1 Algebraic derivation

Given a matrix A∈ℝm×n , we have the following theorem.

Theorem A.36 (Singular value decomposition of a matrix). Let A∈ℝm×n have rank p . Furthermore, suppose, without loss of generality, that m≥n . Then

such that A=U∑VT .

Proof. We prove the claim by construction.

span{v1,v2,…,vp}=range(AT),span{vp+1,…,vn}=null(A).

Note that the latter eigenvectors correspond to the zero singular values, since null (ATA)=null(A) (according to Theorem A.25).

A[v1,v2,…,vn]=[u1,u2,…,um][σ10⋯⋯⋯00σ2⋯⋯⋯0⋮⋮⋱⋮⋮⋮⋮⋮⋮σp⋮⋮⋮⋮⋮⋮⋱⋮000⋮⋮0n⋮⋮⋮⋮⋮⋮00⋯⋯⋯0],

which we name AV~=U~∑~ .

Then the claim follows by deleting the columns of U~ and the rows of V~T that multiply the zero singular values.

In Matlab, to compute the SVD of a given m×n matrix A , simply use the command [U,S,V]=svd(A) , which returns matrices U,S,V satisfying A=USVT (where S replaces ∑ ). Notice that in the standard SVD routine, the orthogonal matrices U and V do not necessarily have determinant +1 . So the reader should exercise extra caution when using the SVD to characterize the essential matrix in epipolar geometry in this book.

A.7.2 Geometric interpretation

Notice that in the SVD of a square matrix A=U∑VT∈ℝn×n , columns of U=[u1,u2,…,un] and columns of V=[v1,v2,…,vn] form orthonormal bases for ℝn . The SVD essentially states that if A (as a linear map) maps a point x to y , then coordinates of y with respect to the basis U are related to coordinates of x with respect to the basis V by the diagonal matrix ∑ that scales each coordinate by the corresponding singular value.

Theorem A.37. Let A∈ℝn×n=U∑VT be a square matrix. Then A maps the unit sphere 𝕊n−1≐{x∈ℝn:∥x∥2=1} to an ellipsoid with semi-axes σiui , where ui is the ith column of U .

Proof. let x,y be such that Ax=y . The set {vi}i=1n is an orthonormal basis for ℝn . With respect to such a basis x has coordinates

[α1,α2,…,αn]T=[⟨v1,x⟩,⟨v2,x⟩,…,⟨vn,x⟩]T.

That is, x=∑i=1nαivi . With respect to the basis {ui}i=1n,y has coordinates

[β1,β2,…,βn]T=[⟨u1,y⟩,⟨u2,y⟩,…,⟨un,y⟩]T.

We also have y=∑i=1nβiui=Ax=∑i=1nσiuiviTx=∑i=1nσi⟨vi,x⟩ui . Hence σiαi=βi . Now ∥x∥22=∑i=1αi2=1,∀x∈𝕊n−1 , and so we have ∑i=1nβi2/σi2=1 , which implies that the point y satisfies the equation of an ellipsoid with semi-axes of length σi . This is illustrated in Figure A. 2 for the case n=2 .

A.7.3 Some properties of the SVD

Problems involving orthogonal projections onto invariant subspaces of A , such as the linear least-squares (LLS) problem, can be easily solved using the SVD.

Definition A.38 (Generalized (Moore Penrose) inverse). Given a matrix A∈ℝm×n of rank r with its SVD A=U∑VT , we then define the generalized inverse of A to be

A†=V∑†UT, where ∑†=[∑1−1000]n×m.

The generalized inverse is sometimes also called the pseudo-inverse.

19_337_293_855_415_0.jpg

Figure A.2. The image of a unit sphere on the left under a nonsingular map A∈ℝ2×2 is an ellipsoid on the right.

In Matlab, the pseudo-inverse of a matrix is computed by the command X = pinv (A).

Fact A.39 (Properties of generalized inverse).

 - AA†A=A,A†AA†=A† . 

The generalized inverse can then be used to solve linear equations in general.

Proposition A.40 (Least-squares solution of a linear systems). Consider the problem Ax=b with A∈ℝm×n of rank r≤min(m,n) . The solution x* that minimizes ∥Ax−b∥2 is given by x*=A†b .

The following two results have something to do with the sensitivity of solving linear equations of the form Ax=b .

Proposition A.41 (Perturbations). Consider a nonsingular matrix A∈ℝn×n . Let δA be a full-rank perturbation. Then

 - |σk(A+δA)−σk(A)|≤σ1(δA),∀k=1,2,…,n ,  - σn(AδA)≥σn(A)σn(δA) ,  - σ1(A−1)=1σn(A) , 

where σi denotes the ith singular value.

Proposition A.42 (Condition number). Consider the problem Ax=b , and consider a "perturbed" full-rank problem (A+δA)(x+δx)=b . Since Ax=b , then to first-order approximation, δx=−A†δAx . Hence ∥δx∥2≤‖A†‖2∥δA∥2∥x∥2 , from which

∥δx∥2∥x∥2≤‖A†‖2∥A∥2∥δA∥2∥A∥2≐k(A)∥δA∥2∥A∥2,

where k(A)=‖A†‖2∥A∥2 is called the condition number of A . It easy to see that k(A)=σ1/σn if A is invertible.

Last but not the least, one of the most important properties of the SVD is related to a fixed-rank approximation of a given matrix. Given a matrix A of rank r , we want to find a matrix B such that it has fixed rank p<r and the Frobenius norm of the difference ∥A−B∥f is minimal. The solution to this problem is given simply by setting all but the first p singular values to zero

B≐U∑(p)VT,

where ∑(p) denotes the matrix obtained from ∑ by setting to zero its elements on the diagonal after the p th entry. The matrix B has exactly the same induced 2-norm of A , i.e. σ1(A)=σ1(B) , and satisfies the requirement on the rank.

Proposition A.43 (Fixed rank approximation). Let A,B be defined as above. Then ∥A−B∥f2=σp+12+⋯+σr2 . Furthermore, such a norm is the minimum achievable.

The proof is an easy exercise that follows directly from the properties of orthogonal projection and the properties of the SVD given above.