Lecture 17: Multi-view Geometry 1 Announcements New IA - - PowerPoint PPT Presentation

lecture 17 multi view geometry
SMART_READER_LITE
LIVE PREVIEW

Lecture 17: Multi-view Geometry 1 Announcements New IA - - PowerPoint PPT Presentation

Lecture 17: Multi-view Geometry 1 Announcements New IA office hours, starting next week Instead of raising your hand: send a message, then (after I answer) unmute and ask your question Please send us feedback!


slide-1
SLIDE 1

1

Lecture 17: Multi-view Geometry

slide-2
SLIDE 2
  • New IA office hours, starting next week



 
 
 


  • Instead of raising your hand: send a message, then (after

I answer) unmute and ask your question

  • Please send us feedback!

2

Announcements

slide-3
SLIDE 3

Today

  • Review image formation
  • Epipolar geometry
  • Image alignment

3

slide-4
SLIDE 4

Recall: homogeneous coordinates

Representing translations: homogeneous image coordinates Converting from homogeneous coordinates:

4

Source: N. Snavely

slide-5
SLIDE 5

Recall: camera parameters

“The World” Camera

x y z

v w u

  • COP

Three important coordinate systems: 1. World coordinates 2. Camera coordinates 3. Image coordinates

(x, y, z)

How do we project a given world point (x, y, z) to an image point?

5

Source: N. Snavely

slide-6
SLIDE 6

Recall: camera parameters

6

Source: N. Snavely

intrinsics rotation translation

slide-7
SLIDE 7

7

Estimating depth from multiple views

slide-8
SLIDE 8

Stereo vision

~6cm ~50cm

8 Source: Torralba, Isola, Freeman

slide-9
SLIDE 9

1, 2, N eyes

9 Source: Torralba, Isola, Freeman

slide-10
SLIDE 10

10

1, 2, N eyes

Source: Torralba, Isola, Freeman

slide-11
SLIDE 11

11

1, 2, N eyes

Source: Torralba, Isola, Freeman

slide-12
SLIDE 12

Depth without objects

Random dot stereograms (Bela Julesz)

12 Source: Torralba, Isola, Freeman

Julesz, 1971

slide-13
SLIDE 13

13 Source: Torralba, Isola, Freeman

slide-14
SLIDE 14

Geometry for a simple stereo system

14

f Z1 X1 xL

Source: Torralba, Isola, Freeman

slide-15
SLIDE 15

Geometry for a simple stereo system

15

f Z1 X1 Z? xL

Source: Torralba, Isola, Freeman

slide-16
SLIDE 16

Geometry for a simple stereo system

16

f Z1 X1 f T Z2 X2 Z? xL xR

Source: Torralba, Isola, Freeman

slide-17
SLIDE 17

Geometry for a simple stereo system

17

f Z1 X1 f T Z2 X2 Z? xL xR Similar triangles

Source: Torralba, Isola, Freeman

slide-18
SLIDE 18

Geometry for a simple stereo system

18

f Z1 X1 f T Z2 X2 Z? xL xR Similar triangles

Source: Torralba, Isola, Freeman

slide-19
SLIDE 19

Geometry for a simple stereo system

19

f Z1 X1 f T Z2 X2 Z? xL xR

T+XL-XR Z-f

= Similar triangles:

Source: Torralba, Isola, Freeman

slide-20
SLIDE 20

Geometry for a simple stereo system

20

f Z1 X1 f T Z2 X2 Z? xL xR

T+XL-XR Z-f

= Similar triangles:

T Z

Source: Torralba, Isola, Freeman

slide-21
SLIDE 21

Geometry for a simple stereo system

21

f Z1 X1 f T Z2 X2 Z? xL xR

T+XL-XR Z-f

= Similar triangles:

T Z

Solving for Z: Z = f

T

XL - XR Disparity

Source: Torralba, Isola, Freeman

slide-22
SLIDE 22

In 3D

22

camera 1 camera 2 T

Source: Torralba, Isola, Freeman

slide-23
SLIDE 23

Disparity map

23

Left image Right image Second picture is ~1m to the right

Source: Torralba, Isola, Freeman

slide-24
SLIDE 24

Disparity map

24

Left image Right image

Source: Torralba, Isola, Freeman

slide-25
SLIDE 25

Disparity map

25

Left image Right image

Source: Torralba, Isola, Freeman

slide-26
SLIDE 26

Disparity map

26

D(x,y) Z(x,y) =

a

D(x,y) I(x,y) I’(x,y) = I(x+D(x,y), y) I’(x,y)

Source: Torralba, Isola, Freeman

slide-27
SLIDE 27

Finding correspondences

27

We only need to search for matches along horizontal lines.

Source: Torralba, Isola, Freeman

slide-28
SLIDE 28

28 CSE 576, Spring 2008 Stereo matching

Basic stereo algorithm

For each “epipolar line” For each pixel in the left image

  • compare with every pixel on same epipolar line in right image
  • pick pixel with minimum match cost

Source: R. Szeliski

slide-29
SLIDE 29

Computing disparity

29 Source: Torralba, Isola, Freeman

slide-30
SLIDE 30

But you can learn depth from a single image

30 Source: Torralba, Isola, Freeman

slide-31
SLIDE 31

General case

  • The two cameras need not have parallel optical axes.

31 Source: Torralba, Isola, Freeman

slide-32
SLIDE 32

32 Source: Torralba, Isola, Freeman

slide-33
SLIDE 33

33

Do we need to search for matches only along horizontal lines?

Source: Torralba, Isola, Freeman

slide-34
SLIDE 34

34

Do we need to search for matches only along horizontal lines?

Source: Torralba, Isola, Freeman

slide-35
SLIDE 35

35

It looks like we need to search everywhere... are there any constraints
 that can guide the search? Do we need to search for matches only along horizontal lines?

Source: Torralba, Isola, Freeman

slide-36
SLIDE 36

Stereo correspondence constraints

O O’ p p’ ? If we see a point in camera 1, are there any constraints on where we
 will find it on camera 2? Camera 1 Camera 2

36 Source: Torralba, Isola, Freeman

slide-37
SLIDE 37

O O’ p p’ ?

37

Stereo correspondence constraints

Source: Torralba, Isola, Freeman

slide-38
SLIDE 38

Epipolar constraint

O O’ p p’ ?

38 Source: Torralba, Isola, Freeman

slide-39
SLIDE 39

Some terminology

39

O O’ p p’ ?

Source: Torralba, Isola, Freeman

slide-40
SLIDE 40

Some terminology

40

O O’ p p’ ?

Baseline: the line connecting the two camera centers Epipole: point of intersection of baseline with the image plane

Baseline

Source: Torralba, Isola, Freeman

slide-41
SLIDE 41

Some terminology

41

O O’ p p’ ?

Baseline: the line connecting the two camera centers Epipole: point of intersection of baseline with the image plane

epipole epipole Baseline

Source: Torralba, Isola, Freeman

slide-42
SLIDE 42

Some terminology

42

O O’ p p’ ?

Baseline: the line connecting the two camera centers Epipolar plane: the plane that contains the two camera centers and a 3D point in the world Epipole: point of intersection of baseline with the image plane

epipolar plane

Source: Torralba, Isola, Freeman

slide-43
SLIDE 43

Some terminology

43

O O’ p p’ ?

Baseline: the line connecting the two camera centers Epipolar plane: the plane that contains the two camera centers and a 3D point in the world Epipolar line: intersection of the epipolar plane with each image plane Epipole: point of intersection of baseline with the image plane

epipolar line epipolar line

Source: Torralba, Isola, Freeman

slide-44
SLIDE 44

Epipolar constraint

O O’ p p’ ?

44

epipolar line We can search for matches across epipolar lines All epipolar lines intersect at the epipoles

Source: Torralba, Isola, Freeman

slide-45
SLIDE 45

The fundamental matrix

45

O O’ p p’

pT F p’ = 0

F: fundamental matrix p, p’: image points in homogeneous coordinates If we observe a point in one image, its position in the other image is constrained to lie on line defined by above.

Source: Torralba, Isola, Freeman

slide-46
SLIDE 46

K, K’: intrinsics matrices R, t: relative pose See Hartley and Zisserman for derivation

The fundamental matrix

46

O O’ p p’

(pT F) p’ = 0 uT p’ = 0

u: a line induced by p p, p’: image points in homogeneous coordinates

Closely related to projection matrix:

slide-47
SLIDE 47

Example: converging cameras

Figure from Hartley & Zisserman Source: Kristen Grauman

slide-48
SLIDE 48

Image rectification

48

Source: A. Efros

slide-49
SLIDE 49

49 CSE 576, Spring 2008 Stereo matching

Active stereo with structured light

camera 2 camera 1 projector camera 1 projector

Li Zhang’s one-shot stereo

Source: R. Szeliski

Li Zhang, Brian Curless, and Steven M. Seitz. Rapid Shape Acquisition Using Color Structured Light and Multi-pass Dynamic Programming. In Proceedings of the 1st International Symposium on 3D Data Processing, Visualization, and Transmission (3DPVT), Padova, Italy, June 19-21, 2002, pp. 24-36.

slide-50
SLIDE 50

50 CSE 576, Spring 2008 Stereo matching

slide-51
SLIDE 51

51

slide-52
SLIDE 52

52

slide-53
SLIDE 53

53

slide-54
SLIDE 54

Making panoramas Future problem set!

Source: N. Snavely

slide-55
SLIDE 55

Why don’t these image line up exactly?

Image alignment

Source: N. Snavely

slide-56
SLIDE 56

Recall: affine transformations

affine transformation

what happens when we change this row?

Source: N. Snavely

slide-57
SLIDE 57

Projective Transformations aka Homographies aka Planar Perspective Maps

Called a homography (or planar perspective map)

Source: N. Snavely

slide-58
SLIDE 58

Homographies

Note that this can be 0! A “point at infinity”

Source: N. Snavely

slide-59
SLIDE 59

Points at infinity

Source: N. Snavely

slide-60
SLIDE 60

Homography

60

Example: two pictures taken by rotating the camera:

If we try to build a panorama by overlapping them:

Source: Torralba, Isola, Freeman

slide-61
SLIDE 61

Homography

61

Example: two pictures taken by rotating the camera:

With a homography you can map both images into a single camera:

Source: Torralba, Isola, Freeman

slide-62
SLIDE 62

Why does this work?

Image 1 Image 2

Optical Center

How do we map points in image 2 into image 1? image 1 image 2 3x3 homography

Step 1: Convert pixels in image 2 to rays in camera 2’s coordinate system. Step 2: Convert rays in camera 2’s coordinates to rays in camera 1’s coordinates. Step 3: Convert rays in camera 1’s coordinates to pixels in image 1’s coordinates.

intrinsics extrinsics (rotation only)

Source: N. Snavely

slide-63
SLIDE 63

Plane-to-plane homography

image plane in front image plane below

black area where no pixel maps to

Source: N. Snavely

slide-64
SLIDE 64

Homographies

  • Homographies …

– Affine transformations, and – Projective warps

  • Properties of projective transformations:

– Origin does not necessarily map to origin – Lines map to lines – Parallel lines do not necessarily remain parallel – Ratios are not preserved – Closed under composition

Source: N. Snavely

slide-65
SLIDE 65

2D image transformations

Source: N. Snavely

slide-66
SLIDE 66

Image warping

Given a coordinate transformation (x’,y’) = T(x,y) and a source image f(x,y), how do we compute a transformed image g(x’,y’) = f(T(x,y))?

f(x,y) g(x’,y’) x x’ T(x,y) y y’

Source: N. Snavely

slide-67
SLIDE 67

Forward warping

  • Send each pixel f(x) to its corresponding

location (x’,y’) = T(x,y) in g(x’,y’)

f(x,y) g(x’,y’) x x’ T(x,y)

  • What if a pixel lands “between” two pixels?

y y’

Source: N. Snavely

slide-68
SLIDE 68

Forward warping

  • Send each pixel f(x) to its corresponding

location (x’,y’) = T(x,y) in g(x’,y’)

  • What if a pixel lands “between” two pixels?

f(x,y) g(x’,y’) x x’ T(x,y)

  • Answer: add “contribution” to several pixels,

normalize later (splatting)

  • Can still result in holes

y y’

Source: N. Snavely

slide-69
SLIDE 69

Inverse warping

  • Get each pixel g(x’,y’) from its corresponding

location (x,y) = T-1(x,y) in f(x,y)

f(x,y) g(x’,y’) x x’ T-1(x,y)

  • Requires taking the inverse of the transform
  • What if pixel comes from “between” two pixels?

y y’

Source: N. Snavely

slide-70
SLIDE 70

Inverse warping

  • Get each pixel g(x’) from its corresponding

location x’ = h(x) in f(x)

  • What if pixel comes from “between” two pixels?
  • Answer: resample color value from

interpolated (prefiltered) source image

f(x,y) g(x’,y’) x x’ y y’ T-1(x,y)

Source: N. Snavely

slide-71
SLIDE 71

Interpolation

  • Possible interpolation filters:

– nearest neighbor – bilinear – bicubic (interpolating) – sinc

  • Needed to prevent “jaggies”


and aliasing artifacts (with prefiltering)

Source: N. Snavely

slide-72
SLIDE 72

Next lecture: estimating geometry from images