2000 Eccv SVD Jacobian
2000 Eccv SVD Jacobian
– Several optimization methods require that the Jacobian of the criterion that
is to be optimized is known. This is especially true in the case of complicated
criteria. When these criteria involve the SVD, the method proposed in this
paper is invaluable for providing analytical estimates of their Jacobians. As
will be further explained latter, numerical computation of such Jacobians
using finite differences is not as straightforward as it might seem at a first
glance.
– Computation of the covariance matrix corresponding to some estimated
quantity requires knowledge of the Jacobians of all functions involved in the
estimation of the quantity in question. Considering that the SVD is quite
common in many estimation problems in vision, the method proposed in
this work can be used in these cases for computing the covariance matrices
associated with the estimated objects.
lustrates the use of the proposed technique with three examples of covariance
matrix estimation. The paper concludes with a brief discussion in section 4.
The singular values are the square roots of the eigenvalues of the matrix
AAT (or AT A since these matrices share the same non-zero eigenvalues) while
the columns of U and V (the singular vectors) correspond to the eigenvectors of
AAT and AT A respectively [17]. As defined in Eq.(1), the SVD is not unique
since
– it is invariant to arbitrary permutations of the singular values and their
corresponding left and right singular vectors. Sorting the singular values
(usually by decreasing magnitude order) solves this problem unless there
exist equal singular values.
– simultaneous changes in the signs of the vectors Ui and Vi do not have any
impact on the leftmost part of Eq.(1). In practice, this has no impact on
most numerical computations involving the SVD.
ij
where ΩU is given by
ij ∂U
ΩU = UT . (4)
∂aij
ij
From Eq. (3) it is clear that ΩU is an antisymmetric matrix. Similarly, an anti-
ij
symmetric matrix ΩV can be defined for V as
ij ∂V T
ΩV = V. (5)
∂aij
ij ij
Notice that ΩU and ΩV are specific to each differentiation ∂a∂ij .
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:
∂A ij ∂D ij
UT V = ΩU D+ + DΩV . (6)
∂aij ∂aij
ij ij
Since ΩU and ΩV are antisymmetric matrices, all their diagonal elements
are equal to zero. Recalling that D is a diagonal matrix, it is easy to see that
ij ij
the diagonal elements of ΩU D and DΩV are also zero. Thus, Eq. (6) yields the
derivatives of the singular values as
∂dk
= uik vjk . (7)
∂aij
Taking into account the antisymmetry property, the elements of the matrices
ij ij
ΩU and ΩV 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):
( ij ij
dl ΩUkl + dk ΩV kl = uik vjl
ij ij
(8)
dk ΩUkl + dl ΩV kl = − u il vjk ,
where the index ranges are k = 1 . . . N and l = i + 1 . . . N . Note that, since
the dk are positive numbers, this system has a unique solution provided that
dk 6= dl . Assuming for the moment that ∀ (k, l), dk 6= dl , the N (N2−1) parameters
ij ij
defining the non-zero elements of ΩU and ΩV can be easily recovered by solving
N (N −1)
the 2 corresponding 2 × 2 linear systems.
ij ij ∂U ∂V
Once ΩU and ΩV have been computed, ∂a ij
and ∂a ij
follow as:
∂U ij ∂V ij
= UΩU , = −VΩV . (9)
∂aij ∂aij
In summary, the desired derivatives are supplied by Eqs. (7) and (9).
Degenerate SVDs. Until now, the case where the SVD yields at least two
identical singular values has been set aside. However, such cases occur often in
practice, for example when dealing with the essential matrix (see section 3.3
ahead) 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 to
Eq. (1) with the term dl Uk VkT + Ul VlT . 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
This will give the exact Jacobian in non-degenerate cases and the “minimum
norm” Jacobian when one or more singular values are equal.
3 Applications
In this section, the usefulness and generality of the proposed SVD differentiation
method are demonstrated by applying it to three important vision problems.
Before proceeding to the description of each of these problems, we briefly state
a theorem related to error propagation that is essential for the developments in
the subsections that follow. More specifically, let x0 ∈ RN be a measurement
vector, 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 , given
the uncertainty of x0 . Let x ∈ RN be a random vector with mean x0 and
covariance Λx = E[(x − x0 )(x − x0 )T ]. The vector y = f (x) is also random and
its covariance Λy up to first order is equal to
T
∂f (x0 ) ∂f (x0 )
Λy = Λx , (10)
∂x0 ∂x0
where ∂f∂x(x0 )
0
is the derivative of f at x0 . For more details and proof, the reader
is 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 image
measurements are always corrupted by noise, the estimation of the uncertainty
related to these entities is essential for effectively and correctly employing the
latter in subsequent computations.
The first application that we deal with is that of self-calibration, that is the
estimation of the camera intrinsic parameters without relying upon the existence
of a calibration object. Instead, self-calibration employs constraints known as
the Kruppa equations, which are derived by tracking image features through an
image sequence. More details regarding self-calibration can be found in [25,41,23,
560 T. Papadopoulo and M.I.A. Lourakis
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 is
to the estimation of these variances that the proposed differentiation method is
applied. More specifically, applying Eq.(10) to the case of the simplified Kruppa
equations, it is straightforward to show that the variance of the latter is appro-
ximated by
T
∂πi (SF , K) ∂SF ∂SF T ∂πi (SF , K)
σπ2 i (SF , K) = ΛF
∂SF ∂F ∂F ∂SF
Mean a_u relative error vs. noise standard deviation Mean a_v relative error vs. noise standard deviation
8 9
with cov with cov
without cov 8 without cov
7
Mean a_u relative error (%)
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5 2 2.5 3 3.5 4
Noise standard deviation (pixels) Noise standard deviation (pixels)
Std deviation of a_u relative error vs. noise standard deviation Std deviation of a_v relative error vs. noise standard deviation
8 11
with cov with cov
Std deviation of a_u relative error (%)
7
without cov Std deviation of a_v relative error (%) 10 without cov
9
6 8
5 7
6
4
5
3 4
2 3
2
1
1
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5 2 2.5 3 3.5 4
Noise standard deviation (pixels) Noise standard deviation (pixels)
Fig. 1. The error in the recovered focal lengths in the presence of noise, with and
without employing the covariance. Mean values are shown in the top row, standard
deviations in the bottom.
pixels in steps of 0.1. A non-linear method [43] was then employed to estimate
from the noisy retinal points the fundamental matrices corresponding to the si-
mulated displacements. The estimates of the fundamental matrices serve as the
input 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 2D
correspondences, 100 experiments were run for each noise level, each time using
a different random set of 3D points. More details regarding the simulation can
be found in [20]. Figures 3.1 and 3.1 illustrate the mean and standard deviation
of the relative error for the intrinsic parameters versus the standard deviation of
the 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 been
assumed, 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 deviation
of the relative error, the inclusion of covariances yields more accurate and more
stable estimates of the intrinsic calibration parameters. Additional experimental
results can be found in [20]. At this point, it is also worth mentioning that in
the case of self-calibration, the derivatives ∂S
∂F were also computed analytically
F
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. As
expected, the arithmetic values of the derivatives obtained in this manner were
identical to those computed by the differentiation method proposed here.
Mean u_0 relative error vs. noise standard deviation Mean v_0 relative error vs. noise standard deviation
22 20
with cov with cov
20 without cov 18 without cov
18 16
Mean u_0 relative error (%)
2 2
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5 2 2.5 3 3.5 4
Noise standard deviation (pixels) Noise standard deviation (pixels)
Std deviation of u_0 relative error vs. noise standard deviation Std deviation of v_0 relative error vs. noise standard deviation
44 24
with cov with cov
22
Std deviation of u_0 relative error (%)
32 18
16
28
14
24
12
20
10
16
8
12 6
8 4
4 2
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5 2 2.5 3 3.5 4
Noise standard deviation (pixels) Noise standard deviation (pixels)
Fig. 2. The error in the recovered principal points in the presence of noise, with and
without employing the covariance. Mean values are shown in the top row, standard
deviations in the bottom.
The epipoles of an image pair are the two image points defined by the projection
of each camera’s optical center on the retinal plane of the other. The epipoles
encode information related to the relative position of the two cameras and have
been 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.
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 fundamental
matrix.
Let e and e0 denote the epipoles in the first and second images of a stereo
pair respectively. The epipoles can be directly estimated from the SVD of the
fundamental matrix F as follows. Assuming that F is decomposed as F = UDVT
and recalling that FT e0 = Fe = 0, it is easy to see that e corresponds to the
third column of V, while e0 is given by the third column of U. The epipoles are
thus given by two very simple functions fe and fe0 of the vector SF defined by the
SVD of F. More precisely, fe (SF ) = V3 and fe0 (SF ) = U3 , where V3 and U3
are the third columns of matrices V and U respectively. A direct application of
Eq. (10) can be used for propagating the uncertainty corresponding to F to the
estimates 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 covariances
is 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 e0 were within
them, namely at pixel coordinates (458.123, 384.11) and (526, 402) respectively.
The set of generated points was contaminated by different amounts of noise and
then the covariances of the epipoles estimated analytically using Eq. (10) were
compared to those computed using a statistical method which approximates
the covariances by exploiting the laws of large numbers. In simpler terms, the
mean of a random vector y can be approximated by the discrete PN mean of a
sufficiently large number N of samples, defined by ED [y] = N1 i=1 yi and the
corresponding covariance by
N
ED [(yi − ED [y])(yi − ED [y])T ]. (13)
N −1
Assuming additive Gaussian noise whose standard deviation increased from 0.1
to 2.0 in increments of 0.1 pixels, the analytically computed covariance estimates
were 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 standard
deviation σ to the original set of corresponding pairs. Then, 1000 epipole pairs
were computed through the estimation of the 1000 fundamental matrices pertai-
ning to the 1000 noise corrupted samples. Following this, the statistical estimates
of the two epipole covariances were computed using Eq.(13) for N = 1000. To
estimate the epipole covariances with the analytical method, the latter is applied
to the fundamental matrix corresponding to a randomly selected sample of noisy
pairs.
In order to facilitate both the comparison and the graphical visualization of
the estimated covariances, the concept of the hyper-ellipsoid of uncertainty is
introduced next. Assuming that a M × 1 random vector y follows a Gaussian
distribution with mean E[y] and covariance Λy , it is easy to see that the random
vector χ defined by χ = Λy −1/2 (y−E[y]) follows a Gaussian distribution of mean
564 T. Papadopoulo and M.I.A. Lourakis
zero and of covariance equal to the M × M identity matrix I. This implies that
the random variable δy defined as
δy = χT χ = (y − E[y])T Λy −1 (y − E[y])
analytical e covariance
95 analytical e’ covariance
statistical e covariance
statistical e’ covariance
85 ideal (75%)
75
65
55
45
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Noise standard deviation (pixels)
Fig. 3. The fraction of 1000 estimates of the two epipoles that lie within the uncertainty
ellipses defined by the corresponding covariances computed with the analytical and
statistical 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 points
in the two dimensional Euclidean space R2 rather than in the embedding pro-
jective space P 2 . This is simply accomplished by normalizing the estimates of
the epipoles obtained from the SVD of the fundamental matrix so that their
2
The norm defined by the left hand side of Eq.(14) is sometimes referred to as the
Mahalanobis distance.
Estimating the Jacobian of the SVD 565
third element is equal to one. Choosing the probability Pχ2 (k, r) of an epipole
estimate 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 computed
with the analytical and statistical method, as a function of the noise standard
deviation. Clearly, the fractions of points within the ellipses corresponding to
the 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 with
the analytical method are satisfactory, with the corresponding fractions being
over 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, namely
0.1, 1.0 and 2.0 pixels. Since the analytical method always underestimates the
covariance, the corresponding ellipses are contained in the ellipses computed by
the statistical method. Nevertheless, the shape and orientation of the ellipses
computed with the analytical method are similar to these of the statistically
computed ellipses.
There exist several methods for extracting estimates of the translation and ro-
tation from estimates of the essential matrix. Here, we focus our attention to
a simple linear method based on the SVD of E, described in [19,12]. Assuming
that the SVD of E is E = UDVT , there exist two possible solutions for the
rotation R, namely R = UWVT and R = UWT VT , where W is given by
010
W = −1 0 0
001
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 possible
signs of T yield four possible translation-rotation pairs, from which the correct
solution for the rigid motion can be chosen based on the requirement that the
visible 3D points appear in the front of both camera viewpoints [19]. In the
566 T. Papadopoulo and M.I.A. Lourakis
Uncertainty ellipses for e when the noise std dev is 0.1 Uncertainty ellipses for e’ when the noise std dev is 0.1
385 402.8
statistical covariance statistical covariance
384.8 analytical covariance 402.6 analytical covariance
384.6 402.4
384.4
402.2
384.2
402
384
401.8
383.8
401.6
383.6
383.4 401.4
383.2 401.2
383 401
456.5 457 457.5 458 458.5 459 459.5 524.5 525 525.5 526 526.5 527
Uncertainty ellipses for e when the noise std dev is 1.0 Uncertainty ellipses for e’ when the noise std dev is 1.0
394 410
statistical covariance statistical covariance
392 analytical covariance 408 analytical covariance
390
406
388
404
386
384 402
382 400
380
398
378
396
376
374 394
372 392
445 450 455 460 465 470 516 518 520 522 524 526 528 530 532 534 536
Uncertainty ellipses for e when the noise std dev is 2.0 Uncertainty ellipses for e’ when the noise std dev is 2.0
410 430
statistical covariance statistical covariance
405 analytical covariance 425 analytical covariance
400 420
395 415
390 410
385 405
380 400
375 395
370 390
365 385
360 380
430 440 450 460 470 480 490 490 500 510 520 530 540 550 560
Fig. 4. The ellipses defined by Eq. (14) using k = 0.75 and the covariances of the two
epipoles computed by the statistical and analytical method. The left column corre-
sponds to e, the right to e0 . The standard deviation of the image noise is 0.1 pixels
for the first row, 1.0 and 2.0 pixels for the middle and bottom rows respectively. Both
axes in all plots represent pixel coordinates while points in the plots marked with grey
dots correspond to estimates of the epipoles obtained during the statistical estimation
process.
Estimating the Jacobian of the SVD 567
following, the covariance corresponding only to the first of the two solutions for
rotation will be computed; the covariance of the second solution can be computed
in 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
T
∂(AT FA) ∂(AT FA)
ΛE = ΛF ,
∂F ∂F
T
where ∂(A∂FFA) 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) ∂F
= AT A
∂fij ∂fij
∂F
Matrix ∂f ij
is such that all its elements are zero, except from that in row i and
column j which is equal to one. Given the covariance of E, the covariance of R
is then computed from
T
∂(UWVT ) ∂(UWVT )
ΛR = ΛE
∂E ∂E
The derivative of UWVT with respect to the element eij of E is given by
∂(UWVT ) ∂U ∂VT
= WVT + UW
∂eij ∂eij ∂eij
T
∂U
The derivatives ∂eij
and ∂V∂eij in 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
∂V3 ∂V3 T
ΛT = ΛE ,
∂E ∂E
∂V3
with ∂E being again computed using the proposed method.
4 Conclusions
The Singular Value Decomposition is a linear algebra technique that has been
successfully applied to a wide variety of domains that involve matrix computa-
tions. In this paper, a novel technique for computing the Jacobian of the SVD
components of a matrix with respect to the matrix itself has been described.
The usefulness of the proposed technique has been demonstrated by applying it
to the estimation of the uncertainty in three different practical vision problems,
namely self-calibration, epipole estimation and rigid 3D motion estimation.
568 T. Papadopoulo and M.I.A. Lourakis
Acknowledgments The authors are very grateful to Prof. Rachid Deriche for
his continuous support during this work.
References
38. R. J. Vaccaro. A second-order perturbation expansion for the svd. SIAM Journal
on Matrix Analysis and Applications, 15(2):661–671, Apr. 1994.
39. C. Wu, M. Berry, S. Shivakumar, and J. McLarty. Neural networks for full-scale
protein 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 and
vector 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: the
Kruppa equations revisited. Research Report 2793, INRIA, Feb. 1996.
42. M. Zhang, K. Yu, and R. Haralick. Fast correlation registration method using
singular 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 for
matching two uncalibrated images through the recovery of the unknown epipolar
geometry. Artificial Intelligence Journal, 78:87–119, Oct. 1995.