Estimating the Jacobian of the Singular Value Decomposition

17
Estimating the Jacobian of the Singular Value Decomposition: Theory and Applications ? Th´ eodore Papadopoulo and Manolis I.A. Lourakis INRIA Sophia Antipolis 2004 Route des Lucioles, BP 93 06902 SOPHIA-ANTIPOLIS Cedex FRANCE Abstract. The Singular Value Decomposition (SVD) of a matrix is a linear algebra tool that has been successfully applied to a wide variety of domains. The present paper is concerned with the problem of estima- ting the Jacobian of the SVD components of a matrix with respect to the matrix itself. An exact analytic technique is developed that facili- tates the estimation of the Jacobian using calculations based on simple linear algebra. Knowledge of the Jacobian of the SVD is very useful in certain applications involving multivariate regression or the computation of the uncertainty related to estimates obtained through the SVD. The usefulness and generality of the proposed technique is demonstrated by applying it to the estimation of the uncertainty for three different vision problems, namely self-calibration, epipole computation and rigid motion estimation. 1 Introduction and Motivation The SVD is a general linear algebra technique that is of utmost importance for several computations involving matrices. For example, some of the uses of SVD include its application to solving ordinary and generalized least squares problems, computing the pseudo-inverse of a matrix, assessing the sensitivity of linear systems, determining the numerical rank of a matrix, carrying out multivariate analysis and performing operations such as rotation, intersection, and distance determination on linear subspaces [10]. Owing to its power and flexibility, the SVD has been successfully applied to a wide variety of domains, from which a few sample applications are briefly described next. Zhang et al [42], for example, employ the SVD to develop a fast image correlation scheme. The problem of establishing correspondences is also addressed by Jones and Malik [14], who compare feature vectors defined by the responses of several spatial filters and use the SVD to determine the degree to which the chosen filters are independent of each other. Structure from motion is another application area that has greately benefited from the SVD. Longuet-Higgins [19] and later ? This work has been partially supported by the EEC under the TMR VIRGO research network. D. Vernon (Ed.): ECCV 2000, LNCS 1842, pp. 554–570, 2000. c Springer-Verlag Berlin Heidelberg 2000

Transcript of Estimating the Jacobian of the Singular Value Decomposition

Page 1: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the Singular ValueDecomposition: Theory and Applications?

Theodore Papadopoulo and Manolis I.A. Lourakis

INRIA Sophia Antipolis2004 Route des Lucioles, BP 93

06902 SOPHIA-ANTIPOLIS CedexFRANCE

Abstract. The Singular Value Decomposition (SVD) of a matrix is alinear algebra tool that has been successfully applied to a wide varietyof domains. The present paper is concerned with the problem of estima-ting the Jacobian of the SVD components of a matrix with respect tothe matrix itself. An exact analytic technique is developed that facili-tates the estimation of the Jacobian using calculations based on simplelinear algebra. Knowledge of the Jacobian of the SVD is very useful incertain applications involving multivariate regression or the computationof the uncertainty related to estimates obtained through the SVD. Theusefulness and generality of the proposed technique is demonstrated byapplying it to the estimation of the uncertainty for three different visionproblems, namely self-calibration, epipole computation and rigid motionestimation.

1 Introduction and Motivation

The SVD is a general linear algebra technique that is of utmost importancefor several computations involving matrices. For example, some of the uses ofSVD include its application to solving ordinary and generalized least squaresproblems, computing the pseudo-inverse of a matrix, assessing the sensitivityof linear systems, determining the numerical rank of a matrix, carrying outmultivariate analysis and performing operations such as rotation, intersection,and distance determination on linear subspaces [10]. Owing to its power andflexibility, the SVD has been successfully applied to a wide variety of domains,from which a few sample applications are briefly described next. Zhang et al [42],for example, employ the SVD to develop a fast image correlation scheme. Theproblem of establishing correspondences is also addressed by Jones and Malik[14], who compare feature vectors defined by the responses of several spatialfilters and use the SVD to determine the degree to which the chosen filtersare independent of each other. Structure from motion is another applicationarea that has greately benefited from the SVD. Longuet-Higgins [19] and later? This work has been partially supported by the EEC under the TMR VIRGO research

network.

D. Vernon (Ed.): ECCV 2000, LNCS 1842, pp. 554–570, 2000.c© Springer-Verlag Berlin Heidelberg 2000

Page 2: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 555

Hartley [12] extract the translational and rotational components of rigid 3Dmotion using the SVD of the essential matrix. Tsai et al [36] also use the SVDto recover the rigid motion of a 3D planar patch. Kanade and co-workers [35,28,27] assume special image formation models and use the SVD to factorizeimage displacements to structure and motion components. Using an SVD basedmethod, Sturm and Triggs [34] recover projective structure and motion fromuncalibrated images and thus extend the work of [35,28] to the case of perspectiveprojection. The SVD of the fundamental matrix yields a simplified form of theKruppa equations, on which self-calibration is based [11,20,21]. Additionally,the SVD is used to deal with important image processing problems such asnoise estimation [15], image coding [40] and image watermarking [18]. Severalparametric fitting problems involving linear least squares estimation, can also beeffectively resolved with the aid of the SVD [2,37,16]. Finally, the latter has alsoproven useful in signal processing applications [31,26] and pattern recognitiontechniques such as neural networks computing [7,39] and principal componentsanalysis [4].

This paper deals with the problem of computing the Jacobian of the SVDcomponents of a matrix with respect to the elements of this matrix. Knowledgeof this Jacobian is important as it is a key ingredient in tasks such as non-linearoptimization and error propagation:

– Several optimization methods require that the Jacobian of the criterion thatis to be optimized is known. This is especially true in the case of complicatedcriteria. When these criteria involve the SVD, the method proposed in thispaper is invaluable for providing analytical estimates of their Jacobians. Aswill be further explained latter, numerical computation of such Jacobiansusing finite differences is not as straightforward as it might seem at a firstglance.

– Computation of the covariance matrix corresponding to some estimatedquantity requires knowledge of the Jacobians of all functions involved in theestimation of the quantity in question. Considering that the SVD is quitecommon in many estimation problems in vision, the method proposed inthis work can be used in these cases for computing the covariance matricesassociated with the estimated objects.

Paradoxically, the numerical analysis litterature provides little help on thistopic. Indeed, a lot of studies have been made on the sensitivity of singularvalues and singular vectors to perturbations in the original matrix [33,10,6,38,3], but these globally consider the question of perturbing the input matrix andderive bounds for the singular elements but do not deal with perturbations dueto individual elements.

Thus, the method proposed here fills in an important gap, since, to the bestof our knowledge, no similar method for SVD differentiation appears in theliterature. The rest of this paper is organized as follows. Section 2 gives an ana-lytical derivation for the computation of the Jacobian of the SVD and discussespractical issues related to its implementation in degenerate cases. Section 3 il-

Page 3: Estimating the Jacobian of the Singular Value Decomposition

556 T. Papadopoulo and M.I.A. Lourakis

lustrates the use of the proposed technique with three examples of covariancematrix estimation. The paper concludes with a brief discussion in section 4.

2 The Proposed Method

2.1 Notation and Background

In the rest of the paper, bold letters will be used for denoting vector and matrices.The transpose of matrix M is denoted by MT and mij refers to the (i, j) elementof M. The i-th non-zero element of a diagonal matrix D is referred to by di,while Mi designates the i-th column of matrix M.

A basic theorem of linear algebra states that any real M ×N matrix A withM ≥ N can be written as the product of an M × N column orthogonal matrixU, an N ×N diagonal matrix D with non-negative diagonal elements (known asthe singular values), and the transpose of an N × N orthogonal matrix V [10].In other words,

A = UDVT =N∑

i=1

diUiVTi . (1)

The singular values are the square roots of the eigenvalues of the matrixAAT (or AT A since these matrices share the same non-zero eigenvalues) whilethe columns of U and V (the singular vectors) correspond to the eigenvectors ofAAT and AT A respectively [17]. As defined in Eq.(1), the SVD is not uniquesince

– it is invariant to arbitrary permutations of the singular values and theircorresponding left and right singular vectors. Sorting the singular values(usually by decreasing magnitude order) solves this problem unless thereexist equal singular values.

– simultaneous changes in the signs of the vectors Ui and Vi do not have anyimpact on the leftmost part of Eq.(1). In practice, this has no impact onmost numerical computations involving the SVD.

2.2 Computing the Jacobian of the SVD

Employing the definitions of section 2.1, we are interested in computing ∂U∂aij

,∂V∂aij

and ∂D∂aij

for every element aij of the M × N matrix A.Taking the derivative of Eq. (1) with respect to aij yields the following equation

∂A∂aij

=∂U∂aij

DVT + U∂D∂aij

VT + UD∂V∂aij

T

(2)

Clearly, ∀ (k, l) 6= (i, j), ∂akl

∂aij= 0, while ∂aij

∂aij= 1. Since U is an orthogonal

matrix, we have the following:

UT U = I =⇒ ∂U∂aij

T

U + UT ∂U∂aij

= ΩijU

T+ Ωij

U = 0, (3)

Page 4: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 557

where ΩijU is given by

ΩijU = UT ∂U

∂aij. (4)

From Eq. (3) it is clear that ΩijU is an antisymmetric matrix. Similarly, an anti-

symmetric matrix ΩijV can be defined for V as

ΩijV =

∂V∂aij

T

V . (5)

Notice that ΩijU and Ωij

V are specific to each differentiation ∂∂aij

.By multiplying Eq. (2) by UT and V from the left and right respectively,

and using Eqs. (4) and (5), the following relation is obtained:

UT ∂A∂aij

V = ΩijUD +

∂D∂aij

+ DΩijV. (6)

Since ΩijU and Ωij

V are antisymmetric matrices, all their diagonal elementsare equal to zero. Recalling that D is a diagonal matrix, it is easy to see thatthe diagonal elements of Ωij

UD and DΩijV are also zero. Thus, Eq. (6) yields the

derivatives of the singular values as∂dk

∂aij= uik vjk . (7)

Taking into account the antisymmetry property, the elements of the matricesΩij

U and ΩijV can be computed by solving a set of 2× 2 linear systems, which are

derived from the off-diagonal elements of the matrices in Eq. (6):dl Ωij

Ukl + dk ΩijVkl = uik vjl

dk ΩijUkl + dl Ωij

Vkl = − uil vjk ,(8)

where the index ranges are k = 1 . . . N and l = i + 1 . . . N . Note that, sincethe dk are positive numbers, this system has a unique solution provided thatdk 6= dl. Assuming for the moment that ∀ (k, l), dk 6= dl, the N(N−1)

2 parametersdefining the non-zero elements of Ωij

U and ΩijV can be easily recovered by solving

the N(N−1)2 corresponding 2 × 2 linear systems.

Once ΩijU and Ωij

V have been computed, ∂U∂aij

and ∂V∂aij

follow as:

∂U∂aij

= UΩijU ,

∂V∂aij

= −VΩijV . (9)

In summary, the desired derivatives are supplied by Eqs. (7) and (9).

2.3 Implementation and Practical Issues

In this section, a few implementation issues related to a practical application ofthe proposed method are considered.

Page 5: Estimating the Jacobian of the Singular Value Decomposition

558 T. Papadopoulo and M.I.A. Lourakis

Degenerate SVDs. Until now, the case where the SVD yields at least twoidentical singular values has been set aside. However, such cases occur often inpractice, for example when dealing with the essential matrix (see section 3.3ahead) or when fitting a line in 3D. Therefore, let us now assume that dk = dl

for some k and l. It is easy to see that these two singular values contribute toEq. (1) with the term dl

(UkVT

k + UlVTl

). The same contribution to A can

be obtained by using any other orthonormal bases of the subspaces spanned by(Uk,Ul) and (Vk,Vl) respectively. Therefore, letting

U′k = cosα Uk + sinα Ul

U′l = −sinα Uk + cosα Ul

V′k = cosα Vk + sinα Vl

V′l = −sinα Vk + cosα Vl ,

for any real number α, we have UkVTk +UlVT

l = U′kV

′k

T +U′lV

′lT . This implies

that in this case, there exists a one dimensional family of SVDs. Consequently,the 2× 2 system of Eqs. (8) must be solved in a least squares fashion in order toget only the component of the Jacobian that is “orthogonal” to this family. Ofcourse, when more than two singular values are equal, all the 2×2 correspondingsystems have to be solved simultaneously. The correct algorithm for all cases isthus:

– Group together all the 2× 2 systems corresponding to equal singular values.– Solve these systems using least squares.

This will give the exact Jacobian in non-degenerate cases and the “minimumnorm” Jacobian when one or more singular values are equal.

Computational complexity. Assuming that the matrix A is N ×N and non-degenerate for simplicity, it is easy to compute the complexity of the procedurefor computing the Jacobian: For each pair (i, j), i = 1 . . . N, j = i + 1 . . . N , atotal of N(N−1)

2 2×2 linear systems have to be solved. In essence, the complexityof the method is O(N4) once the initial SVD has been carried out.

Computing the Jacobian using finite differences. The proposed methodhas been compared with a finite difference approximation of the Jacobian andsame results have been obtained in the non-degenerate case (degenerate casesare more difficult to compare due to the non-uniqueness of the SVD). Althoughthe ease of implementation makes the finite difference approximation more ap-pealing for computing the Jacobian, the following points should also be takeninto account:

– The finite difference method is more costly in terms of computational com-plexity. Considering again the case of an N × N non-degenerate matrix asin the previous paragraph, it is simple to see that such an approach requires

Page 6: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 559

N2 SVD computations to be performed (i.e. one for each perturbation ofeach element of the matrix). Since the complexity of the SVD operation isO(N3), the overall complexity of the approach is O(N5) which is an order ofmagnitude higher compared to that corresponding to the proposed method.

– Actually, the implementation of a finite difference approximation to a Jaco-bian is not as simple as it might appear. This is because even state of theart algorithms for SVD computation (eg Lapack’s dgesvd family of routi-nes [1]) are “unstable” with respect to small perturbations of the input. Byunstable, we mean that the signs associated with the columns Ui and Vi

can change arbitrarily even with the slightest perturbation. In general, thisis not important but it has strong effects in our case since the original andperturbed SVD do not return the same objects. Consequently, care has to betaken to compensate for this effect when the Jacobian is computed throughfinite differences.

3 Applications

In this section, the usefulness and generality of the proposed SVD differentiationmethod are demonstrated by applying it to three important vision problems.Before proceeding to the description of each of these problems, we briefly statea theorem related to error propagation that is essential for the developments inthe subsections that follow. More specifically, let x0 ∈ RN be a measurementvector, from which a vector y0 ∈ RM is computed through a function f , i.e.y0 = f(x0). Here, we are interested in determining the uncertainty of y0, giventhe uncertainty of x0. Let x ∈ RN be a random vector with mean x0 andcovariance Λx = E[(x − x0)(x − x0)T ]. The vector y = f(x) is also random andits covariance Λy up to first order is equal to

Λy =∂f(x0)∂x0

Λx∂f(x0)∂x0

T

, (10)

where ∂f(x0)∂x0

is the derivative of f at x0. For more details and proof, the readeris referred to [8]. In the following, Eq. (10) will be used for computing the uncer-tainty pertaining to various entities that are estimated from images. Since imagemeasurements are always corrupted by noise, the estimation of the uncertaintyrelated to these entities is essential for effectively and correctly employing thelatter in subsequent computations.

3.1 Self-Calibration Using the SVD of the Fundamental Matrix

The first application that we deal with is that of self-calibration, that is theestimation of the camera intrinsic parameters without relying upon the existenceof a calibration object. Instead, self-calibration employs constraints known asthe Kruppa equations, which are derived by tracking image features through animage sequence. More details regarding self-calibration can be found in [25,41,23,

Page 7: Estimating the Jacobian of the Singular Value Decomposition

560 T. Papadopoulo and M.I.A. Lourakis

20]. Here, we restrict our attention to a self-calibration method that is based on asimplification of the Kruppa equations derived from the SVD of the fundamentalmatrix. In the following paragraph, a brief description of the method is given;more details can be found in [20,22].

Let SF be the vector formed by the parameters of the SVD of the fundamentalmatrix F. The Kruppa equations in this case reduce to three linearly dependentconstraints, two of which are linearly independent. Let πi(SF,K), i = 1 . . . 3denote those three equations as functions of the fundamental matrix F and thematrix K = AAT , where A is the 3 × 3 intrinsic calibration parameters matrixhaving the following well-known form [8]:

A =

αu − αu cot θ u0

0 αv/ sin θ v00 0 1

(11)

The parameters αu and αv correspond to the focal distances in pixels along theaxes of the image, θ is the angle between the two image axes and (u0, v0) are thecoordinates of the image principal point. In practice, θ is very close to π

2 for realcameras. The matrix K is parameterized with the unknown intrinsic parametersfrom Eq.(11) and is computed from the solution of a non-linear least squaresproblem, namely

K = argminK

N∑i=1

π21(SFi

, K)σ2

π1(SFi

, K)+

π22(SFi

, K)σ2

π2(SFi

, K)+

π23(SFi

, K)σ2

π3(SFi

, K)(12)

In the above equation, N is the number of the available fundamental matrices andσ2

πi(SFi

,K) are the variances of constraints πi(SF,K), i = 1 . . . 3, respectively,used to automatically weight the constraints according to their uncertainty. It isto the estimation of these variances that the proposed differentiation method isapplied. More specifically, applying Eq.(10) to the case of the simplified Kruppaequations, it is straightforward to show that the variance of the latter is appro-ximated by

σ2πi

(SF, K) =∂πi(SF,K)

∂SF

∂SF

∂FΛF

∂SF

∂F

T ∂πi(SF,K)∂SF

T

In the above equation, ∂πi(SF,K)∂SF

is the derivative of πi(SF,K) at SF, ∂SF∂F is the

Jacobian of SF at F and ΛF is the covariance of the fundamental matrix, suppliedas a by-product of the procedure for estimating F [5]. The derivative ∂πi(SF,K)

∂SFis

computed directly from the analytic expression for πi(SF,K), while ∂SF∂F is esti-

mated using the proposed method for SVD differentiation. To quantitatively as-sess the improvement on the accuracy of the recovered intrinsic parameters thatis gained by employing the covariances, a set of simulations has been conducted.More specifically, three rigid displacements of a virtual camera were simulatedand a set of randomly chosen 3D points were projected on the simulated retinas.Following this, the resulting retinal points were contaminated by zero mean ad-ditive Gaussian noise. The noise standard deviation was increased from 0 to 4

Page 8: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 561

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Mea

n a_

u re

lativ

e er

ror

(%)

Noise standard deviation (pixels)

Mean a_u relative error vs. noise standard deviation

with covwithout cov

0

1

2

3

4

5

6

7

8

9

0 0.5 1 1.5 2 2.5 3 3.5 4

Mea

n a_

v re

lativ

e er

ror

(%)

Noise standard deviation (pixels)

Mean a_v relative error vs. noise standard deviation

with covwithout cov

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Std

dev

iatio

n of

a_u

rel

ativ

e er

ror

(%)

Noise standard deviation (pixels)

Std deviation of a_u relative error vs. noise standard deviation

with covwithout cov

0

1

2

3

4

5

6

7

8

9

10

11

0 0.5 1 1.5 2 2.5 3 3.5 4

Std

dev

iatio

n of

a_v

rel

ativ

e er

ror

(%)

Noise standard deviation (pixels)

Std deviation of a_v relative error vs. noise standard deviation

with covwithout cov

Fig. 1. The error in the recovered focal lengths in the presence of noise, with andwithout employing the covariance. Mean values are shown in the top row, standarddeviations in the bottom.

pixels in steps of 0.1. A non-linear method [43] was then employed to estimatefrom the noisy retinal points the fundamental matrices corresponding to the si-mulated displacements. The estimates of the fundamental matrices serve as theinput to self-calibration. To ensure that the recovered intrinsic calibration para-meters are independent of the exact location of the 3D points used to form 2Dcorrespondences, 100 experiments were run for each noise level, each time usinga different random set of 3D points. More details regarding the simulation canbe found in [20]. Figures 3.1 and 3.1 illustrate the mean and standard deviationof the relative error for the intrinsic parameters versus the standard deviation ofthe noise added to image points, with and without employing the covariances.When the covariances are not employed, the weights σ2

πi(SF, K) in Eq.(12) are

all assumed to be equal to one. Throughout all experiments, zero skew has beenassumed, i.e. θ = π/2 and K in Eq. (12) was parameterized using 4 unknowns.As is evident from the plots, especially those referring to the standard deviationof the relative error, the inclusion of covariances yields more accurate and morestable estimates of the intrinsic calibration parameters. Additional experimentalresults can be found in [20]. At this point, it is also worth mentioning that inthe case of self-calibration, the derivatives ∂SF

∂F were also computed analyticallyby using Maple to compute closed-form expressions for the SVD components

Page 9: Estimating the Jacobian of the Singular Value Decomposition

562 T. Papadopoulo and M.I.A. Lourakis

with respect to the elements of F. Using the computed expressions for the SVD,the derivative of the latter with respect to F was then computed analytically. Asexpected, the arithmetic values of the derivatives obtained in this manner wereidentical to those computed by the differentiation method proposed here.

0

2

4

6

8

10

12

14

16

18

20

22

0 0.5 1 1.5 2 2.5 3 3.5 4

Mea

n u_

0 re

lativ

e er

ror

(%)

Noise standard deviation (pixels)

Mean u_0 relative error vs. noise standard deviation

with covwithout cov

0

2

4

6

8

10

12

14

16

18

20

0 0.5 1 1.5 2 2.5 3 3.5 4

Mea

n v_

0 re

lativ

e er

ror

(%)

Noise standard deviation (pixels)

Mean v_0 relative error vs. noise standard deviation

with covwithout cov

0

4

8

12

16

20

24

28

32

36

40

44

0 0.5 1 1.5 2 2.5 3 3.5 4

Std

dev

iatio

n of

u_0

rel

ativ

e er

ror

(%)

Noise standard deviation (pixels)

Std deviation of u_0 relative error vs. noise standard deviation

with covwithout cov

0

2

4

6

8

10

12

14

16

18

20

22

24

0 0.5 1 1.5 2 2.5 3 3.5 4

Std

dev

iatio

n of

v_0

rel

ativ

e er

ror

(%)

Noise standard deviation (pixels)

Std deviation of v_0 relative error vs. noise standard deviation

with covwithout cov

Fig. 2. The error in the recovered principal points in the presence of noise, with andwithout employing the covariance. Mean values are shown in the top row, standarddeviations in the bottom.

3.2 Estimation of the Epipoles’ Uncertainty

The epipoles of an image pair are the two image points defined by the projectionof each camera’s optical center on the retinal plane of the other. The epipolesencode information related to the relative position of the two cameras and havebeen employed in applications such as stereo rectification [30], self-calibration[25,41,23], projective invariants estimation [13,32] and point features matching[9]. Although it is generally known that the epipoles are hard to estimate ac-curately1 [24], the uncertainty pertaining to their estimates is rarely quantified.

1 This is particularly true when the epipoles lie outside the images.

Page 10: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 563

Here, a simple method is presented that permits the estimation of the epipo-les’ covariance matrices based on the covariance of the underlying fundamentalmatrix.

Let e and e′ denote the epipoles in the first and second images of a stereopair respectively. The epipoles can be directly estimated from the SVD of thefundamental matrix F as follows. Assuming that F is decomposed as F = UDVT

and recalling that FT e′ = Fe = 0, it is easy to see that e corresponds to thethird column of V, while e′ is given by the third column of U. The epipoles arethus given by two very simple functions fe and fe′ of the vector SF defined by theSVD of F. More precisely, fe(SF) = V3 and fe′(SF) = U3, where V3 and U3

are the third columns of matrices V and U respectively. A direct application ofEq. (10) can be used for propagating the uncertainty corresponding to F to theestimates of the epipoles. Since this derivation is analogous to that in section 3.1,exact details are omitted and a study of the quality of the estimated covariancesis presented instead.

First, a synthetic set of corresponding pairs of 2D image points was generated.The simulated images were 640×480 pixels and the epipoles e and e′ were withinthem, namely at pixel coordinates (458.123, 384.11) and (526, 402) respectively.The set of generated points was contaminated by different amounts of noise andthen the covariances of the epipoles estimated analytically using Eq. (10) werecompared to those computed using a statistical method which approximatesthe covariances by exploiting the laws of large numbers. In simpler terms, themean of a random vector y can be approximated by the discrete mean of asufficiently large number N of samples, defined by ED[y] = 1

N

∑Ni=1 yi and the

corresponding covariance by

N

N − 1ED[(yi − ED[y])(yi − ED[y])T ]. (13)

Assuming additive Gaussian noise whose standard deviation increased from 0.1to 2.0 in increments of 0.1 pixels, the analytically computed covariance estimateswere compared against those produced by the statistical method. In particular,for each level of noise σ, 1000 noise-corrupted samples of the original correspon-ding pairs set were obtained by adding zero mean Gaussian noise with standarddeviation σ to the original set of corresponding pairs. Then, 1000 epipole pairswere computed through the estimation of the 1000 fundamental matrices pertai-ning to the 1000 noise corrupted samples. Following this, the statistical estimatesof the two epipole covariances were computed using Eq.(13) for N = 1000. Toestimate the epipole covariances with the analytical method, the latter is appliedto the fundamental matrix corresponding to a randomly selected sample of noisypairs.

In order to facilitate both the comparison and the graphical visualization ofthe estimated covariances, the concept of the hyper-ellipsoid of uncertainty isintroduced next. Assuming that a M × 1 random vector y follows a Gaussiandistribution with mean E[y] and covariance Λy, it is easy to see that the randomvector χ defined by χ = Λy

−1/2(y−E[y]) follows a Gaussian distribution of mean

Page 11: Estimating the Jacobian of the Singular Value Decomposition

564 T. Papadopoulo and M.I.A. Lourakis

zero and of covariance equal to the M × M identity matrix I. This implies thatthe random variable δy defined as

δy = χT χ = (y − E[y])T Λy−1(y − E[y])

follows a χ2 (chi-square) distribution with r degrees of freedom, r being the rankof Λy [17,5]. Therefore, the probability that y lies within the k-hyper-ellipsoiddefined by the equation

(y − E[y])T Λy−1(y − E[y]) = k2, (14)

is given by the χ2 cumulative probability function Pχ2(k, r)2 [29].

45

55

65

75

85

95

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2Per

cent

age

of e

pipo

le e

stim

ates

with

in e

llips

es

Noise standard deviation (pixels)

Estimated epipole covariances vs noise

analytical e covarianceanalytical e’ covariancestatistical e covariancestatistical e’ covariance

ideal (75%)

Fig. 3. The fraction of 1000 estimates of the two epipoles that lie within the uncertaintyellipses defined by the corresponding covariances computed with the analytical andstatistical method. According to the χ2 criterion, this fraction is ideally equal to 75%.

In the following, it is assumed that the epipoles are represented using pointsin the two dimensional Euclidean space R2 rather than in the embedding pro-jective space P2. This is simply accomplished by normalizing the estimates ofthe epipoles obtained from the SVD of the fundamental matrix so that their2 The norm defined by the left hand side of Eq.(14) is sometimes referred to as the

Mahalanobis distance.

Page 12: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 565

third element is equal to one. Choosing the probability Pχ2(k, r) of an epipoleestimate being within the ellipsoid defined by the covariance to be equal to 0.75,yields k = 1.665 for r = 2. Figure 2 shows the fractions of the epipole estima-tes that lie within the uncertainty ellipses defined by the covariances computedwith the analytical and statistical method, as a function of the noise standarddeviation. Clearly, the fractions of points within the ellipses corresponding tothe covariances computed with the statistical method are very close to the theo-retical 0.75. On the other hand, the estimates of the covariances computed withthe analytical method are satisfactory, with the corresponding fractions beingover 0.65 when the noise does not exceed 1.5 pixels.

The difference between the covariances estimated by the analytical and sta-tistical methods are shown graphically in Fig.2 for three levels of noise, namely0.1, 1.0 and 2.0 pixels. Since the analytical method always underestimates thecovariance, the corresponding ellipses are contained in the ellipses computed bythe statistical method. Nevertheless, the shape and orientation of the ellipsescomputed with the analytical method are similar to these of the statisticallycomputed ellipses.

3.3 Estimation of the Covariance of Rigid 3D Motion

The third application of the proposed SVD differentiation technique concerns itsuse for estimating the covariance of rigid 3D motion estimates. It is well knownthat the object encoding the translation and rotation comprising the 3D motionis the essential matrix E. Matrix E is defined by E = [T]×R, where T and Rrepresent respectively the translation vector and the rotation matrix defininga rigid displacement and [T]× is the antisymmetric matrix associated with thecross product:

[T]× =

0 −T3 T2

T3 0 −T1−T2 T1 0

There exist several methods for extracting estimates of the translation and ro-tation from estimates of the essential matrix. Here, we focus our attention toa simple linear method based on the SVD of E, described in [19,12]. Assumingthat the SVD of E is E = UDVT , there exist two possible solutions for therotation R, namely R = UWVT and R = UWT VT , where W is given by

W =

0 1 0

−1 0 00 0 1

The translation is given by the third column of matrix V, that is T = V(0, 0, 1)T

with |T| = 1. The two possible choices for R combined with the two possiblesigns of T yield four possible translation-rotation pairs, from which the correctsolution for the rigid motion can be chosen based on the requirement that thevisible 3D points appear in the front of both camera viewpoints [19]. In the

Page 13: Estimating the Jacobian of the Singular Value Decomposition

566 T. Papadopoulo and M.I.A. Lourakis

383

383.2

383.4

383.6

383.8

384

384.2

384.4

384.6

384.8

385

456.5 457 457.5 458 458.5 459 459.5

Uncertainty ellipses for e when the noise std dev is 0.1

statistical covarianceanalytical covariance

401

401.2

401.4

401.6

401.8

402

402.2

402.4

402.6

402.8

524.5 525 525.5 526 526.5 527

Uncertainty ellipses for e’ when the noise std dev is 0.1

statistical covarianceanalytical covariance

372

374

376

378

380

382

384

386

388

390

392

394

445 450 455 460 465 470

Uncertainty ellipses for e when the noise std dev is 1.0

statistical covarianceanalytical covariance

392

394

396

398

400

402

404

406

408

410

516 518 520 522 524 526 528 530 532 534 536

Uncertainty ellipses for e’ when the noise std dev is 1.0

statistical covarianceanalytical covariance

360

365

370

375

380

385

390

395

400

405

410

430 440 450 460 470 480 490

Uncertainty ellipses for e when the noise std dev is 2.0

statistical covarianceanalytical covariance

380

385

390

395

400

405

410

415

420

425

430

490 500 510 520 530 540 550 560

Uncertainty ellipses for e’ when the noise std dev is 2.0

statistical covarianceanalytical covariance

Fig. 4. The ellipses defined by Eq. (14) using k = 0.75 and the covariances of the twoepipoles computed by the statistical and analytical method. The left column corre-sponds to e, the right to e′. The standard deviation of the image noise is 0.1 pixelsfor the first row, 1.0 and 2.0 pixels for the middle and bottom rows respectively. Bothaxes in all plots represent pixel coordinates while points in the plots marked with greydots correspond to estimates of the epipoles obtained during the statistical estimationprocess.

Page 14: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 567

following, the covariance corresponding only to the first of the two solutions forrotation will be computed; the covariance of the second solution can be computedin a similar manner.

Supposing that the problem of camera calibration has been solved, the es-sential matrix can be recovered from the fundamental matrix using

E = AT FA,

where A is the intrinsic calibration parameters matrix. Using Eq.(10), the cova-riance of E can be computed as

ΛE =∂(AT FA)

∂FΛF

∂(AT FA)∂F

T

,

where ∂(AT FA)∂F is the derivative of AT FA at F and ΛF is the covariance of F

[5]. The derivative of AT FA with respect to the element fij of F is equal to

∂(AT FA)∂fij

= AT ∂F∂fij

A

Matrix ∂F∂fij

is such that all its elements are zero, except from that in row i andcolumn j which is equal to one. Given the covariance of E, the covariance of Ris then computed from

ΛR =∂(UWVT )

∂EΛE

∂(UWVT )∂E

T

The derivative of UWVT with respect to the element eij of E is given by

∂(UWVT )∂eij

=∂U∂eij

WVT + UW∂VT

∂eij

The derivatives ∂U∂eij

and ∂VT

∂eijin the above expression are computed with the

aid of the proposed differentiation method.Regarding the covariance of T, let V3 denote the vector corresponding to

the third column of V. The covariance of translation is then simply

ΛT =∂V3

∂EΛE

∂V3

∂E

T

,

with ∂V3∂E being again computed using the proposed method.

4 Conclusions

The Singular Value Decomposition is a linear algebra technique that has beensuccessfully applied to a wide variety of domains that involve matrix computa-tions. In this paper, a novel technique for computing the Jacobian of the SVDcomponents of a matrix with respect to the matrix itself has been described.The usefulness of the proposed technique has been demonstrated by applying itto the estimation of the uncertainty in three different practical vision problems,namely self-calibration, epipole estimation and rigid 3D motion estimation.

Page 15: Estimating the Jacobian of the Singular Value Decomposition

568 T. Papadopoulo and M.I.A. Lourakis

Acknowledgments The authors are very grateful to Prof. Rachid Deriche forhis continuous support during this work.

References

1. E. Anderson, Z. Bai, C. Bishof, J. Demmel, J. Dongarra, J. D. Croz, A. Greenbaum,S. Hammarling, A. McKenney, S. Ostrouchov, and D. Sorensen. LAPACK Users’Guide. Society for Industrial and Applied Mathematics, 3600 University CityScience Center, Philadelphia, PA 19104-2688, second edition, 1994.

2. K. Arun, T. Huang, and S. Blostein. Least-squares fitting of two 3-D point sets.IEEE Transactions on Pattern Analysis and Machine Intelligence, 9(5):698–700,Sept. 1987.

3. A. Bjorck. Numerical methods for least squares problems. SIAM, 1996.4. T. Chen, S. Amari, and Q. Lin. A unified algorithm for principal and minor

components extraction. Neural Networks, 11(3):385–390, 1998.5. G. Csurka, C. Zeller, Z. Zhang, and O. Faugeras. Characterizing the uncertainty of

the fundamental matrix. CVGIP: Image Understanding, 68(1):18–36, Oct. 1997.6. J. Demmel and K. Veselic. Jacobi’s method is more accurate than QR. SIAM

Journal on Matrix Analysis and Applications, 13:1204–1245, 1992.7. K. Diamantaras and S. Kung. Multilayer neural networks for reduced-rank appro-

ximation. IEEE Trans. on Neural Networks, 5(5):684–697, 1994.8. O. Faugeras. Three-Dimensional Computer Vision: a Geometric Viewpoint. MIT

Press, 1993.9. N. Georgis, M. Petrou, and J. Kittler. On the correspondence problem for wide

angular separation of non-coplanar points. Image and Vision Computing, 16:35–41,1998.

10. G. Golub and C. V. Loan. Matrix computations. The John Hopkins UniversityPress, Baltimore, Maryland, second edition, 1989.

11. R. Hartley. Kruppa’s equations derived from the fundamental matrix. IEEE Tran-sactions on Pattern Analysis and Machine Intelligence, 19(2):133–135, Feb. 1997.

12. R. I. Hartley. Estimation of relative camera positions for uncalibrated cameras.In G. Sandini, editor, Proceedings of the 2nd European Conference on ComputerVision, pages 579–587, Santa Margherita, Italy, May 1992. Springer-Verlag.

13. R. I. Hartley. Cheirality invariants. In Proceedings of the ARPA Image Understan-ding Workshop, pages 745–753, Washington, DC, Apr. 1993. Defense AdvancedResearch Projects Agency, Morgan Kaufmann Publishers, Inc.

14. D. Jones and J. Malik. Computational framework for determining stereo cor-respondence from a set of linear spatial filters. Image and Vision Computing,10(10):699–708, 1992.

15. B. N. K. Konstantinides and G. Yovanof. Noise estimation and filtering using block-based singular value decomposition. IEEE Trans. on Image Processing, 6(3):479–483, 1997.

16. K. Kanatani. Analysis of 3-D rotation fitting. IEEE Transactions on PatternAnalysis and Machine Intelligence, 16(5):543–54, 1994.

17. K. Kanatani. Statistical Optimization for Geometric Computation: Theory andPractice. Elsevier Science, 1996.

18. R. Liu and T. Tan. A new SVD based image watermarking method. In Proc. ofthe 4th Asian Conference on Computer Vision, volume I, pages 63–67, Jan. 2000.

Page 16: Estimating the Jacobian of the Singular Value Decomposition

Estimating the Jacobian of the SVD 569

19. H. Longuet-Higgins. A computer algorithm for reconstructing a scene from twoprojections. Nature, 293:133–135, 1981.

20. M. I. Lourakis and R. Deriche. Camera self-calibration using the singular va-lue decomposition of the fundamental matrix: From point correspondences to 3Dmeasurements. Research Report 3748, INRIA Sophia-Antipolis, Aug. 1999.

21. M. I. Lourakis and R. Deriche. Camera self-calibration using the Kruppa equationsand the SVD of the fundamental matrix: The case of varying intrinsic parameters.Research report, INRIA Sophia-Antipolis, 2000. In preparation.

22. M. I. Lourakis and R. Deriche. Camera self-calibration using the singular valuedecomposition of the fundamental matrix. In Proc. of the 4th Asian Conferenceon Computer Vision, volume I, pages 403–408, Jan. 2000.

23. Q.-T. Luong and O. Faugeras. Self-calibration of a moving camera from point cor-respondences and fundamental matrices. The International Journal of ComputerVision, 22(3):261–289, 1997.

24. Q.-T. Luong and O. Faugeras. On the determination of epipoles using cross-ratios.CVGIP: Image Understanding, 71(1):1–18, July 1998.

25. S. J. Maybank and O. D. Faugeras. A theory of self-calibration of a moving camera.The International Journal of Computer Vision, 8(2):123–152, Aug. 1992.

26. M. Moonen and B. D. Moor, editors. SVD and Signal Processing III: Algorithms,Analysis and Applications. Elsevier, Amsterdam, 1995.

27. T. Morita and T. Kanade. A sequential factorization method for recovering shapeand motion from image streams. IEEE Transactions on Pattern Analysis andMachine Intelligence, 19(8):858–867, 1997.

28. C. Poelman and T. Kanade. A paraperspective factorization method for shape andmotion recovery. IEEE Transactions on Pattern Analysis and Machine Intelligence,19(3):206–218, 1997.

29. W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling. NumericalRecipes in C. Cambridge University Press, 1988.

30. S. Roy, J. Meunier, and I. Cox. Cylindrical rectification to minimize epipolardistortion. In Proceedings of the International Conference on Computer Visionand Pattern Recognition, pages 393–399, San Juan, Puerto Rico, June 1997. IEEEComputer Society.

31. L. Scharf. The SVD and reduced rank signal processing. Signal Processing,25(2):113–133, 1991.

32. A. Shashua and N. Navab. Relative affine structure - canonical model for 3Dfrom 2D geometry and applications. IEEE Transactions on Pattern Analysis andMachine Intelligence, 18:873–883, 1996.

33. G. W. Stewart. Error and perturbation bounds for subspaces associated withcertain eigenvalue problems. SIAM Review, 15(4):727–764, Oct. 1973.

34. P. Sturm and B. Triggs. A factorization based algorithm for multi-image projec-tive structure and motion. In B. Buxton, editor, Proceedings of the 4th EuropeanConference on Computer Vision, pages 709–720, Cambridge, UK, Apr. 1996.

35. C. Tomasi and T. Kanade. Shape and motion from image streams under ortho-graphy: a factorization method. The International Journal of Computer Vision,9(2):137–154, 1992.

36. R. Tsai, T. Huang, and W. Zhu. Estimating three-dimensional motion parametersof a rigid planar patch, II: singular value decomposition. IEEE Transactions onAcoustic, Speech and Signal Processing, 30(4):525–534, 1982.

37. S. Umeyama. Least-squares estimation of transformation parameters between twopoint patterns. IEEE Transactions on Pattern Analysis and Machine Intelligence,13(4):376–380, 1991.

Page 17: Estimating the Jacobian of the Singular Value Decomposition

570 T. Papadopoulo and M.I.A. Lourakis

38. R. J. Vaccaro. A second-order perturbation expansion for the svd. SIAM Journalon Matrix Analysis and Applications, 15(2):661–671, Apr. 1994.

39. C. Wu, M. Berry, S. Shivakumar, and J. McLarty. Neural networks for full-scaleprotein sequence classification: Sequence encoding with singular value decomposi-tion. Machine Learning, 21(1-2), 1995.

40. J. Yang and C. Lu. Combined techniques of singular value decomposition andvector quantization for image coding. IEEE Trans. on Image Processing, 4(8):1141–1146, 1995.

41. C. Zeller and O. Faugeras. Camera self-calibration from video sequences: theKruppa equations revisited. Research Report 2793, INRIA, Feb. 1996.

42. M. Zhang, K. Yu, and R. Haralick. Fast correlation registration method usingsingular value decomposition. International Journal of Intelligent Systems, 1:181–194, 1986.

43. Z. Zhang, R. Deriche, O. Faugeras, and Q.-T. Luong. A robust technique formatching two uncalibrated images through the recovery of the unknown epipolargeometry. Artificial Intelligence Journal, 78:87–119, Oct. 1995.