Multi-view geometry Slides from L. Lazebnik Structure from motion - - PowerPoint PPT Presentation

multi view geometry
SMART_READER_LITE
LIVE PREVIEW

Multi-view geometry Slides from L. Lazebnik Structure from motion - - PowerPoint PPT Presentation

Multi-view geometry Slides from L. Lazebnik Structure from motion Camera 1 Camera 3 Camera 2 R 1 ,t 1 R 3 ,t 3 R 2 ,t 2 Figure credit: Noah Snavely Structure from motion ? Camera 1 Camera 3 Camera 2 R 1 ,t 1 R 3 ,t 3 R 2 ,t 2


slide-1
SLIDE 1

Multi-view geometry

Slides from L. Lazebnik

slide-2
SLIDE 2

Structure from motion

Camera 3

R3,t3

Figure credit: Noah Snavely

Camera 1 Camera 2

R1,t1 R2,t2

slide-3
SLIDE 3

Structure from motion

Camera 3

R3,t3

Camera 1 Camera 2

R1,t1 R2,t2

  • Structure: Given known cameras and projections of the same 3D

point in two or more images, compute the 3D coordinates of that point

?

slide-4
SLIDE 4

Structure from motion

Camera 3

R3,t3

Camera 1 Camera 2

R1,t1 R2,t2

  • Motion: Given a set of known 3D points seen by a camera, compute

the camera parameters

? ? ?

slide-5
SLIDE 5

Structure from motion

Camera 1 Camera 2

R1,t1 R2,t2

  • Bootstrapping the process: Given a set of 2D point correspondences

in two images, compute the camera parameters

? ?

slide-6
SLIDE 6

Two-view geometry

slide-7
SLIDE 7
  • Epipolar Plane – plane containing baseline (1D family)
  • Epipoles

= intersections of baseline with image planes = projections of the other camera center = vanishing points of the motion direction

  • Baseline – line connecting the two camera centers

Epipolar geometry

X x x’

slide-8
SLIDE 8
  • Epipolar Plane – plane containing baseline (1D family)
  • Epipoles

= intersections of baseline with image planes = projections of the other camera center = vanishing points of the motion direction

  • Epipolar Lines - intersections of epipolar plane with image

planes (always come in corresponding pairs)

  • Baseline – line connecting the two camera centers

Epipolar geometry

X x x’

slide-9
SLIDE 9

Example 1

  • Converging cameras
slide-10
SLIDE 10

Example 2

  • Motion parallel to the image plane
slide-11
SLIDE 11

Example 3

slide-12
SLIDE 12

Example 3

  • Motion is perpendicular to the image plane
  • Epipole is the “focus of expansion” and the principal point
slide-13
SLIDE 13

Motion perpendicular to image plane

http://vimeo.com/48425421

slide-14
SLIDE 14

Epipolar constraint

  • If we observe a point x in one image, where

can the corresponding point x’ be in the other image?

x x’ X

slide-15
SLIDE 15
  • Potential matches for x have to lie on the corresponding

epipolar line l’.

  • Potential matches for x’ have to lie on the corresponding

epipolar line l.

Epipolar constraint

x x’ X x’ X x’ X

slide-16
SLIDE 16

Epipolar constraint example

slide-17
SLIDE 17

X

x x’

Epipolar constraint: Calibrated case

slide-18
SLIDE 18

X

x x’

Epipolar constraint: Calibrated case

  • Intrinsic and extrinsic parameters of the cameras are known,

world coordinate system is set to that of the first camera

  • Then the projection matrices are given by K[I | 0] and K’[R | t]
  • We can multiply the projection matrices (and the image points)

by the inverse of the calibration matrices to get normalized image coordinates:

X t R x K x X, I x K x ] [ 0] [

pixel 1 norm pixel 1 norm

= ¢ ¢ = ¢ = =

slide-19
SLIDE 19

X

x x’

Epipolar constraint: Calibrated case

Derivation

slide-20
SLIDE 20

X

x x’

Epipolar constraint: Calibrated case

Derivation

slide-21
SLIDE 21

X

x x’ = Rx+t

Epipolar constraint: Calibrated case

R t

The vectors 𝑆𝑦 + 𝑢, 𝑢, and 𝑦′ are coplanar

= (x,1)T

[ ]

÷ ÷ ø ö ç ç è æ 1 x I

[ ]

÷ ÷ ø ö ç ç è æ 1 x t R

𝑆𝑦 + 𝑢 𝑦′ 𝑢

Simplification

b a b a ] [

´

= ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é

  • =

´

z y x x y x z y z

b b b a a a a a a

Recall:

slide-22
SLIDE 22

X

x x’ = Rx+t

Epipolar constraint: Calibrated case

R t

The vectors 𝑆𝑦 + 𝑢, 𝑢, and 𝑦′ are coplanar

= (x,1)T

[ ]

÷ ÷ ø ö ç ç è æ 1 x I

[ ]

÷ ÷ ø ö ç ç è æ 1 x t R

𝑆𝑦 + 𝑢 𝑦′ 𝑢

Simplification

b a b a ] [

´

= ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é

  • =

´

z y x x y x z y z

b b b a a a a a a

Recall:

𝑦!. 𝑢× 𝑆𝑦 + 𝑢 = 0 𝑦!. 𝑢×𝑆𝑦 + 𝑢×𝑢 = 0 𝑦!. 𝑢×𝑆𝑦 = 0 𝑦!. 𝑢× 𝑆𝑦 = 0 𝑦!#𝐹𝑦 = 0

slide-23
SLIDE 23

X

x x’ = Rx+t

Epipolar constraint: Calibrated case

The vectors 𝑆𝑦 + 𝑢, 𝑢, and 𝑦′ are coplanar

= (x,1)T

[ ]

÷ ÷ ø ö ç ç è æ 1 x I

[ ]

÷ ÷ ø ö ç ç è æ 1 x t R

𝑆𝑦 + 𝑢 𝑦′ 𝑢

] ) ( [ = ´ × ¢ x R t x

! x T[t×]Rx = 0 ! x TE x = 0

Essential Matrix (Longuet-Higgins, 1981)

slide-24
SLIDE 24

X

x x’

Epipolar constraint: Calibrated case

  • E x is the epipolar line associated with x (l' = E x)
  • Recall: a line is given by ax + by + c = 0 or

! x TE x = 0

ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = = 1 , where y x c b a

T

x l x l

slide-25
SLIDE 25

X

x x’

Epipolar constraint: Calibrated case

  • E x is the epipolar line associated with x (l' = E x)
  • ETx' is the epipolar line associated with x' (l = ETx')
  • E e = 0 and ETe' = 0
  • E is singular (rank two)
  • E has five degrees of freedom

! x TE x = 0

slide-26
SLIDE 26

Epipolar constraint: Uncalibrated case

  • The calibration matrices K and K’ of the two

cameras are unknown

  • We can write the epipolar constraint in terms
  • f unknown normalized coordinates:

X

x x’

slide-27
SLIDE 27

Epipolar constraint: Uncalibrated case

  • The calibration matrices K and K’ of the two

cameras are unknown

  • We can write the epipolar constraint in terms
  • f unknown normalized coordinates:

X

x x’

ˆ ˆ = ¢ x E x T

x K x x K x ¢ ¢ = ¢ =

  • 1

1

ˆ , ˆ

slide-28
SLIDE 28

Epipolar constraint: Uncalibrated case

X

x x’

Fundamental Matrix

(Faugeras and Luong, 1992)

ˆ ˆ = ¢ x E x T

x K x x K x ¢ ¢ = ¢ =

  • 1

1

ˆ ˆ

1

with

  • ¢

= = ¢ K E K F x F x

T T

slide-29
SLIDE 29

Epipolar constraint: Uncalibrated case

  • F x is the epipolar line associated with x (l' = F x)
  • FTx' is the epipolar line associated with x' (l = FTx')
  • F e = 0 and FTe' = 0
  • F is singular (rank two)
  • F has seven degrees of freedom

X

x x’

ˆ ˆ = ¢ x E x T

1

with

  • ¢

= = ¢ K E K F x F x

T T

slide-30
SLIDE 30

Estimating the fundamental matrix

slide-31
SLIDE 31

The eight-point algorithm

) 1 , , ( , ) 1 , , ( v u v u

T

¢ ¢ = ¢ = x x

slide-32
SLIDE 32

The eight-point algorithm

Enforce rank-2 constraint (take SVD

  • f F and throw out the

smallest singular value)

[ ]

1 1

33 32 31 23 22 21 13 12 11

= ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é ¢ ¢ v u f f f f f f f f f v u [ ]

1

33 32 31 23 22 21 13 12 11

= ú ú ú ú ú ú ú ú ú ú ú ú û ù ê ê ê ê ê ê ê ê ê ê ê ê ë é ¢ ¢ ¢ ¢ ¢ ¢ f f f f f f f f f v u v v v u v u v u u u

) 1 , , ( , ) 1 , , ( v u v u

T

¢ ¢ = ¢ = x x Solve homogeneous linear system using eight or more matches

slide-33
SLIDE 33

Problem with eight-point algorithm

[ ]

1

32 31 23 22 21 13 12 11

  • =

ú ú ú ú ú ú ú ú ú ú ú û ù ê ê ê ê ê ê ê ê ê ê ê ë é ¢ ¢ ¢ ¢ ¢ ¢ f f f f f f f f v u v v v u v u v u u u

slide-34
SLIDE 34

[ ]

1

32 31 23 22 21 13 12 11

  • =

ú ú ú ú ú ú ú ú ú ú ú û ù ê ê ê ê ê ê ê ê ê ê ê ë é ¢ ¢ ¢ ¢ ¢ ¢ f f f f f f f f v u v v v u v u v u u u

Problem with eight-point algorithm

Poor numerical conditioning Can be fixed by rescaling the data

slide-35
SLIDE 35

The normalized eight-point algorithm

  • Center the image data at the origin, and scale it so

the mean squared distance between the origin and the data points is 2 pixels

  • Use the eight-point algorithm to compute F from the

normalized points

  • Enforce the rank-2 constraint (for example, take SVD
  • f F and throw out the smallest singular value)
  • Transform fundamental matrix back to original units:

if T and T’ are the normalizing transformations in the two images, than the fundamental matrix in original coordinates is T’T F T (Hartley, 1995)

slide-36
SLIDE 36

Seven-point algorithm

  • Set up least squares system with seven pairs
  • f correspondences and solve for null space

(two vectors) using SVD

  • Solve for linear combination of null space

vectors that satisfies det(F)=0

Source: D. Hoiem

slide-37
SLIDE 37

Nonlinear estimation

  • Linear estimation minimizes the sum of squared algebraic

distances between points x’i and epipolar lines F xi (or points xi and epipolar lines FTx’i):

  • Nonlinear approach: minimize sum of squared geometric

distances ( ! xi

T i=1 N

F xi)2

d2( ! xi, F xi)+d2(xi, F T ! xi) " # $ %

i=1 N

xi

F T ! xi Fxi ! xi

slide-38
SLIDE 38

Comparison of estimation algorithms

8-point Normalized 8-point Nonlinear least squares

  • Av. Dist. 1

2.33 pixels 0.92 pixel 0.86 pixel

  • Av. Dist. 2

2.18 pixels 0.85 pixel 0.80 pixel

slide-39
SLIDE 39

The Fundamental Matrix Song

http://danielwedge.com/fmatrix/

slide-40
SLIDE 40

From epipolar geometry to camera calibration

  • Estimating the fundamental matrix is known

as “weak calibration”

  • If we know the calibration matrices of the two

cameras, we can estimate the essential matrix: E = K’TFK

  • The essential matrix gives us the relative

rotation and translation between the cameras,

  • r their extrinsic parameters
  • Alternatively, if the calibration matrices are

known, the five-point algorithm can be used to estimate relative camera pose