presentazione di powerpoint - politecnico di...

104
1 z y x = = o I M X o I M u ) ( 1 o x M x o I M u = = i.e., defining x = [x, y, z] T o I M o M M m M t K R K P = = = = with R K M = and m M o = 1

Upload: vodieu

Post on 19-Apr-2018

220 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

1zyx

⋅−⋅=⋅−⋅= oIMXoIMu

)(1

oxMx

oIMu −⋅=⋅−⋅=

i.e.,

defining

x = [x, y, z]T

oIMoMMmMtKRKP −⋅=⋅−==⋅⋅=

with RKM ⋅= and mMo ⋅−= −1

Page 2: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The locus

of

the points

x whose

image

is

uis

a straight

line through

o having

direction

mMo ⋅−= −1 is

independent

of u

o is

the camera viewpoint

(perspective

projection

center)

uMd ⋅= −1

line(o, d)

= Interpretation

line of image

point

u

Interpretation of o:

u is

image

of x if uMox ⋅=− −1)( λ

i.e., if uMox ⋅+= −1λ

Page 3: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Intrinsic and extrinsic parameters from P

RKM ⋅=

M K and R

1111 −−−− ⋅=⋅= KRKRM T

RQ-decomposition

of a matrix: as

the product

betweenan

orthogonal

matrix

and an

upper triangular

matrix

M and

m t

tRKtKRKtKR)mMo 1T1 T−=−=−=⋅−= −−− (1

Rot −=

Page 4: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Camera center

0P =O

null-space camera projection matrix

Oλ)(1λAX −+=

Oλ)P(1λPAPXx −+==

For all A all points on AO project on image of A,

therefore O is camera center

Image of camera center is (0,0,0)T, i.e. undefined

Finite cameras: ⎟⎟⎠

⎞⎜⎜⎝

⎛−=⎟⎟

⎞⎜⎜⎝

⎛=

1M

1

1moO

Infinite cameras: 0Md,0d

=⎟⎟⎠

⎞⎜⎜⎝

⎛=o

Page 5: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Action of projective camera on point

PXx =

[ ] MdDm|MPDx ===

Forward projection

Back-projection

xPX += ( ) 1PPPP −+ = TT IPP =+

(pseudo-inverse)

0P =O

( ) OλxPλX += +

( ) ( )⎟⎟⎠

⎞⎜⎜⎝

⎛=⎟⎟

⎞⎜⎜⎝

⎛+⎟⎟⎠

⎞⎜⎜⎝

⎛=

1m-μxM

1mM-

0xM

μλX-1-1-1

xMd -1=

OD

Page 6: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Camera matrix decomposition

Finding the camera center

0P =O (use SVD to find null-space)

[ ]( )m,p,pdet 32=X [ ]( )m,p,pdet 31−=Y

[ ]( )m,p,pdet 21=Z [ ]( )m,p,pdet 21−=TFinding the camera orientation and internal parameters

KRM = (use RQ decomposition ~QR)

Q R=( )-1= -1 -1QR

(if only QR, invert)

Page 7: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Radial distortion

Page 8: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Data normalization

32ii UXX~ =

ii Tuu~ =

(i)

translate

origin

to

gravity

center(ii)

(an)isotropic

scaling

Page 9: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Exterior orientation

Calibrated camera, position and orientation unkown

→ Pose estimation

6 dof

⇒ 3 points minimal (4 solutions in general)

Page 10: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

What does calibration give?

xKd 1−=

⎥⎦⎤

⎢⎣⎡= 0d0]|K[Ix

( )( ) ( )( )21-T-T

211-T-T

1

2-1-TT

1

2T

21T

1

2T

1

)xK(Kx)xK(Kx

)xK(Kx

dddd

ddcos ==θ

An image line l defines a plane through the camera center with normal n=KTl measured in the camera’s Euclidean frame. In fact the backprojection of l is PTl n=KTl

Page 11: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The image of the absolute conic

KRd0d

O]|KR[IPXx =⎟⎟⎠

⎞⎜⎜⎝

⎛−== ∞

mapping between π∞

to an image is given by the planar homogaphy

x=Hd, with H=KR

absolute conic (IAC), represented by I3 within

π∞

(w=0)

( ) 1-T-1T KKKKω ==− ( )1TCHHC −−α

(i) IAC depends only on intrinsics(ii) angle between two rays(iii) DIAC=ω*=KKT

(iv) ω⇔ K (Cholesky factorization)(v) image of circular points belong

to ω

(image of absolute conic)

( )( )2T

21T

1

2T

1

ωxxωxx

ωxxcos =θ

∞Ω

its

image

(IAC)

Page 12: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

A simple calibration device

(i) compute Hi for each square (corners (0,0),(1,0),(0,1),(1,1))

(ii) compute the imaged circular points Hi [1,±i,0]T

(iii) fit a conic ω

to 6 imaged circular points(iv) compute K from ω=K-T K-1 through Cholesky

factorization(= Zhang’s calibration method)

Page 13: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Properties of perspective transformations

1) vanishing points

V image

of the point

at the ∞

along

direction d

dMd

mMuV ⋅=⋅=0

VuMd ⋅= −1

the interpretation

line of

V is

parallel

to

d

Page 14: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

O

V

∞Pd

The images

of parallel

lines

are concurrent

lines

Page 15: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

2) cross ratio invariance

Given

four

colinear

points ( )4321 ,,, pppp

( )

42

32

41

31

4321 ,,,

xxxxxxxx

CR

−−−−

=pppp

let ( )4321 ,,, xxxx be

their

abscissae

Properties of perspective transformations ctd.

Page 16: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Cross ratio invariance

under perspective

transformation

TT ],0,0,[],,,[ txtzyx ==Xa point

on the line y=0=z

xPu T ⋅=⋅== 144

1],[tx

wupp

its

image belongs

to

a line

its

coordinate u

XPu ⋅== T],,[ wvu

( )4231

43214321 ,det,det

,det,det,,,

uuuuuuuu

uuuu =CR42143114

43142114

,detdet,detdet,detdet,detdetxxPxxPxxPxxP

=

4231

4321

,det,det,det,detxxxxxxxx

= ( )4321 ,,, xxxxCR=

Page 17: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Object localization 1: three colinear points

geometric

model of an

objecta perspective

image

of the objectposition and orientationof the object

?

A

B

C

C’

A’

B’O

π

calibrated

camera: mMP = A

B

C

known

known interpretation lines

Page 18: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

A

B

C

C’

A’

B’O

π

V

a) orientation

( )cbcaCBACRVCBACR

−−

=∞= ),,,(,',','

Cross ratio invariance:

solve for

V (image

of ∞)

V: vanishing

point

of the direction of (A,B,C)

interpretation

line of V parallel

to

(A,B,C) VuM ⋅−1direction

Page 19: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

b) position (e.g., distance(O,A))

A

B

C

C’

A’

B’O

π

V

VuM ⋅−1

CuM ⋅−1

AuM ⋅−1

interpretation

lines

angles

α

and γ

α

γ

αγ

sinsinACOA =

Page 20: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Object localization 2: four coplanar points

O

(i)

orientation

of (A,E,C)(ii)

orientation

of (B,E,D)(iii)

distance

(O,A)

E

A

B

CD

Page 21: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

a’

b’b”

a”

Find

vanishing

point

of the field-bottom

line direction

Off-side

images

of symmetric

segments

Page 22: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

a

and b: abscissae

of the endpoints

of a segmentc=(a+b)/2: abscissa

of segment

midpoint,d=∞: point

at the infinite along

the segment

direction

a c b d

( ) 1,,, −=−−

=

−−−−

=cbca

dbdacbca

dcbaCR

(a’,b’) and (a”, b”) are image

of symmetric

segmentssame image of the midpoint c’, same vanishing point d’

Harmonic

4-tuple (a,b,c,d)

Page 23: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

solve

( ) 1

''''

''''

',',',' −=

−−

−−

=

dbda

cbca

dcbaCR

( ) 1

''''''

''''''

',','','' −=

−−

−−

=

dbda

cbca

dcbaCR

{ for

c’, d’

system of two linear equations in (c’d’) and (c’+d’)

two degree equation, whose solutions are c’ and d’

among

the two

solutions, the one for

d’

is

the value

external

to

the range

[a’,b’]

Page 24: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 25: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Orthogonality relation

( )( )2T

21T

1

2T

1

ωvvωvv

ωvvcos =θ

0ωvv 2T

1 =

0lωl 2*T

1 =

Page 26: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Calibration from vanishing points and lines

Page 27: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Calibration from vanishing points and lines

Page 28: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 29: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Two-view geometry

Epipolar geometry

F-matrix comp.

3D reconstruction

Structure comp.

Page 30: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

(i) Correspondence geometry: Given an image point x

in the first view, how does this constrain the position of the corresponding point x’

in the second image?

(ii) Camera geometry (motion): Given a set of corresponding image points {xi ↔x’i

}, i=1,…,n, what are the cameras P and P’

for the two views?

(iii) Scene geometry (structure): Given corresponding image points xi ↔x’i

and cameras P, P’, what is the position of (their pre-image) X in space?

Three questions:

Page 31: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The epipolar geometry

C,C’,x,x’

and X

are coplanar

Page 32: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The epipolar geometry

What if only C,C’,x

are known?

Page 33: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The epipolar geometry

All points on π

project on l

and l’

Page 34: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The epipolar geometry

Family of planes π

and lines l and l’Intersection in e and e’

Page 35: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The epipolar geometry

epipoles

e,e’= intersection of baseline with image plane = projection of projection center in other image= vanishing point of camera motion direction

an epipolar

plane = plane

containing baseline (1-D family)

an epipolar

line = intersection of epipolar

plane with image(always come in corresponding pairs)

Page 36: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Example: converging cameras

Page 37: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Example: motion parallel with image plane

Page 38: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Example: forward motion

e

e’

Page 39: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The fundamental matrix Falgebraic representation of epipolar

geometry

l'x α

we will see that mapping is (singular) correlation (i.e. projective mapping from points to lines) represented by the fundamental matrix F

Page 40: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The fundamental matrix F

geometric derivation

xHx' π=

x'e'l' ×= [ ] FxxHe' π == ×

mapping from 2-D to 1-D family (rank 2)

Page 41: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The fundamental matrix F

algebraic derivation

( ) λC0

xMλX

-1

+⎥⎦

⎤⎢⎣

⎡=

[ ] 1MM'e'F −×=

[ ] [ ] [ ] xMM'Cm'M'0

xMm''MC'm'Ml' 1

1−

×=⎥⎦

⎤⎢⎣

⎡×=

(note: doesn’t work for C=C’

⇒ F=0)

xP+

( )λX0Fxx'0 l' x' l' x' T =→=→∈

Page 42: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The fundamental matrix F

correspondence condition

0Fxx'T =

The fundamental matrix satisfies the condition that for any pair of corresponding points x↔x’ in the two images ( )0l'x'T =

Page 43: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The fundamental matrix F

F is the unique 3x3 rank 2 matrix that satisfies x’TFx=0 for all x↔x’

(i) Transpose: if F is fundamental matrix for (P,P’), then FT

is fundamental matrix for (P’,P)(ii) Epipolar lines: l’=Fx

& l=FTx’(iii) Epipoles: on all epipolar

lines, thus e’TFx=0, ∀x ⇒e’TF=0, similarly Fe=0

(iv) F has 7 d.o.f. , i.e. 3x3-1(homogeneous)-1(rank2)(v) F is a correlation, projective mapping from a point x to

a line l’=Fx

(not a proper correlation, i.e. not invertible)

Page 44: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The epipolar line geometry

l,l’

epipolar

lines, k line not through e⇒ l’=F[k]x

l

and symmetrically l=FT[k’]x

l’

lk× e

kl lFk×

e'

(pick k=e, since eTe≠0)

[ ] leFl' ×= [ ] l'e'Fl T×=

Page 45: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Fundamental matrix for pure translation

Page 46: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Fundamental matrix for pure translation

Page 47: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Fundamental matrix for pure translation

[ ] [ ]×∞× == e'He'F ( )RKKH 1−∞ =

×⎥⎥⎦

⎢⎢⎣

⎡=

0101-00000

F( )T1,0,0e'=

example:

y'y =⇔= 0Fxx'T

0]X|K[IPXx ==

⎥⎦⎤

⎢⎣⎡== Z

xKt]|K[IXP'x'-1

ZKt/xx' +=

ZX,Y,Z x/K)( -1T =

motion starts at x and moves towards e, faster depending on Z

pure translation: F only 2 d.o.f., xT[e]x

x=0 ⇒ auto-epipolar

Page 48: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

General motion

Zt/K'xRKK'x' -1 +=

[ ] 0Hxe''x =×T

[ ] 0x̂e''x =×T

Page 49: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Geometric representation of F

( ) 2/FFF TS += ( ) 2/FFF T

A −= ( )AS FFF +=

0FxxT =xx ↔ ( )0xFx AT ≡

0xFx ST =

Fs

: Steiner conic, 5 d.o.f.Fa

=[xa

]x

: pole of line ee’

w.r.t. Fs

, 2 d.o.f.

Page 50: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Geometric representation of F

Page 51: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Pure planar motion Steiner conic Fs

is degenerate (two lines)

Page 52: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Projective transformation and invariance

-1-T FHH'F̂ x'H''x̂ Hx,x̂ =⇒==

Derivation based purely on projective concepts

( )( ) X̂P̂XHPHPXx -1 ===

F invariant to transformations of projective 3-space

( )( ) X̂'P̂XHHP'XP'x' -1 ===

( ) FP'P, α

( )P'P,Fαunique

not uniquecanonical form

m]|[MP'0]|[IP

== [ ] MmF ×=

Page 53: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Projective ambiguity of cameras given Fprevious slide: at least projective ambiguitythis slide: not more!

Show that if F is same for (P,P’) and (P,P’), there exists a projective transformation H so that P=HP and P’=HP’

~ ~

~ ~

]a~|A~['P~ 0]|[IP~ a]|[AP' 0]|[IP ====

[ ] [ ] A~a~AaF ×× ==

( )T1 avAA~ kaa~ +== −klemma:

[ ] kaa~Fa~0AaaaF2rank

==== ⇒×

[ ] [ ] [ ] ( ) ( ) TavA-A~k0A-A~kaA~a~Aa =⇒=⇒= ×××

⎥⎦⎤

⎢⎣⎡= −

kkIkH T1

1

v0

( ) 'P~]a|av-A[v0a]|[AHP' T1

T1

1==⎥⎦

⎤⎢⎣⎡= −

kkkkIk

(22-15=7, ok)

Page 54: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Canonical cameras given FF matrix corresponds to P,P’

iff

P’TFP is skew-symmetric

( )X0,FPXP'X TT ∀=

F matrix, S skew-symmetric matrix

]e'|[SFP' 0]|[IP ==

⎟⎠⎞

⎜⎝⎛

⎥⎦⎤

⎢⎣⎡=⎥⎦

⎤⎢⎣⎡= 00

0FSF0Fe'0FSF0]|F[I]e'|[SF

TT

T

TTT

(fund.matrix=F)

Possible choice:

]e'|F][[e'P' 0]|[IP ×==

Canonical representation:

]λe'|ve'F][[e'P' 0]|[IP T+== ×

Page 55: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The essential matrix~fundamental matrix for calibrated cameras (remove K)

[ ] ×× == t]R[RRtE T

0x̂E'x̂ T =

FKK'E T=

( ) x'K'x̂ x;Kx̂ -1-1 ==

5 d.o.f. (3 for R; 2 for t up to scale)

E is essential matrix if and only iftwo singularvalues

are equal (and third=0)

T0)VUdiag(1,1,E =SVD

Page 56: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

⎥⎥⎥

⎢⎢⎢

⎡ −=

100001010

WGiven

Motion from E

TTVUWR'=

TUWV'R' =

and

3Ut'=

3U't' −=

Four

solutions

Page 57: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Four possible reconstructions from E

(only one solution where points is in front of both cameras)

Page 58: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

C1

C2

l2

π

l1e1

e20m m 1

T2 =F

Fundamental matrix (3x3 rank 2 matrix)

1. Computable from corresponding points

2. Simplifies matching3. Allows to detect wrong matches4. Related to calibration

Underlying structure in set of matches for rigid scenes

l2

C1m1

L1

m2

L2

M

C2

m1

m2

C1

C2

l2

π

l1e1

e2

m1

L1

m2

L2

M

l2lT1

Epipolar geometry

Canonical representation:

]λe'|ve'F][[e'P' 0]|[IP T+== ×

1T

1 lPπ =

1T

1T

22 lPPl +=

0lx 2T

2 =

[ ] 111 xel ×=

0x][ePPx 1x1T

1T

2T2 =+

Page 59: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

3D reconstruction of cameras and structure

given xi ↔x‘i

, compute

P,P‘

and Xi

reconstruction problem:

ii PXx = ii XPx ′=′ for

all i

without additional information possible up to projective ambiguity

Page 60: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The projective reconstruction theorem

If

a set

of point correspondences

in two

views

determine

the

fundamental matrix

uniquely, then

the

scene

and cameras

may

be

reconstructed

from

these

correspondences

alone, and any

two

such reconstructions

from

these

correspondences

are

projectively

equivalent

Page 61: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

The projective reconstruction theorem

If

a set

of point correspondences

in two

views

determine

the

fundamental matrix

uniquely, then

the

scene

and cameras

may

be

reconstructed

from

these

correspondences

alone, and any

two

such reconstructions

from

these

correspondences

are

projectively

equivalent

{ }( )i111 X,'P,P { }( )i222 X,'P,Pii xx ′↔-1

12 HPP = -112 HPP ′=′ 12 HXX = ( )0FxFx :except =′= ii

theorem

from

last class

( ) iiiii 22111-1

112 XPxXPHXHPHXP ====⇒ along

same

ray

of

P2, idem for

P‘2

two

possibilities: X2i

=HX1i

, or

points

along

baselinekey result: allows reconstruction from pair of uncalibrated images

Page 62: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 63: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

ObjectiveGiven

two

uncalibrated

images

compute

(PM

,P‘M

,{XMi

})(i.e. within

similarity

of original scene

and cameras)

Algorithm(i)

Compute

projective

reconstruction

(P,P‘,{Xi

})(a)

Compute

F from

xi

↔x‘i(b)

Compute

P,P‘

from

F(c)

Triangulate

Xi

from

xi

↔x‘i(ii)

Rectify

reconstruction

from

projective

to metricDirect method: compute

H from

control

points

Stratified method:(a) Affine reconstruction: compute

π∞

(b) Metric reconstruction: compute

IAC ω

ii HXXE =-1

M PHP = -1M HPP ′=′ ii HXXM =

⎥⎦⎤

⎢⎣⎡=

∞π0|I H

⎥⎦⎤

⎢⎣⎡= 10

0AH-1

( ) 1TT ωMMAA −=

Page 64: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Stratified reconstruction

(i)

Projective

reconstruction(ii)

Affine reconstruction(iii)

Metric

reconstruction

Page 65: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Projective to affine

remember

2-D case

Page 66: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Projective to affine

{ }( )iX,P'P,

( ) ( )TT 1,0,0,0,,,π αDCBA=∞

( )TT 1,0,0,0πH- =∞

⎥⎦⎤

⎢⎣⎡=

∞π0|I H (if

D≠0)

theorem

says

up to projective

transformation, but

projective

with

fixed

π∞

is

affine transformation

can

be

sufficient

depending

on application, e.g. mid-point, centroid, parallellism

Page 67: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Translational motionpoints

at infinity

are

fixed

for

a pure translation⇒ reconstruction

of xi

↔ xi

is

on π∞

×× == ]e'[]e[F 0]|[IP =]e'|[IP =

Page 68: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Scene constraintsParallel linesparallel lines

intersect

at infinityreconstruction

of corresponding

vanishing

point yieldspoint on plane at infinity

3 sets

of parallel lines

allow

to uniquely

determine

π∞

remark: in presence

of noise

determining

the

intersection

of parallel lines

is

a delicate

problem

remark: obtaining

vanishing

point in one

image can

be

sufficient

Page 69: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Scene constraints

Page 70: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Scene constraintsDistance ratios on a line

known

distance ratio

along

a line

allow

to determine

point at infinity

(same

as 2D case)

Page 71: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Affine to metricidentify

absolute conic

transform

so that ∞∞ =++Ω on π ,0: 222 ZYX

then

projective

transformation

relating

original and reconstruction

is

a similarity

transformation

in practice, find image of Ω∞image ω∞

back-projects

to cone

that

intersects

π∞

in Ω∞

ω*

Ω*

projection

constraints

note

that

image is

independent of particular

reconstruction

Page 72: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Affine to metric

m]|[MP = ω

⎥⎦⎤

⎢⎣⎡= 10

0AH-1

given

possible

transformation

from

affine to metric

is

( ) 1TT ωMMAA −=

(cholesky

factorisation)

m]|[MAPHP -1M ==

proof:

TTTMM

* MMAAMMω ==T-T-1-1 AAMωM =

⎟⎠⎞

⎜⎝⎛

⎥⎦⎤

⎢⎣⎡=Ω 00

0I*

Page 73: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Orthogonality

0ωvv 2T1 =

ωvl =

vanishing

points

corresponding

to orthogonal directions

vanishing

line

and vanishing

point correspondingto plane and normal direction

Page 74: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

known internal parameters

-1-TKKω =

0ωω 2112 ==0=s

rectangular

pixels

yx αα =

square

pixels

2211 ωω =

Page 75: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Same camera for all images

same

intrinsics

⇒ same

image of the

absolute conic

e.g. moving

cameras

given

sufficient

images

there

is

in general

only

oneconic

that

projects

to the

same

image in all images,i.e. the

absolute conic

This

approach

is

called

self-calibration, see

later

-1-TωHHω' ∞∞=transfer

of IAC:

Page 76: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Direct metric reconstruction using ω

KKKω -1-T ⇒=

approach

1

calibrated

reconstruction

approach

2

compute

projective

reconstruction

back-project

ω

from

both

images

intersection

defines

Ω∞

and its

support

plane π∞

(in general

two

solutions)

Page 77: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 78: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Direct reconstruction using ground truth

ii HXXE =

use

control

points

XEi

with

know

coordinatesto go

from

projective

to metric

Eii XPHx -1=(2 lin. eq. in H-1

per view, 3 for

two

views)

Page 79: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

ObjectiveGiven

two

uncalibrated

images

compute

(PM

,P‘M

,{XMi

})(i.e. within

similarity

of original scene

and cameras)

Algorithm(i)

Compute

projective

reconstruction

(P,P‘,{Xi

})(a)

Compute

F from

xi

↔x‘i(b)

Compute

P,P‘

from

F(c)

Triangulate

Xi

from

xi

↔x‘i(ii)

Rectify

reconstruction

from

projective

to metricDirect method: compute

H from

control

points

Stratified method:(a) Affine reconstruction: compute

π∞

(b) Metric reconstruction: compute

IAC ω

ii HXXE =-1

M PHP = -1M HPP ′=′ ii HXXM =

⎥⎦⎤

⎢⎣⎡=

∞π0|I H

⎥⎦⎤

⎢⎣⎡= 10

0AH-1

( ) 1TT ωMMAA −=

Page 80: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Image information provided View relations and projective objects

3-space objects

reconstruction ambiguity

point correspondences F projective

point correspondences including vanishing points

F,H∞ π∞affine

Points correspondences and internal camera calibration F,H∞

ω,ω’π∞Ω∞

metric

Page 81: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

UncalibratedUncalibrated

visual visual odometryodometry for ground plane motionfor ground plane motion

(joint work with Simone Gasparini)

Page 82: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Problem formulation

Given:–

an uncalibrateduncalibrated camera mounted on a robot

the camera is fixedfixed and aims at the floor–

the robot moving on a planarplanar floor (ground plane)

Determine:–

the estimate of robot motion from observed features

on the floor

Page 83: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Technique involvedEstimate the ground plane transformation (homography) between images taken before and after robot displacement

Page 84: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Motivations•

Dead reckoning techniques are not reliable and diverge after few steps [Borenstein96]

Visual odometry

techniques exploits cameras to recover motion

We use a single uncalibrated camera–

3D reconstruction with uncalibrated

camera

usually require auto-calibration–

Non-planar motion is required [Triggs98]

Planar motion with different camera attitudes [Knight03]

Special devices is required (e.g. PTZ cameras)

Page 85: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Problem formulation

Fixed uncalibrated

camera mounted on a robot

The pose of the camera w.r.t. the robot is unknown

The projective transformation between ground plane and image plane is a homography

T (3x3)

T does not change with robot motion••

T is T is uknownuknown

Page 86: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 87: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Problem formulation

Robot and camera undergo a planar motion–

rotation of unknown angle θ

about unknown

vertical axis–

2D rotation matrix R (3x3 with homogeneous coordinates)

2x2ˆ ˆ orthogonal matrix0 translation vector (3x1 )

R R⎡ ⎤= ⎢ ⎥⎣ ⎦

R tt

Page 88: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Problem

formulation

Given 2 images before and after robot displacement determine:–

Rotation centre C

Rotation angle θ–

Determine unknown

transformation T

between

ground plane and image plane

Page 89: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Ground reference frame

We define a ground reference frame–

O is the origin of the projected reference frame

E.g. O is the backprojection

of image point O’(0,0)

The vector connecting the origin to a point A is the unit vector along the x-axis

E.g. A is the backprojection

of image point A’(100,0)

Page 90: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 91: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Estimation of robot displacement

Transformation relating the two images is still a homography

Eigenvectors of H:

1 ( unknown)−H = TRT T

( )' associated to the eigval, C rotation center '

associated to the eigval, I and J circular points'

C TCeigvec I TI

J TJ

= →⎧⎪ = ⎫⎨ →⎬⎪ = ⎭⎩

H =¡

£

Page 92: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Since eig(H)=eig(R)–

Angle θ

can be calculated through the ratio of

imaginary and real part of the complex eigenvalue

of H

E.g. the eigenvalue

associated to I’

is μe±iθ

Page 93: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Estimation of robot displacement: degenerate motion

Pure translation: a frequent motion on planar floor

Under pure translation, the whole line at the infinity is invariant

Page 94: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

ground plane can be only rectified modulo an affine transformation:e.g., orientation of translaton

wrt

ground reference

can not be determined

In practice:–

Use a motion including rotations to estimate ground plane to image plane transformation T

Use knowledge of T while translating

Page 95: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Estimation of the transformation T

Estimating T allows to determine the shape of observed features

Four pairs of corresponding points are needed–

The 2 circular points I and J

The 2 points A and O used for ground reference

Page 96: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

[ ][ ][ ] [ ][ ] [ ]

where 1, ,0

where 1, ,0

where 0,0,1 and ' 0,0,1

where 1,0,1 and ' 100,0,1

T

T

T T

T T

i

i

⎧ =⎪⎪ = −⎪⎨

= =⎪⎪

= =⎪⎩

I'=TI I

J'=TJ J

O'=TO O O

A'=TA A A

Page 97: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Experimental set up

Fixed perspective camera placed on turntable ( ground truth)

Optical distortion is negligible•

Camera pointing towards the ground floor

Camera viewpoint in a generic position wrt rotation axis

Page 98: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Basic algorithm:–

Feature (corner) extraction from floor texture [Harris88]

Feature tracking and matching in order to determine correspondences

Corresponding features used to fit the homography

H

Eigendecomposition

of matrix H•

Rotation angle

Image of circular points•

Image of rotation centre

Ground plane to image plane transformation

Page 99: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Experiments on sequences of images

Sequence of large displacements

Image displacements of the order of 10°

Features extracted and matched [Torr93]

Page 100: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Use best matching pairs to fit a homography using RANSAC [Fischler81]

Good overall accuracy (error < 1°)•

Larger displacements affect matching

Page 101: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent
Page 102: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Experiments on sequences of images

Sequence of small displacements•

Image displacements of about 5°

Small rotations may lead to numerical instability

Track features over three images–

H13

fitted with correspondences of 1 and 3

Good overall accuracy (error < 1°)

Page 103: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

HH13131 2 3

Page 104: Presentazione di PowerPoint - Politecnico di Milanohome.deib.polimi.it/matteucc/lectures/3DSFVM/VisualOdome...parallel to d O V P ∞ d The images of parallel lines are concurrent

Experiments on a mobile platform

Feature extraction and matching between images

Rotation and relevant centre of rotation determination