Professional Documents
Culture Documents
Introductory Techniques For 3D Computer Vision
Introductory Techniques For 3D Computer Vision
cofora-+ 6, (UL11 ellbusthata 3D pose cannot be estimated ft tne del
eins are cole In praice the numeral solution willbe l-eonitoned whenever the
‘model pont are sealy cline; his situation should be avoided
Here isa summary ofthe algorithm that recovers the coordinates ofthe seene
points n the camera frame.
‘Algorithm WEAK_PERSP_INV
‘The input stormed by hee model points PF, PY, PY, and tbe tre corresponding mage pins,
PoP Pe
1 Compute the seal factor wing (1.10) and (119).
2 Compute the cocinats ofthe scene points using (1.1).
‘The outputs formed by the coordinates ofthe scene points imaged, Py, Py, Ps, expresed in
the camera reference fame
‘Stage 2: Solving for the Pose. We now turn briefly tothe second stage of our
method, ie, how to compute the rigid transformation bringing the model points onto
the scene points expressed inthe camera reference frame. We pointed out already that,
asthe input i now a tof 3D points expressed i the camera frame, this corresponds
exactly to solving location from range data. Several solutions to this problem are dis-
cussed in ection 11.3, and any of them can be coupled to WEAK PERSP_INV to
complete the slutiono the lation problem from a weak-perspectve image
Youcanzegatd
ein features
“AK. PERSP_INV san algorithm econstrstng shape acre) rom292 Chapter 11 Locating Objecsin Space
CIRCLE PLANE
IMAGE PLANE.
z
Figure 11.6 The cone and two ofthe thre reference frum used by
POSE FROM ELLIPSE. Notice tht th ais forms a generic angle
itn,
11.2.3 Pose from Ellipses
‘We conclude the section on intensity-based location with an algorithm estimating the
pose of a circle in space from a singe intensity image. Given that many man-made
objects contain circles, which are imaged as ellipses, this is @ useful too! in many
situations; eg, estimating the orientation of a vehicle relative to a circular target for
vision-guided docking
‘The geometry ofthe algorithm, POSE_FROM_ELLIPSE, is illustrated in Fig
‘ure 116. The image ellipse delins a cone with vertex in te centr of projection ofthe
pinhole camera, We can fnd the orientation ofthe circle's plane, x, by rotating the cam
‘era so that the intersection ofthe cane withthe image plane becomes circle, which
happens when the image plane is parallel tothe circle, This rotation is estimated asthe
‘composition of two successive rotations: The first put the Z axis through the center of
the circle, and aligns the X and Y axes with the axes of the image ellipse; the second
rotates the reference frame around the new ¥ axis until the image plane becomes par
allel to. In general this problem has two distint solution, due to a twofold ambiguity
{nthe determination of the second rotaton’s angle
How do we estimate the two rotations? Let aX? + XY + c¥? dX +e¥ + f=0
‘be the equation ofthe ellipse in the image plane. We assume all distances expressed in
multiples of the focal length, which s therefore set to 1. The equation ofthe conesthen
PTCP=0, «112
[X,¥, Zand isthe real, symmetrie matrix ofthe elise, The frst rotation,
‘ansforming the frame OXY7Z into OX'¥'Z’ and sending point Po P is determined
AN? 4X +e? ANZ HOYT +f
Section 1.2 Matching from Intensity Data 283
simply by iagonalizing C. 14, 22,2 re the eigenvalues of C, with A; < Ay < As, and
1, €2,€5 the corresponding eigenvalues, we have
P= R]P=[ejele)" P.
‘The second rotation is determined by imposing the equality ofthe coefficients of 1?
and ¥°, resulting in arotation around the ¥ axis by an angle
which sets a = c= 3a, Notice the twofold ambiguity in 8, which cannot be resolved in
the absence of further constraints Inthe X'7'Z frame, the second rotation is therefore
identified by a matrix
cos? 0 sind
m=| 0 1 0
sin? 0 cos
‘which brings OX'Y'2'ontoa new frame OX"Y"Z". The global rotation matrix, R, ithe
composition of Ry and; tha is, R = Ry. The normal to plane x is therefore
“(4
Following isa descripion ofthe algorithm.
‘Algorithm POSE_FROM_ELLIPSE
‘The input isthe implicit equation of an image ellipse, (11.12), pespective projection of a ele
inspace on plane. The focal legthisset to ll distances are expressed in focal length wits
1. Compute the eigenvalues },2,33 0f€ (1 <}y <2s),and the corresponding eigenvectors
2 Compute he rwovalues =
Compute he rrsion matic
rcan ER
ue 0 sno
rota “OE
© Somoclipes maybe partly vise because of surface discontinuities or eckson from
‘other objects, In sack eases, errors may crep into the ellipse ft, and consequently into294 Chapter 11. Locating Objects in Space
the orientation estimates Notice that POSE_FROM ELLIPSE canbe regarded a de-
termini shape fram-eaure algorithm or surfaces covered by cles The cocesponding
ellipses in dhe images must be large enough o be extracted reliably by an clipe detector
(Chapter),
11.24 Concluding Remarks
‘We conclude this section with some comments on the strengths and weaknesses ofthe
‘two methods described, and a word of caution, First ofall, which method should we
‘use, and when? The answer depends on a nusnber of factor In short, 3D_POSE is
considerably more complicated from the computational viewpoint, butcanlbe employed
with points, lines, or arbitrary combinations thereof Further strengths of 3D_POSE
Include the ability to aust automatically toa variable numberof data features, and
the possibilty to include unknown model parameters inthe estimation process A limit,
isthe need for an initial guess ofthe solution. WEAK_PERSP_INV is computationally
simpler, but is likely to be less effective in the presence of large amounts of noise,
as practically every method based on the minimum amount of information needed to
compute a unique solution. For details on the important issue of robustness against
noise, see the Further Readings (as wel as Appendix, section A.7)
‘We reiterate that any answers should be verified against the data Ideally, veri-
fication could exploit all the features extracted from the image, which in general are
‘many more than those used for solving location. However, occlusions, missing features,
false correspondences and inaccuracies of numerical estimates contribute to make ver
ification a difficult operation in itselt As discussed in the context of invaiants-based
identification (Chapter 10), verification can be used not only to check the accuracy
‘of the estimated location ofan object, but also the hypothesized object identity (the
model selected). The complexity of efficient procedures for pose verification are beyond
the scope ofthis introductory chapter; the interested reader is refered tothe Further
Readings,
11.3. Matching from Range Data
‘Wenow tumtomodelbased objet location froma single range image. As done through
‘ot this chapter we assim that the identification problems hasbeen solved; we mus
now match a given objectcentered, feature-ased model toa given subset of range
data, knowing the coresponding pairs of model and data features. All model points
and vectors are expresedin the model reference frame associated wih the model ll
datapoints and vectors areexpresedin the senso reference frame, defined by the range
sensor asd to segue the image, and known frm cabration.
‘As model and data are now directly comparable (bth ae specified by 3D co-
ordinates), we are better of than in the intensity case: We jst have to find the rigid
transformation which aligns the model with the dat, and no projection is involved
‘This acualy an assumption that doesnot relet the way in which some range sensors
operate (for insane, sale factor ould be invoincd),
Section 1.3 Matching from Range Data 285
LOCATED NODEL REF. FRAME.
DATA (VISIBLE SURFACES) »
SENSOR REF. FRAME
MODEL REF. FRAME AT START
Figure 117. A2. istration ofthe location problem with range data,
Staring wih the model reference frame superimposed onthe sensor
reference fame, we mst estimate the transformation R,T bringing the
model ono the dat
‘You can visualise « model reference frame initially coincident with the sensor
reference frame, then rotated and translated so that the model points coincide with
their corresponding datapoints; Figure 11.7 ilutrates ths idea with a2-D example,
In the following we assume that the features forming both model and data are
surface patches, extracted as discussed in Chapter 4; for simplicity, we consider only
planar paces.
‘© Plnarpatchesareeay to represent and ther normals canbe estimated reliably from range
{ata proved rg enough portion of the patch vibe A sfsienty high number of
Planar patches ea to acurate location estimates,
Following are the problem statement and our explicit assumptions
‘Assumptions
The range image const a known objec in unknown poston and oentaton.
Ast of feature desciptors dy... desrbing the vise planar patches of the object is
avalable; each patch dosriptor contains estimates ofthe patch centr, andthe patch236,
Chapter 11 Locating Object in Space
oral exes inthe sensor fees ram, wel the tase fhe pln fhe
ch om thoi
‘An ot onesies mal ofthe bet aval, he rg fhe ode
rerense rane thot cent. Te model Sexcpor fh Wie athe am
ind the ath etd ante al’ pomal bike xed ihe el tren
frames elas the dite fhe ple ote pth om he
‘Mosel estore ospond data desig, forall ewe Land N
Problem Statement
Compute the rig transformation (rotation and transaton of the model reference fame) lig
ing mel and data,
"The data are supplied by segmentation and identification algorithms, and typi
cally corupted by noise ofa least three kinds First, all data measurements (normals,
centroids, distances) are estimates and eatry numerical errors. Second, some correspon
‘ences may be fale, Third, some data patches may be partially occluded (so that their
centroid does not coincide with that ofthe complete model patch), and some model
patches completely invisible (o that only a subset of the model patches can be used for
cation). Al these factors contribute tothe uncertainty of location estimates
‘We solve the location problem in two ways, differing forthe order in which we
cstimate rotation and translation, and forthe data used:
‘+ esiating translation frst, and representing the planar patches by their normals,
and centroids;
“+ esimating rotation frst, and representing the planar patches by their normals as
well asthe equations ofthe associated planes
113.1. Estimating Translation First
‘This method computes the translation of the object's centroid fist, then uses the result
‘tocompute the rotation, inthe translated reference frame, bringing the ranslated model
‘onto the data
Estimating Translation. fest idea is suggested by the fact that, atthe begin:
ning, the model reference frame coincides withthe sensor reference frame Figure 11.7);
therefore, an estimate of the tansation of the object centroid is obtained simply by
averaging the centroids of all the data patches. The resulting algorithm is extremely
simple
‘Algorithm TRANSL, RANGE,
‘The inputs formed by the observed centroids ofthe data paches i, ..-.P
"The ouput isan estimate ofthe object centro
Se ony
Section 113 Matching from Range Date 287
‘This simple algorithm does not need rotation estimates, but is not free from
problems. How relicble is 1? In general, the average altenvates the errors on the
centroid data; however, if some of the patches imaged are partially occluded, their
centroids will be wrong, and this eror will affect T (Exercise 117). Moreover, the
average of the visible centroids is generally different than the erage of al the patch
centroids in the model, and some views ofthe objet can make ths problem particularly
Severe, The conclusion is that this algorithm is ony a fist idea and must be improved
"upon: we do soi the next section.
‘Unfortunately, 3-D rotations are trickier than translations s they can he repre
sented in several diffrent ways (Appendix, sction A.9). We must therefore choose &
‘representation first, then use i to estimate the unknown rotation. We present two sim:
ple methods to estimate rotations, based on two different representations For move on
{he representation of -D rotations, you ae referred tothe Further Readings
Estimating the Rotation Matrix. first idea ist estimate the entries ofthe
‘rotation matrix direcly then ensure that the resulting matrix is numerically rthogo.
nal We needa mininum of thre pairs of corresponding data-model normal; the nine
simultaneous equatens resulting,
(as)
constrain completely he nine entries ofthe tation matrix, which brings the model
onto the data
'%* Itis good dea to discard coresponding pis of normals in which the two normals form
liferen angles (lowing fra resonable numerical olerace),
‘Tocounterat th effects of nose, we use al the available pairs of corresponding
‘normals and solve the least-squares problem
axgmyht> Inf ~ Rag?) (1s)
Tosolve problem (1.15) we ntualucea veer, = [Py n,n34m9)--«3|" formed by
the entries ofthe unktown rotation matrix, and write the associated, overconstrained
system of equations
: (6)
here Mf is 3N’ x 9Hlck-diggonal mati and fis a 3N-element vector.
‘Tiss what ei. forinsanc, nthe eration of haiti alpitn EXPL. BARS,
CAL Chspier)
"Note thatthe three vests ead spall ed by the cet oot plc, b this woud be
moe seas iaons,298 Chapter 11 Locating Objects in Space
© Notice that, thanks to the structure of M, sytem (11.16) is formed by three independent
systems cach yielding oe line of (Exercise 118.
Here isthe usual algorithm box,
‘Algorithm ROT_MATRIX RANGE,
“The input is formed by N pis of coreponing dita and vel noma wf... ad
merase
1. Form the overeonstrined system (11.16) and compute the least-squares solution, com
responding toa matrix
2 Toentorce orthogonality on compute its SVD decomposition = UAV", where
100)
asv(o10}o7, uy)
Dor
and set t01 or 1, whatever closest to det(V 0")
& Compute = UAV" using the comected A.
The outputs the bes eassqures esi
© As usual the least squares solution sues fom the peseace of oatlins created by fae
‘correspondences and orasonal lage erorsin the data norma. this case you can run a
‘robust estimator (Appendi, section A7) to identify the outers, eliminate them fom the
ata et, and reapply ROT_MATRIX_ RANGE.
Estimating Axis and Angle, ‘Tho second method is geomettic algorithm based
‘om the axs-angle parametrization (Appendix, section A9). Any 3-D rotation can be
expressed as a rotation around an axis® represented by a -D unit vector n, by acertain
angle, ¢, so that mand p sais the right-hand rule. We assume 6 [0, x], and represent
rotations by angles between x and 2x by using —m instead ofm
“Two corresponding pairs of directions (two model normals two data normals) are
sufficient to idemtity uniguely m and 9, which can be computed by a simple geometric
algorithm, The algorithm considers three possible cases: Fist, the axis of rotation
land the model and data normals are all independent, second, two of the normals
coincide, and therefore define the axis of rotation; third, the model normals, the data
‘normals and the exis of rotation are all coplanar. As usual, we shal use al he available
correspondences Following isthe detailed description of th algorithm,
"isis knowns eran (ut om many heres ze kc by ths me)
Section 113 Matching from Range Data 299
‘Algorithm AXIS_ANGLE_ RANGE
‘The input is formed by pais ofcorespondng dats and model normals. (9)
with = 1,...,¥. We sume no pairs il that a, mh ora, + fr al pairs
1, Forcahi-t puro corresponding norma:
(0) a= (ns, nh a) #10.0.07,
(0 Rajat xa <0) fr
(G) Tacromion ale 6 [7] een by
femal eg PEATE guy
ae?
() ELSE TF nf =n,
@m=my
4) IF (anf cay <0, etm =
®
(o ELSE tal ag,
ands
(i TFCare xa <0,
ww
tan)"
(6) E15 (xo ation coplanar with he ta normal acne with he
tel ors
DOM an =m a2)
(Gi) TE Cafe, <0) 06 (a) <0)
«i
som A= led ad
1am 1)
aus)300 Chapter 11 Locating Objecsin Space
‘The algorithm canbe made more robust in various ways, You can consider ony the pir
in which the deta end model normals frm the sme angles, within 2 reasonable numerical
tolerance. You can ty to identify oars (severely wrong estimates) inthe my and 6
(Exercise 11.10), disacd them, and recompute the averages. You can take the median
instead ofthe mean instep
11.32 Estimating Rotation First
‘The second solution ofthe location problem computes the rotation ofthe object fist,
then computes the translation of the rotated model reference frame which brings the
‘model onto the data
Estimating Rotation. The rotation matrix is computed essentially as in ROT
MATRIXRANGE, but we incorporate the reliability of the data normals possibly
supplied by the acquisition stage, and solve the least-squares problem in a different
===S=======— ===
‘Algorithm ROT_MATRIX. RANGE?
The input i formed by V pais of corresponding data and model nocmal,mf,....mf, and
ifs. -tf respecivey aswell kaso of positive weighs... uy expressing thereby
secede data normals (he lrgerw, the more cle the estimate m)
1. Bail the correlation marc K = 4, wn
2 Compute the SVD K-=VAU A being the diagonal mati of the singular values
‘A. Compute 3= det(VU, andset 8 too, whatever isclosest
44 The test east-quares estimate ofthe rotation mariis
100)
o1oly (1120)
003
‘The output she estimate ofthe rotation mati,
‘2 ifn information on data liability is valle, set
© ROT.MATRIX RANGE? and ROT MATRIX RANGE are essentially two ways of
Solving the same least squares problem. ROT_MATRIX. RANGE oo could be modified
totabe into acount data uncertainties (Exercise 11.9).
Estimating Translation, We now rotate the mode! reference frame sing R, and
proceed to estimate the translation bringing the rotated model onto the data, We make
‘se ofthe equations ofthe patch planes,
Pini =a (uy
Section 113 Matching from Range Data 301
for data and mol respectively isead ofthe patch entoidh used by TRANSL
RANGE (weshalecmment on thicoie inthe next secon) Inthe equations above,
4f and dare he dances ofthe planes (om the on aad Pi gener pit in
shoe. Te indeperden planes constrain the asain compete
Inthe Weal xs, the projection ofthe usknows translation slong the normal of
any plane would be ely the distance between te unrated an traslated plans,
(if =). Therefore we can determine Ta he slution of he east gars problem
‘= aramjni Des — ay Tay (22)
‘where a isthe normal ofthe rotated jth mode plane, Problem (1.2) coresponds
tothe overconraned system of N equations
ajay,
re
with j =1, ..,.N,which cam be rewritten inthe familiar matrix form as
1T=4, (1123)
With L 230 x 3 matix, and da 3N-dimensional vector. Here isthe usual summary
Algorithm TRANSL, RANGE2
‘The nputisformed by tre esti
planar patches, Pa! =f and Ps
rotation matrix, and by the equations aN comesponding
1 foe data and model respectively
1. Rotate the normals al the model patches:
2 Solve the ovecostained system (1.23) by least squares.
‘The outputs the estate ofthe translation vector,
The considerations on outers made for ROT_MATRIX_RANGE apply here to.
11.33. Concluding Remarks
From a mathematical point of view, range-based location appears as litle more than
an exercise on least squares: One way of another, we always setup a least squares
problem, then just twned the crank. The real challenges are robusiness and accuracy,
‘hich depend on how well we can cope with the errors and occlusions corrupting the
ata, and how well wecan dently and discard outlersin sets of input data or numerical
estimates. The Further Readings and Appendix, section A.7 point to suggestions on the
latterpoint Related challenges include segmenting and pairing features and estimating
feature geometry accurately.302
(Chapter 11 Locating Objects in Space
Using plane equations leads to more reliable translation estimates than using
ceatroids, because the latter are more sensitive to partial occlusion. Nonplanar (¢.,
cylindrical, spherical) patches can also support range matching, at the price of more
‘complex descriptors and procedures.
11.4 Summary
‘After working through this chapter you shouldbe able to
{2 explain the problem of 3-D location from intensity and range images
2 explain the different problems involved by the use of intensity and range data
12. design algorithms fr 3-D model matching from intensity and range images, given
set of corresponding feature pai
find the pose ofa circle in space from its image
115 Further Readings
‘The literature on model-based location from intensity images is very rch [14] contains
an interesting collection of papers on -D recognition and location. Fora review on the
recovery of D pose fom pont triplets in the general perspective cas, see Haack et
1a [8} A closed form solution based on quaterions i given by Horn [9]. Murase and
[Nayar [15] i an example of location sytem adopting viewer-entered object models
and models not based on features.
3D_POSE i based on work by Love [LI], who deals withthe uniqueness of the
solution and other issues in his account ofthe SCERPO sjstem. Lowe has also reported
fn extesion forthe location of arbitrary 3D surfaes and articulated objets (12)
WEAK _PERSP_INV is based on Alters thesis [1] (se als [2)), which isan excellent
source of references. Algorithms ROT_MATRIX.RANGE end RANGE_TRANSL
‘wereused by Banu [3]in an earl system for automatic model aoquisiion from multiple
range views. Grimson and Lozano Perez [7] us the axing parameterization and
show an application of AXIS_ANGLE, RANGE. Our algorithm s adapted from Orr
[16], ROT_ MATRIX. RANGE2is based onthesolation givenin Kanatani book (10),
Chapter 5), which includes proofs and a detailed discussion of the algorithm, The same
‘chapier gives a complete mathematical treatment of rotation estimation, least squares
and SVD,
‘Among the Several nfuentil papers on model-based matching, Faugeras and
Hebert [5] apply the pscudoinverse method to obtain the best least-squares transfor-
‘mation; Marshall and Marin [13] discus and refine ths method. Boles and Horaud
describe the local feature focus method, and its implementation in the 3DPO system
[s} designed to dite robot arm to gasp industrial parts RANSAC [6 (fr random
sumple consensus) is an example of robust algorithm, inthe sense of good tolerance 10
cuter inthe data (ee the Appendix, section A.7 for more on robustness).
Section 1.6 Review 303
116 Review
Questions
11 ILI Whatis the location problem? How does it relate to identifcation?
1D 112 How would you modify 3D_POSE if the focal length is unknown?
113 Inthe eas: of lne-to-line correspondence, 3D_POSE requires the choice of
‘wo points on eich matched model line. What isthe best possible choice?
5114 Invhat siuationsisthe weak-perspoctive camera model suitable for model
based matching?
0115 Explain why a model triangle parallel to the image plane (Figure 115) leads
to instabilities in algorithm WEAK_PERSP_INV (Hin Look at what happens it
the locaton of ne of the three points on plane x is perturbed inthe direction
‘orthogonal to the lin identified by the other two points)
13116 Thetwomethodsforrange-based location suggested in section 11 3estimate
rotation and translation in different orders Does this mean thatthe estimated
rotation and translation should be applied in diferent orders to align model and
data? Why?
11 117 What is tre exact difference between applying the rigid transformations
Rix+T) and Re + Ttoa pair of independent vectors u,v? Visualize your rests
bby moving areal object in pace, Can you imagine cases in which the result isthe
same independent of the order of application of rotation and translation?
1 1L8 Under wtich hypotheses iit sensible to take the average of several esti
mates to find an approximate answer, as done in TRANSL. RANGE?
3119 We suggested that algorithm AXIS_ANGLE.RANGE can be made more
robust by using the median, not the mean, in Step 2. Under what assumptions
‘would this work? When would it fil?
1311.0. How world you assign the reliability weights tothe datainput oa location
algorithm ike ROT_MATRIX_RANGE2?Inother words, which elementsin the
processing of the previous modules conteibute measurable uncertainty?
ILI We suggested planar patches as the main features for solving the 3D
location problen with ange data. Can you imagine what problems would aise in
‘ur solutions if eurved patches were adopted instead?
Exercises
© Id Devise numerical and geometric examples showing thatthe order of mult
plication of roticon matrices matters in general (Appendix, section A). Is this
still the case if the rotation angles are very small? Check the results by rotating
‘eal object by wo large and two small rotation angles around the same axes,
respectively, anc altering the order of matrix multiplication
© 112 Think of smple heuristics forthe estimation ofthe initial values of Rand T”
{in 3D_POSE. (Hint Try to make use of information about the centr of gravity of308
Chapter 11 Locating Objects in Space
the data (for 7 and 7), the apparent size (for f), and orientation ofthe matched
image lines (for two ofthe rotation angles),)
© 113° Write outa complete algorithm extending 3D_POSE tothe case of lines, as
suggested in section 11.21,
© 114 The extension suggested in Exercise 113s based on the explicit line equa-
tion (11.6), butthis representation sinadequate for vertical and near-verticallines.
‘Adapt your solution to the line representation x cos + ysin# = d, which does
not have this problem,
© ILS. Devise an algorithm for backprojecting model features onto data, and a
procedure based on the RMS error for estimating the fit between backprojected
‘model features andthe corresponding image features.
116 Show thatthe quantities a and in (1.8) are proportional to the areas of
the model and image triangle, respoctively, Show that a > 0 implies b > 0 and
#2 — ae > 0. (Hint Make use ofthe angles ppop2 and PiPiP>)
(© 117 If only a subset of the model patches are visible, algorithm TRANSL.
[RANGE produces, in general, wrong translations (centroids). Assuming no false
correspondences, explain how the model canbe altered to counteract tis prob-
lem, (Hint: Compute the model centroid using ony the matched patches)
(2 IL. Write out the components of M and f in algorithm ROT MATRIX.
RANGE. Use the result to identify three independent systems within (11.16)
© 119 How would you modify ROT_ MATRIX. RANGE so that the oltion in-
corporate uncertainties on the dato normals?
(© 12.0 How would you identity outers in the m and ¢ of AXIS_ANGLE.
RANGE? Ifyou need help, checkout Append section A.
© 1141. Using the equations inthe Appendix, section A, writ roaton maeix
Rvihch expresses a rotation around [1,1] by 48” anticlockwise. Assume @
right-handed reference frame.
© 11,12 Wrvea program which (a rotates wo syihtievectors, vino w,¥t8-
ing the rotation matrix defined in he previous exereise; (computes an estinate
‘of R using algorithm ROT_MATRIX_RANGE. Iya rotation matrix within
reasonable numerical accuracy?
9 1143. Usingte Restimatedin the previous exercise, writea program thatrotates
buck uy, using, producing di ¥. Compute the distance between the tis of
tia, and ¥,,- How large are the errors? How do they change if you perturh
1, With Gaussian noise of increasing standard deviation?
Projects
© 111 Implement the slgorithm 3D_POSE for point-to-point and ine tole cor-
espondences respectively Using the solution to Exercise 11.3, study the conver
References
by
eI
1
i
5
6
8)
8
uo)
wy
References 305
gence properties ofthe algorithm asa function ofthe numberof features. Test your
‘ode on real imzges of a polyhedral object using the solution to Exercise 115,
112 Implement WEAK_PERPS INV, and test the stability of the results (in
{erm of reconstruction errors) with several data corrupted by varying amounts
of Gaussian noie. Run experiments with several triplets of object points, so that
the angle formed by the image plane with the plane defined by a triplet varies
between about 3 and ©.
13 Implement algorithms ROT_MATRIX.RANGE? and TRANSL
RANGE? using your favorite numerical package. Test your code on synthetic
‘data, obtained by generating sets of points rotating and translating them, and coe
ruptng the resus with nose of various intensity (see the Appendix, section A.
for guidelines or experiments) to check robustness. Ifyou have implemented the
Patch extractor proposed in the project of Chapter 2 o if you have access to a
program extracting adequate features from range data, you can test your code
‘with real data aswell
‘TD. Alter, RobustandEficent3.D Recognition by Alignment, ech Report AP-TR-I410,
“Massachsets Insitute of Technolgy, Cambridge (MA) (1982)
‘TD. Alterand EWI. Grimson, Fast and Robust 3.D Reoogition by Alignment, Proceed:
ings 3d IEEE Iuernational Conference on Comper Vision (193).
'B, Bhanu, Repreeataton and Shage Matching of :D Objects, IEEE Transactions on
Panera Anais ad Machine Iteligence, Vol PAMIS, pp. 40-351 (198),
RC Bolles and PHocaud, PO: A Thee-Dimensional Part Orientation Sytem, IEEE
InernationalIournal of Robotics Research, Val 5, pp. 3-26 (1986).
(OD. Faugeras and M. Heber, The Representation, Recognition, and Location of 3D
Shapes trom Range Dat, Znemacona Jounal of Robots Research, Vol. 5, pp. 272
(0986,
‘M.A. Fichler and C. Bolles Random Sample Consensus A Parag for Mode Fiting
wi Applications Image Analsisand Automated Carogrphy, Communications of the
ACM, Vol 24, 9p. 381385 (1981),
WEL. Grimson an T Lozano Péter, Mode-Based Reeogiton and Localization fom
Sparse Rang a Tete Data, Inertial Journal of Roboie Research, Vol 3, pp 3-33
(i984),
RM. Haralick, C. Lee, K. Ottenberg and M. Noll, Analysis of Solutions of the Throe
Point Perspective Pose Estimation Problem, Proc, IEEE Int Cont on Compute Vion
snd Pater Recogtion, pp. 82-8 (19)
BK. Horn, Cloed-Form Solution of Absolute Orientation Using Unit Quaterions,
Journal of he Opeal Soi of Americ A, No.4 (137),
K. Kanatani, Geometric Computation for Machine Vision, Oxford Univesity Press Oxford
0993,
D.Lowe, Three-Dinensional Object Resngiton rom Two-Dimensional Images Aifiial
Inelgence, VOL 3, pp, 355395 (198).306 Chapter 11 Locating Objecsin Space
10). Lowe tng Pre The Dimes deo Inge EEE aos
oo it oe Macnee VL PMI ep 1250 091
1a) Ab vaahand Mart Comper ion Model ond pasion Ne ete
Cenio )
pu) enw Masten 38530 Node Rern fom Sep Cue, NT os,
Cnet) 9)
15) ese dK Sap Vl Laing an Ripon. Oe om App :
a ance, International Journal of Computer Vision, Vol. 14, pp. 5-24 (1995). Pppen Ix
(is) MIL Om On tmaing Rte DAI ong Pape 5, Det o Ariel nei
foe aly bn 0)
In this appendix, we sive you some details on a number of fats needed to read and
make profitable use ofthis book.
‘A1 Experiments: Good Practice Hints
This secon cones ineduton othe perfomance sessment of compat von
Drom and is coerned mainly with te dg of experiment wx Toe purpose
Sony to provide of ood yrctce panies be wared Unt te foundations of
! tote he pei la of Mahine Vion and Appraton orale performer char
tctrzationof von clgriims ination othe Web ste quoted in Chapter check
out the infra ston pefoatcesesteat ecm for compat von
systems and comporeng Srp. //pendora. ings /B0Mot/becinaring. ial
tainted by the Ewopean Computer Vsion Network (ECV Ne). Another
txing te dese HATE ol fo senerting spt for testing computer ven
programs (aeep://peipa.eesex.ac.uk/nate/)
yan Anand on Expres
| The reason for an appendix on experiments in a textbook on computer vision is twofold.
Fan fro copter eben exten icin tr dt fst
thon caial on tnt dlc apne senna
| mio in gee don nl Sole er of opty
amatuer) enon nan ces
went ste oe veoh pce
307308 Appendix Appendix
Experimental Performance Assessment
‘Testing isnot just about taking separate measurements, but discovering how a system
behaves asits parameters and experimental conditions vary. Thisbehavior canbe investi-
gated theoretically and experimentally ere we ate interested inthe latter method. Our
objective is therefore 10 assess experimentally and quantiatvely how well a computer
vision program performs its tas.
‘Toachieve tis objective, we must
1. identify the key variables and parameters ofthe algorithm;
2, predict the behavior of the output variables as functions of the parameters and
input variables;
4. devise a systematic testing provedure, checking the results ofthe tests against
‘expected values,
‘We discuss briefly each point in the next sections. In essence, we run the program
‘undergoing testing in a large number of conditions, and record the value of target
variables, their diserepances from the expected true values, or errors and the error
statstis Ifthe tue values are not knownin advance, we canstill easure the dil
between each messure and its average, and its statistics.
Identifying the Key Variables
The key variables of an algorithm are:
© its input variables;
+ its ouput or target variables;
+ its parameters, for instance constants and thresholds
‘We must also consider quantifiable experimental conditions which can affect the results
of tests (eg, illumination dtection, uncertainties on input variables), that we shal all,
experimental parameters.
‘The nature of the target variables and their asociated errors depends onthe algo-
rithm, For the purposes of this discussion, we identify two broed classes of algorithms,
aimed respectively at measurement or detection.
“Measurement Algorithms. a algorithm outputs measurements like lengths or
areas such measurements are the target variables. In this case, typical errors used are
+ themean aboe ero,
tm = Bath
where isthe numberof tests is the value ofthe target variable, x, measured
atthe i-th test, and xp the varable’s true vale;
Section A1 Experiments: Good Practice Hints 308
* themean error,
the RMS (rootmean square) error,
Detection Algorithms. Wfanalgorithmis meant to detectinstancesofa particular
entity, the errors abeve do not make sense; instead, we observe
+ the numbers offale posit
instances.
ats spurious responses not corresponding trea
‘+ the numberof fase negatives; that i real instances missed by the algorithm,
© Notice thatthe quantities above are estimates ofthe poser’ probabiliy of fake
positives and fae negatives
Predicting the Behavior of the Output Variables
‘There are two basic cases, depending on the nature ofthe input data:
As the test data are synthetic
Syheti daa ace simuloted datasets. They allow us to run our program in per
fectly controlled stations; as we design the data, we know the value of al! input
variables and parameters (Sometimes called ground rath), as well as the exact value
of the corresponding output variables.
‘Real data ace o%taned Srom real images. When testing with real data, you should
endeavor to control the input variables, parameters and experimental parameters, so
that results can be compared with the predictions of synthetic tests.
+ Synthetic data are wef 2 ong as they miro elise situations as closely as possible It
‘good practice w hein testing with such synthetic dita then use the resus t uid the
hoo of paramatrs and input vaiales ob Uo in tests with real data Its deity
‘bad procice oem tbat “the program works well” because “the results look god” wih
‘fem uncharacterized el images
Designing Systematic Tests
‘The next step isto cesign systematic experiments to investigate the behavior of the
program as input variables, parameters and experimental parameters vary. Again, the
‘procedure depends onthe nature of data we begin with synthetic dataAppendixA Appendix
Synthetic Data,
Reference Procedure with Synthetic Data
1. Choose a realistic range of variation fo each input variable, algorithm parameter, aad
experimental parameters. Disretie each range using sampling steps small enough 10
{utrance a signican sampling ofthe behavior ofthe output variables, but large enough
‘omake the toal number o uns in ste 4 (below) feasible in reasonable mes, gven the
‘computational resources available,
2 ‘Selecta modelofandom, additive nose tobe added the ideal data, The model (statistical
‘dtributon anit paramcter) should ree the real mise measured the aplication; in
the absence of such infomation, ase Gaussian nose lus outliers. Chooses eaisicrange
forthe amount (standard deviation) of the nose, and discretize such range according to
the ere of pot
‘4 Foreach posible combination of values of input parameters experimental parametersand
mounts of oie:
(@) generate the dataset corresponding tothe current values andcoruptit witha number
of diferent realizations of noise ofthe earent amount,
(6) run the program onl the nosy datasets obtained;
(6) store the average values of the target variables together with the current valves of
‘oie amount, input variables algorithm parameters and experimental parameter.
4 Compate global sais (over al ests) forthe errors ofthe tage variables
Itis convenient to show the results as graphs plotting the error statistics against
variations of input variables, program and experimental parameters, and noise level.
‘= As we cannot test the progam in all posible situations a practical question ass: What
isthe minimom number of test guaranteeing that the results are representative forthe
‘general bebavir of the progam, within a given level of confidence? Aa exhaustive an
"wer comes from tats, and the considerations required are beyond the spe of his
appendix Refer othe Further Reading (for instance Lapis book forthe we sory.
Real Dasa, Ulvaately, the ayoritn must work with sea das fo he target
application. Hence, you should test your program with real, controlled images. What
and how much you can control in real data depends on the application; forthe purposes
of performance assessment, ou should know in advance reliable estimates of input and
‘output variables and experimental parameters, This includes the statistical properties
ofthe image noise (Chapter 3) and the uncertainty on any quantity, whichis input to
the program,
‘In these assumptions, the reference algorithm for synthetic data cam be adapted
and applied. You eannot vary values as you please any more, but you can certainly use
the results of the synthetic tess to identify key values for each controllable range, and
run real tests forthe seleted combinations of input variables and parameters
Section 2 Numerical Differentiation 341
References
RM. Hlaralich, C. Lee, K. Ottenberg, and M. Nolle, Analysis of Solutions of
the Three Poirt Perspective Pose Estimation Problem, Proc. IEEE Int. Conf on
Computer Vision and Pattern Recognition, pp. 592-598 (1991)
LW. Lapin, Probability and Statsties for Modern Engineering, 2nd edition, PWS-
Kent, Boston (MA) (199),
‘Machine Vision and Applications, Special Issue on Performance Characteristics
of Vision Algorithms, Vol. 9, no. 56 (1997)
‘AZ. Numerical Differentition
‘Tis section remind: you of some basic formulae for numerical derivatives, and how to
apply them to digita images. Given our definition of digital image andthe needs ofthe
algorithms inthis beok, we limit ourselves to firs and second derivatives in the case of
‘equally spaced data. To dispel any potential impression that the problem is solved by
a few, straightforward formula, we list inthe lat section a few ofthe many dangers
lurking in the periloa land of numerical differentiation,
Deriving Formulae for Numerical Derivatives
Consider a real-valued function, (1), of which we know only 1 samples taken at
equidistant points :y,-..,., sue that xj = 1.1 + for some h > 0, We want to
compute finite difference estimates off’ and "the fist and second derivatives of fas
ella the error on these estimates! T solve the problem we write Taylor's polynomial
approximation of f(s) atx +h and x ~ hs
fusmererenoebiroron) (any
fe wapor-mroredreson (aa
subi (A2) f(g oe te se mf he
fC) Lot 4 + om,
The quantity 0(2) means thatthe uncation error, caused by stopping the polynomial
approximation tosecond order, tendsto 210.8 ash tends to zero. Similarly, summing
up (A.1) and (A.2) and solving for f"(x) we get the desired formula forthe second
derivative
"Note thar weasume ta fan et hima note te stam pois the sample do telly
sels!AppendicA Appendix
+H) 2/001 + F0-W
Pew = Let = 28a fea
‘We can derive fnteifference formulae in which the truncation ertor vanishes more
rapidly if we begin with higher-order polynomial approximations (which involve more
samples)? Here isa summary of the useful formulae and their truncation errors in the
notation introduced at the beginning ofthe section
+ 00h,
First Derivatives: Cental-difference Approximations
Second Derivatives: Central-fference Approximations
12h Si
“AI 4 om)
pa ee} fis =F fis — fa, oy
f ~ ae D
‘= With digital images one nearly nvaibly ets
‘Theequationsabove are called cenra-difference approximations, es they estimate
the derivatives atx using samples from a symmetric interval centered on x. One
can use asymmetric intervals instead, lading tothe so-called forward and backward
“approximations; fr instance, fr the fst derivatives,
£60
ow
are the forward and backward approximation respectively, Notice that these formulae
carry larger truncation errors; therefore, central diferences should be your choice when-
ever derivatives must be estimated wth simple formulae (see the next subsection for hits
tormore sophisticated methods).
i thingie the emp ht ihe oer derives off ex
Section A2 Numerical Differentiation 3
Computing Image Derivatives
One of the nice fetures of the formulae above is that shey allow us to compute im
«age derivatives by convolution (see algorithm LINEAR FILTER in Chapter 3). Fo
instance, suppose sou want to estimate the image gradient, VI ~[@1/0x, 81/0}
all pixels, )- You just convolve the rows and columns withthe mask
fro =)
and this implemen’ the fist formula in the box a ll image points. Such masks ar
sometimes called stencil
"Notice that theresut can be epresented astm images, one for each radon component
suming we alow nnintegcr pixel values (and donot consider peripheral ils).
Building the masks implementing the other formulae in the box is left asa
exercise. You may aso want to try and show that the tend for the Laplacian o
fa fieyh
ay
oe
ey
ae
010
1-41
010
‘A Word of Caution
‘What we sid so farallows you to take numerical derivatives with simple formulae, bu
'sjustthe tp of the ibeberg;a word of caution must be spent on errors. The total error of
numerical approx mation is due to two sources, roundoff errors and truncation errors
Thissection has considered only the later. The formers due tothe fact that most
numbers are not represented exactly by binary cades in the computer; this can lead to
significant errors in the result of even simple computations. Moreover, it turns out that
there is an optimal value of h minimising the total error ofa given derivative of f at
+4; fo make things vorse. this value varies. in general, with. Since we do not contra
the spatial sampling of a digital image, we must expect that the errors associated with
numerical image derivatives vary across the image.
© A useful take-home messige is the fractional acuray of the simple ite-ifference ap
proximation inthe box is abvays worse tan the factional accuracy with which ke function
an be computed (which, nurs generally worse than the machin acura),
Better accuracies can be obtained with more sophisticated methods. For instance,
‘one can ita spline othe data, and compute the derivatives from the splines coefcient.
‘A good, concise introduction to these methods (including C code) is given by the
Numerical Recipesa4
AppendixA Appendix
References
(CE Gerald and PO. Wheatley, Applied Numerical Analysis, Fourth edition,
‘Addison-Wesley, Reading (MA) (1970)
WH. Press S.A. Teulosky, WT, Vettrling, and BP, Flannery, Numerical Recipes
nC, 2nd ecition, Cambridge University Press, Cambridge (UK) (1992)
‘A3 The Sampling Theorem
‘This section sates the celebrated Sampling Theorem and discusses afew related con-
cepts This should give you the minimum knowledge necessary to go through Chapters
and 3.Butifthisis the first ime you hear about the Sampling Theorem, you arestrongly
‘encouraged to read more about it
The Theorem
Let F(o) be the Fourier transform ofa function £(), with € (~90,00). We assume
that f is band-limited; that is, F(w) =0 for Jo| > oc > O. Then the following theorems
holds true.
‘Sampling Theorem
‘Tae function f canbe exact reconstructed for every € (oe, +0) fom a sequenee of equis-
tant samples, f= e/a), according othe formula
$F jlitlarcan
£0 —
Sabet = Sa
© The Sampling Theorem i nontrivial in atlas three respects. Fist, ites you that any
bndimited fonction canbe reconstructed acy at locations wher ths ot been ob
served. Sesondtherecoseuction relies upon discrete observations. Third, the iformation
contet ofa functions not “locals shown by (A.3), he reonseution of ay ale f()
receives ite contributions fom al samples
A few important remarks now follow,
and the Nyquist Frequency
‘The frequency v,= o4/r, inverse of the sampling interval T= /o, is named Nyquist
Frequency and is typical of the signal tis oe minimal sampling frequency necessary to
‘reconstruet the signal. Ths means that, fre < the series
tive F pitiet=m
Section A3 The Sampling Theorem 315
‘doesnot converge 13 f(t). The diference between f and fs thats the reconstruction
error, is due to the fact that the sampling distance is too coarse to capture the higher
frequencies of the signal. This phenomenon is called aliasing because f,, the econ-
struction of the original signal f, is corrupted by higher fequencies which behave a i
‘they were lower frequencies
Ifthe Function is Not Band-imited
iow strong isthe assumption that f is band-limited? In practice, not very: Afterall,
‘because ofthe integrability conditions the Fourier transform of any function (fitexsts)
‘must be very close to ero outside some finite frequency range. The problem is, one
{does not necessarily know in advance the value of o, and it may well be the ease that
1 fais too small wth respect to the finest sampling distance achievable in practoe. The
consequence of thisfact can be appreciated by means of the following example.
‘Assume you are given a sequence of equidistant samples... g(T),g(0),g(T),
@27),... of function g(. You don't know whether or not gis band-limited, Ifyou
eto =/T, the series
Same =)
converges to bandlimited function with a: =. (the proof of this fat is left 1 you
as an exercise). I gs not band-limited, or pethaps its band is larger than 2, g and &
lifer and the difference inereaes with the amplitude of G, the Fourier transform of
‘outside the band [—, 0].
Function Reconstruction
Perhaps a weaknessof the Sampling Theorem is that the reconstruction given by (A:3)
converges rather sloay. he function sn x/x goes to zeroas x forx -» oe. This means
that samples faraway from the location where the reconstruction takes place might stil
ive important contabutions.
tisinstrutive to evaluate the derivative ofa band-timited funeton f(@) making
use of(A.3). To compute / (0), the derivative off) at =O, we take the derivative of
both sides of (A.3) set = 0, and obtain
Spek,
"h
Where n ranges from ~co to +50 (with the exception of n=O, where the derivative
of sinc(x) vanishes). Thus fora = x (the typical computer vision setting in which the
pixel width is one) we have
0
fur fica, ftw fon
z *
‘This formula shouldbe compared with the stencils proposed in section A.2.
~ fiat316 Appendix Appendix
References
|A.Papoulis, The Fourier Integra and ls Applications, MeGraw-Hil, New York (1962)
AA Projective Geometry
Inthis section, which i not meant tobe a rigorous introduction to projective geometry,
ve give you the minimum information necessary to go through the projective material
‘ofthe book. We ist define projective transformations and standard bases, then discuss
briefly the most important projective invariant, the eross-ratio.
Definitions
“The projective geometry immediately relevant for computer vision deals with points,
lines and thei relations in -D and 3-D. In this ection, we discus the main conceptsin
‘the planar case; the extension tothe 3-D casei straightforward
‘The Projective Plane
‘We begin by defining the projective plane.
Definition: Projective Plane
‘The projective plane, Piste set of equivalence classes of ples of el numbers (oot az),
where two tpl p=[e,y,2)" and p
bn,
A point p< P? is thus identified by three qumbers, called homogeneous co-
‘ordinates, defined up to an undetermined factor. This redundant representation al-
lows us to develop a more general geometry than Euclidean geometry. We retain only
the elementary concepts of point, ine, and incidence, but we donot talk of angles and
lengths
AUseful Model
‘A useful mode ofthe projective plane can bo obtained in 3-D space: each projective
point pis put in correspondence witha -D ine through the origin. The prof that this
§8a faithful model ofthe projective plane i left to you as an exercise.
In this setting all 3D lines (or, equivalently, all points of P*) stand on an equal
footing. Instead ifwecut the bundle of3-D linesin our model with plane, x, not going
through the origin (say the plane of equation z= 1), we can distinguish between proper
and improper pois:
‘+ each point of the projective plane with z #0 isa proper point, identified by the
coordinates [x/
Section A& Projective Geometry 317
+ each point with: = Ois an improper point, identified by the coordinates [x yO)"
‘Thesame eascning an be applied toboth the I-D and 3-D case forthe definitions
‘of P! and P® respectively). Muatis mucandis, the picture is identical, You add one
‘coordinate forthe description of a n-dimensional point, subject to the condition that
the (n+ 1)-tuple of numbers (not all zero) are unigue up to an undetermined factor
‘ence a point in the projective line is ideniied by two numbers, whereas a point in
the projective space by four numbers In both cass, the homogeneous coordinates are
‘unique up to an undetermined factor.
The Projective Line
‘We now cise this preliminary section by introducing the notion of projective fn. This
can be easily done trough the mode above, snc collinear points in corespond to
coplanar ines in the -D mode
Definition: Projective Line
A projective ln u, is terested by 83.0 plane gong though the origin, ot
wo. ayy
FF Inthe projective lane points and line are dual In (4), one can alternatively think of p
88 (a) point ing on the ine ,o (6 ine going shcough the pint
Projective Tansforn
AA projective transfomation isa linear transformation beoween projective spaces. In
‘computer vision, thee area least wo important clases of projective transformations
‘+ linear invertible transformations of P*,n = 1,2, 3, into themselves.
‘+ transformationsbetween P® and P?, which model image formation,
In what follows, wo are interest in the first class. In particular, we want to
establish that a projrtive transformation of * onto iselfs completely determined by
ityaction on n +2 points. For Ue sake of simplicity, we prove this general result in the
Particular cae of n=2; the extension to the ease ofa generic n> 0 does not pose any
‘problem and is eft fr an exercise.
Determining a Projestive Transformation
A projective transformation of the projective plane onto sifiscompletely determined one the
{eansformation is knowa on four point of which no thre are elise.a8
‘Appendix A Appendix
‘Asa projective transformation is line
resent tin matrix form and write
invertible transformation, we ean rep-
Tp=p.
‘Since the coordinates of both p and p! are known up to an undetermined facto, the
entries of Tare also known up to an undetermined factor.
‘We want to show that T can be writen in terms ofthe four points p= [xx
+. -- image of py = [1,0,0]", p2=10, 1,0)", ps =[0, 0,1)", and ps [2,15 4]",
respectively. Thanks to the fact that T isa 3x 3 invertible matrix, our statement is
proven ifitcan be proven for T,
We start by writing
Ty
From this equation we find thatthe frst columa of 7! can be written as Ax 921",
vith undetermined, By using the knowledge of p and p), we then find that 7"! can
be written as
ay} wo
(: a
dh acy
Since no three ofthe fou pont pare collinear, we can now determine 2 and v, up
to an unknown factor. To do this, we us the lst availabe point, pa, to find
af + ua} bos =p
ay, rink toy
de teh veh = 0x
i
‘The nine entries of T~ are therefore known up fo an undetermined factor.
In summary, we have shown that a projective trasformaton of P® onto itself is
characterized by it ation on four points, no three of which are collinear. The four
points py.s, are called the standard basis of P=
‘By means of similar argumens, you should be able to show that one can pick
(0,0f",10.1]", [11] asthe standard bess forthe case ofline-totine projective ransor-
‘mations, and[1,0,0,0][0,,0,0]",[0,0,1,0]",[0,0,0, 1)", [1,1.1, 1)’ asthe standard
bass forthe case of space-tospace projective transformations
‘The Cross-atio
We close this brief appendix on projetive geometry by touching upon the vast subject
‘of invariants, We consider the most important and simplest invariant, the rossratio.
Section A4 Projectve Geometry 319
Definition: Crose-ratio
Given four dine points of P*, described in homogeneous coordinates 3 p
Atheros moc i defined as
[ssl =
20.246.9)
239 = G5)
with
ai, =n) —59%
{he determina betwee p20
Croseato Invariance
‘The eos ati invatant to projective tansformations of P onto itt
‘© Notice thatthe orkrof the points matter inthe defniton of rosa, and each pint
appears once in tke numerator and once inthe denominator. In addition, the erosatio
canals ake onthe improper values.
‘You should be sble to prove that, given four points, you can define sx different
cross-ratios. A slightly more dificult exercise isto show tha, if is one of thes erss-
ratios, the other five ae 1/2, 1-2, 1/(1 — 2), (—1)/2, and 4/0. —1). This tells you
also that for some labelling the cros-ratio goes toinfiaty, iti always possible to find
a different labeling which evaluates toa finite value
Itisinstructive © go through the proof ofthe cros-rati invariance step by step.
If we form the determinant between two of the four points, say p; and po, and assume
‘yand y, are not zero we can write
wrsmm= yn (2-2) as
aa.2
Aslx,y1” arehomogeneous coordinates of ine point, 1, 2)can be interpreted asthe
Euclidean distance between py and po times an undetermined factor, yy2, depending
‘om both py and pa Naw let 7, 2x 2 invertible matrix, representa generic projective
‘transformation,
Th =P.
If the determinant between p] and py is denoted by a1, 2), we have
#0,
40,2),
where [| denotes the determinant of 7 We can see that the determinant of the trans-
{formation cancels outin any ratio of determinant ike (AS), but not the factors 913
such factors cancel ou, however, in the definition of crss-ato, for which invariance is
achievedAppendix Appendix
References
JUL, Mundy and A. Zisserman, Appendix—Projective Geometry for Machine
Vision. In Geomeric Invariants in Compuaer Vision, Mundy, JL and Zisserman,
Ao MIT Press, Cambridge (MA) (1992),
CE. Springer, Geometry and Analysis of Projetive Spaces, Freeman (1964),
AS. Differential Geometry
This section complements our discussion of range image segmentation (Chapter 4) by
‘recalling afew concepts from the differential geometry of surfaces.
Surface Tangent, Normal, and Area
Consider a parametric surface, S(u,v) = [x v),y(u, 0), 2,1) ]" and a point P on $.
‘Assume that all ist and second derivatives of § with respect tow and w exist at P. The
‘tangent plane at P is identified by the two vectors S, = 38 au and $, = 8/30.
‘The surface normal isthe unit normal vector to the tangent plane of Sat Ps thats,
S,xS,
18.30
‘Range images in ry form (Chapter 4) correspond to the parametrization S(x, y) =
(x,x.Gx 9)" In this case,
asi?)
hs.
tis also useful to know how to compute the area of a surface patch, Q, from 2
generic parametrization, Qn»), aswell s from the parametrization Qa, = (x yh,
))). If weal Ag the former and Ay, the latter, we have
sox f f10. aided
ay= | [ Vir rmaray
[v
Surface Curvatures
‘Curvatures make useful shape descriptors as they are invariant to viewpoint and
parametrization. We now want to extend the notion of curvature of a curve to define
‘the curvature ofa surface, in order to derive the quantities used in Chapter 4
‘To begin with, recall thatthe curvature ofa parametric curve a(t) = (x0, ¥10),
with ra parameter, i given at each point by
Section AS Differential Geometry 321
ayter'y
koe a
wrt ort
‘where a= dad. For the common parametrization a(x) = [x,y(x)]', the curvature
becomes
ko=—_,
asort
Consider a parametic surface, Su»), and a point P on S. Assume that all ist and
second derivatives oӤ with respect 10 u,v exstat P. We define surface curvatures in
foursteps.
‘Step 1: Normal Curvature of a Curve on S. Consider a curve C on S going
through P. We define the normal curvature of Cat P as
ky =koos,
‘where fis the curvature of Cat P, and is the ange formed by the surface normal at
P,s(P), withthe curve normal, me(P).>
Step 2: Norma! Curvature along a Direction, Itcan be proven tht ky does not
depend on the paricular curve C chosen, but only on the tangent of Cat P, identified by
the unit vector d. Thi enables us to speak of normal curvature along a direction. For the
sake of visualization. we can choose C as the planar curve obtained by intersecting $
‘witha plan through P and containing both d and ms(P). Obviously, C8 a erss-section
‘of S along d, and describes the surface shape along that direction. Notice tha, in this
ase
‘Step 3: Principal Curvatures and Directions. We could now desceibe the local
shape ofS at P by taking the normal curvatures at P in all directions. This i totally
‘impractical, but fortunately unnecessary. Assume we know the maximum and minimum
‘normal curvatures at P, ky and fy respectively, called principal curvatures, and the
corresponding direction, dj and d called principal directions. It can be proven that
the principal directions are always orthogonal:
* the normal curvature along any direction, v= (cos 8, sin 6), where f isthe angle
from dj to d cn be computed through Euler’ forma
Ig = hy 00s" f+ hy inf
* consequently, the local shape of the surfaces completely specified by the principal
curvatures and directions.
Soca ink of th projstion kc) ng the ace ormal ns?)32
Appendix Appenclx
‘Step 4: Classifying Local Shape. Finally, the shape classification given in Chap-
tee 4 is achieved by defining two further quantities, the mean curvature, H, and the
Gaussian curvature, K
+h
AGA k= hike
‘One can show that the Gaussian curvature measures how fast the surface moves away
{from the tangent plane around P, and inthis sense isan extension of the L-D curvature
{The formilae giving M and K Tor a range surface in form, (x, ,h(x,9)) are given
in Chapter 4
#H
References
MB. Do Carmo, Differential Geometry of Curves and Surfaces, Prentice-Hall,
Englewood Cit (1) (1976)
‘AG Singular Value Decomposition
‘The aim of this section isto collect the basic information needed to understand the
Singular Value Decomposition (SVD) as used throughout this book. We start giving
the definition of SVD fora generic, rectangular matrix A and discussing some related
concep. We then illustrat thee important application ofthe SVD:
‘+ solving systems of nonhomogeneous linear equations;
+ solving rank-defcient systems of homogeneous linear equations;
‘guaranteeing that the entries ofa matriestimated numerically satisty some given
constraints (e@, orthogonality)
Definition
‘Siogel
‘Any m x nmateix A can be writen asthe product of tree matrices:
"Value Decomposition
Azupv". ao
‘The columas ofthe m x m matic U are mutually onthogoal unit vecors, as ate the columns
ofthe mx matrix V. The m xa matrix D is diagonals agonal elements, called singular
aes, are suc hat
"= Whileboth U and V are no unique, the singular values; are uly determined by A,
”
zl
Section AS Singular Value Decomposition 323,
‘Some important properties now follow.
Properties of the SYD
Property 1. The singular values giv yu valuable information onthe singulavity
ofa square mati square marx A i nonsingular if and only if als Singular
values ae diferent fom zero. Mest importantly, theo; aso tll you how close A is
tobe singular the aio
called condition number, measures the degree of singularity of A. When 1/ is compa-
rable with the arithmetic precision of your machin, the matrix Ai il-condifoned and,
forall practical purposes can be considered singular.
Property 2. If Ais recanguar mati, the number of nonzero equ the
rank of A Thus given a xed tolerance, (typically ofthe order of 10") the number
of singular values arcater than ¢ equals the effective rank ofA
Property 3. If Aisa square, nonsingular matrix its inverse can be writen as
atevpy",
Be A singular or not, the pseudoinverse of 4, A*, can be written as
a
with Dj" equal to 2 for all nonzero singular values and zero otherwise, ICA i
nonsingular, then Dj!= D and a* =a!
Property4. ‘Tre columas of V corresponding to the nonzero singular values span
the range of A the columns of V corresponding tothe zero singular value the null space
ofA
Property 5. ‘he squares ot the nonzero singular Value are the nonzero eigen
values of hoth the mx matrix ATA and m x m matrix AAT, The columns of U are
eigenvectors of AA, the columns of ¥ eigenvectors of A". Morevoer, Auk =o."
and Avy = oyu, where wand v, ae the columns of € and V corresponding 0 oy
Property 6. Cne possible distance measure between matrices can use the
Frobenius norm, The Frobenius norm of a matrix A is simply the sum of the squares of
the entries aj of A,
on
4. (an)324 Appendix A Appendix
‘By plugging (A.6) in (A.7), it follows that
\Alr= De
‘We are now ready tosummarize the applications of the SVD used throughout this
book.
Least Squares
Assume you have to solve a system of m linear equations,
Ax=b,
for the unknown n-dimensional vector x. The m xn matrix A contains the coefficients
of the equations, the m-limensional vector b the data. If nt all the components of b
‘are null, the solution can be found by multiplying both sides ofthe above equation for
A" toobtain
Al ax= A",
It follows tha the solution i given by
xeATaytay,
‘This solution is known to be optimal in the least square sense.
is usually good idea to compute the pseuoinverse of ATA through SVD. In
the case of more equations than unknowns the pseudoinverse is more likely to coincide
with the inversof AA, but keeping an eyeon the condition numberof AA (Property
1} won't hut
‘Notice that inca iting amounts to soe exactly the same equation. Consequently, you
can se the same strategy!
Homogeneous Systems
‘Assume you are given the problem of solving a homogeneous system of m linear
equations in unknowns
ax
with m > n ~ Land rank(A) =» ~ 1. Disregarding the trivial solution x =0, a solution
‘unique up toa sale factor can easily be found through SVD. This solution is simply
‘proportional othe eigenvector corresponding to the only zero eigenvalue of A°A (all
‘other eigenvalues being strictly positive because rank(A) =n ~ 1). This can be proven
as follows
Since the norm ofthe solution of homogeneous system of equations i arbitrary,
wwe look fora solution of unit norm in the least square sense. Therefore we want to
lan? = (ax) "Ane xT AT AR,
Section AS Singular Value Decomposition 325
subject to the constraint
Introducing the Lagrange multiplier this equivalent to minimize the Lagrangian
f(a) =x" AT Ax — XX" — 1),
Equating to 7er0 the derivative ofthe Lagrangian with respect to x gives
AAR —ax=0.
This equation tls you that 2. an eigenvalue of ATA, and the salution, x=, the
corresponding eigmector. Replacing x wth, and A" Ae, with ein the Lagrangian
yields
Le
“Therefore, the mininum i eached at 3 =0, the last eigenvalue of ATA. But from
Properties 4and§ follows tha thssoltion coud have been equivalently established
ashe column of V cxesponng to he only rll singular value of A (he kernel of ).
This the reason wt, throughout his book, we have not distinguished between these
‘90 seemingly diferent solutions ofthe same problems
Enforcing Constraints
One often generates numerical estimates of a matrix, A, whose entries are not all
independent, but sasty some algebraic constraints. Ths isthe exs, for example, of
‘orthogonal matrices or the fundamental matrix we met in Chapter 7. What is bound
to happen is that the errors introduced by nose and numerical computations ater the
«estimated mati, cal it , so that its entries no longer satis the given constraints. This
‘may cause serious problemi subsequent algorithms assume that A satis exacl the
constraints
__ Once again, SYD comes to the rescue, and allows us to find the eases matrix
10 A, in the sense ofthe Frobenius norm (Property 6), which sates the constraints
cexacly. Thsisachieved by computing the SVD of the estimated matrix, A=U DV" ,and
estimating Aas U D'7", with 0” obtained by changing the singular values of Dto those
expected when the constraint are satisfied exactly" Then, the entries of A= UD'V"
satis the desired ecasteints by construction.
References
Strang, Linear Algebra and its Applications, Harcourt Brace Jovanovich, Or-
lando (FL) (1988).
“ifs a pod sume stint issnglr aus sold not eto aro the expected ones.226
Appendix Appendix
‘AJ Robust Estimators and Model Fitting
“Thissecton sketches few, introductory concepts behind robust estimator, n particular
the socalled M estimators. Our limited aimis to support the discussion of Chapter S by
explaining
‘why least squares are a maximum likelihood estimator from the point of view of
statis,
+ wy least squares i skewed significantly by outliers, and
‘+ why an estimator based on the east absolute value, as used in Chapter 5, tolerates,
‘outliers better than conventional leat squares.
"The subject asa vast literature; an inital set of further readings is provided atthe end
ofthis appendix. Several robust estimators nat detailed here have become popular in
computer vision. interested, you should checkout atleast the least median of squares,
discussed inthe review by Meer eta. and detailed in Roussecuw and Leroy's book,
and the RANSAC (Random Sample Consensus) algorithm, introduced by Fischler and
Bolles and also discussed by Meer et a.
Least Squares as Maximum Likelihood Estimator
Consider W data points p= ry)" 1... Nand a model y= f(x, where a
is vectorof parameters an fis a inown fenton. Assome ths the data pint are
erations corrupted by noe (tobe characterized ete inthe following) Te well
known estimate of the parameter vector, a,, such that f (x, a.) interpolates the data best
inthe leas squares senses
were
‘We want to show briefly that a, i the parameter vector maximizing the probability that
‘he data area noisy version of xa), given appropriate assumptions on the noise.
‘Notice that we should estimate a by maximizing the probability that ais correct
_siven the dota, but we cannot estimate ths probability (why?), However, if we assume
that the noise corrupting each data point is addiive and Gaussian, with 2ero mean and.
standard deviation , and that the amounts of noise at different data points are all,
independent, we cun express the probability P that, for a given a, all datapoints fall
within ay ofthe true valve:
FGa) (as)
8 oryat
Pa] ay), (as)
In essence, mavimum likelihood estimation follows from the assumption that the
Parameter yector which maximizes P is also the mast likely one 10 occur given the ob
|
Section A7 Robust Estimators and Medel Fitting 327
served data. To obtain (A.8) from (A.9) snow easy: we just notice that P is maximized
by minimizing the negative of its logarithm: that,
and the constants ¢, N, Aycan be ignored inthe minimization,
Why Least Squares Fits are Skewed by Outliers
Since we assumed that the noise corrupting the datapoints is Gaussian, the probability
that noisy points within distance d fis corresponding true point deceass very
rapidly with Consequently, the lest squares estimator belies that mest points li
within afew standard deviations ofthe true (ankaown) model. Now suppose thatthe
data contin even a small percentage of points that are just way off and presumably
snot consistent with the Gausian hypothesis Ponts ike these are called ous. Inthe
absence of further information, a leas squares estimator believes that outliers to ae
lose to the model asthe probability of an outice beng a fa sit really from the
true models racially zero. The results thatthe outs “pull” the best ft away from
the true model mut re than they shoul
Why Absolute Value Estimators Tolerate Outliers Better
‘Theessence ofthe problem with leastsquaresis thatthe Gaussian distribution decreases
very rapidly as d becomes lager than ¢. Therefore, a solution is to adopt a nose
distribution which does not vanish as quickly as a Gaussian; that is, which considers
outliersmore likely occur. An example ofsuch distribution s the double exponential,
Pridjace!
In this case, the provabilty P becomes
Poff ay (ano
‘Thesame reasoning took stom (A) 10(A8) kes rom(A.10 tothe rob
mnesimum elo! einer
ao S| — Fe 8)|
The price we payisthat, unlike (A), this problem cannot be solved in closed form i
sms cases and unerical methods mast be employed.
‘Tye resons or ths pint being the datasets ever an forthe prrseo is brietrotaton,
sage leva328 Appendix Appendix
References
MA. Fischler and R.C. Bolles Random Semple Consensus: A Paradigm for
Model Fitting with Applications to Image Analysis and Automated Cartography,
Communications ofthe ACM, Nol 24, pp. 381-395 (198,
P Meer, D. Mintz and A. Rosenfeld, Robust Regression Methods for Computer
Vision: a Review, Intemational Jounal of Computer Vision, Vol. 6, pp. 59-70
(991,
PA Rousseeuw and AM Leroy, Robust Regression and Outlier Detection, Wiley,
‘New York (1987)
‘AB Kalman Filtering
‘This section isa brief account of a casi too! of optimal estimation theory the linear
Kalman iter. Its meant only to enable understanding of our treatment feature-based
tracking in Chapter 8, Foran extensive discussion of Kalman filtering, see Maybeck’s
lassc book.
‘The purpose of optimal estimation algorithms isto produce optimal estimates of
‘the state of dynamic system, onthe basis of nosy measurements and an uncertain model
“ofthe system's dynamics. The theory is based on two ingredients, the notions of system
‘model and measurement model
‘The System Model
A physical system is modelled by a sue vector, x, often called simply the state, and &
set of equations, called the system model. The tate isa time-dependent vector, x() the
‘components of which are system variables, in sufficient number to capture the dynamic
properties of the system. The system models vector equation describing the evolution
ofthe stat in time We indicat discrete equally spaced time instants with x = +£AT,
with #=0,1,... and AT'a sampling interval, and denote with % the state x(.). We
also assume that 47 is small enough to captue the system's dynamies, so that she tate
does not change much between consecutive time instants, and a linear system mode is
an adequate approximation of the state change within AT. The linear system model is
usually written in vector form as
w= Ou thon
whore & i a random vector modelling additive sytem nose. The subscript 1
indicates thatthe state anstion marx, isa function of time, and hence accounts
for more complicated dynamics than the one we considered for feature tacking in
Chapter 8
‘The Measurement Model
‘The second ingredient of estimation theory is the measurement model. We assume
that, at any time instant 1, a noisy measurement of the state vector (or atleast of
Section A8 Kalman Fikering 328
some components) taken, and that the following, linear, relation holds between the
‘measurements and the true sysem state:
= Hit Me
In this equation, 2s the vector of measurements taken at time ., Hh the socalled
‘measurement mati, and wy a random veetor modeling additive noise, which accounts
for the uncertainty associated with the measurements.
“The key points and assumptions are summarized as follows:
‘Optinal Linear Estimation Theory (Kalman Filtering)
Assumptions
Thestate ofa djnamiesysem at times (1,2...) is described by n-dimensional vector,
the state vector. The evolution ofthe sstens stat modeled by thelinar equation
weeny thes
with 6.19 time-dependent m