Stereo Vision 16-385 Computer Vision (Kris Kitani) Carnegie Mellon - - PowerPoint PPT Presentation

stereo vision
SMART_READER_LITE
LIVE PREVIEW

Stereo Vision 16-385 Computer Vision (Kris Kitani) Carnegie Mellon - - PowerPoint PPT Presentation

Stereo Vision 16-385 Computer Vision (Kris Kitani) Carnegie Mellon University Whats different between these two images? Objects that are close move more or less? The amount of horizontal movement is inversely proportional to The amount


slide-1
SLIDE 1

Stereo Vision

16-385 Computer Vision (Kris Kitani)

Carnegie Mellon University

slide-2
SLIDE 2

What’s different between these two images?

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

Objects that are close move more or less?

slide-6
SLIDE 6

The amount of horizontal movement is inversely proportional to …

slide-7
SLIDE 7

The amount of horizontal movement is inversely proportional to … … the distance from the camera.

slide-8
SLIDE 8

X O O0

image plane

slide-9
SLIDE 9

X O O0

f f

x x0

image plane

slide-10
SLIDE 10

X O O0

f f

x x0 Z

slide-11
SLIDE 11

X O O0

(baseline)

b

f f

x x0 Z

slide-12
SLIDE 12

X O O0

(baseline)

b

f f

x x0 X Z = x f Z

slide-13
SLIDE 13

X O O0

(baseline)

b

f f

x x0 X Z = x f Z b − X Z = x0 f

slide-14
SLIDE 14

X O O0

(baseline)

b

f f

x x0 X Z = x f Z d = x − x0 = bf Z Disparity b − X Z = x0 f

slide-15
SLIDE 15

X O O0

(baseline)

b

f f

x x0 X Z = x f Z d = x − x0 = bf Z Disparity

inversely proportional to depth

b − X Z = x0 f

slide-16
SLIDE 16

Nomad robot searches for meteorites in Antartica

http://www.frc.ri.cmu.edu/projects/meteorobot/index.html

Real-time stereo sensing

slide-17
SLIDE 17
slide-18
SLIDE 18

Subaru Eyesight system Pre-collision braking

slide-19
SLIDE 19
slide-20
SLIDE 20

How so you compute depth from a stereo pair?

slide-21
SLIDE 21
  • 1. Rectify images 


(make epipolar lines horizontal)

  • 2. For each pixel
  • a. Find epipolar line
  • b. Scan line for best match
  • c. Compute depth from disparity

Z = bf d

slide-22
SLIDE 22

How can you make the epipolar lines horizontal?

slide-23
SLIDE 23

It’s hard to make the image planes exactly parallel

slide-24
SLIDE 24

How can you make the epipolar lines horizontal?

slide-25
SLIDE 25

t x x’

How can you make the epipolar lines horizontal?

R = I t = (T, 0, 0)

When this relationship holds:

slide-26
SLIDE 26

t x x’

How can you make the epipolar lines horizontal?

R = I t = (T, 0, 0)

! ! ! " # $ $ $ % & − = × = T T R t E

x E xT = " ,

Let’s try this out… This always has to hold

When this relationship holds:

slide-27
SLIDE 27

t x x’

How can you make the epipolar lines horizontal?

R = I t = (T, 0, 0)

! ! ! " # $ $ $ % & − = × = T T R t E

( ) ( )

v T T v u v u T T v u = " " " # $ % % % & ' ! − = " " " # $ % % % & ' ! ! ) ) ) * + , , ,

  • .

− 1 1 1

x E xT = " ,

Write out the constraint Let’s try this out… This always has to hold

When this relationship holds:

slide-28
SLIDE 28

t x x’

How can you make the epipolar lines horizontal?

R = I t = (T, 0, 0)

! ! ! " # $ $ $ % & − = × = T T R t E

( ) ( )

v T Tv v T T v u v u T T v u ! = = " " " # $ % % % & ' ! − = " " " # $ % % % & ' ! ! ) ) ) * + , , ,

  • .

− 1 1 1

x E xT = " ,

y coordinate is always the same!

Write out the constraint Let’s try this out… This always has to hold The image of a 3D point will always be on the same horizontal line

When this relationship holds:

slide-29
SLIDE 29

What is stereo rectification?

slide-30
SLIDE 30

What is stereo rectification?

slide-31
SLIDE 31

What is stereo rectification? Reproject image planes onto a common plane parallel to the line between camera centers

slide-32
SLIDE 32

What is stereo rectification? Reproject image planes onto a common plane parallel to the line between camera centers Need two homographies (3x3 transform), one for each input image reprojection

  • C. Loop and Z. Zhang. Computing Rectifying Homographies for Stereo Vision.Computer Vision and Pattern Recognition, 1999.
slide-33
SLIDE 33

Stereo Rectification

  • 1. Rotate the right camera by R 


(aligns camera coordinate system orientation

  • nly)
  • 2. Rotate (rectify) the left camera so that the epipole

is at infinity

  • 3. Rotate (rectify) the right camera so that the

epipole is at infinity

  • 4. Adjust the scale
slide-34
SLIDE 34

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-35
SLIDE 35

rotate by R

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-36
SLIDE 36

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-37
SLIDE 37

rotate by Rrect rotate by Rrect

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-38
SLIDE 38

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-39
SLIDE 39

scale by H scale by H

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-40
SLIDE 40

1. Compute E to get R 2. Rotate right image by R 3. Rotate both images by Rrect 4. Scale both images by H

Stereo Rectification:

slide-41
SLIDE 41

What can we do after rectification?

slide-42
SLIDE 42

Setting the epipole to infinity


(Building Rrect from e)

Let r1 = e1 = T ||T|| Rrect =   r>

1

r>

2

r>

3

  r2 = 1 q T 2

x + T 2 y

⇥ −Ty Tx 0 ⇤ r3 = r1 × r2

epipole coincides with translation vector cross product of e and the direction vector of the optical axis

  • rthogonal vector

Given:

epipole e (using SVD on E) (translation from E)

slide-43
SLIDE 43

Rrecte1 =   r>

1 e1

r>

2 e1

r>

3 e1

  =   ? ? ?   r1 = e1 = T ||T|| If and r2 r3

  • rthogonal

then

slide-44
SLIDE 44

Rrecte1 =   r>

1 e1

r>

2 e1

r>

3 e1

  =   1   r1 = e1 = T ||T|| If and r2 r3

  • rthogonal

then Where is this point located on the image plane?

slide-45
SLIDE 45

Rrecte1 =   r>

1 e1

r>

2 e1

r>

3 e1

  =   1   r1 = e1 = T ||T|| If and r2 r3

  • rthogonal

then Where is this point located on the image plane? At x-infinity

slide-46
SLIDE 46

Stereo Rectification Algorithm

  • 1. Estimate E using the 8 point algorithm (SVD)
  • 2. Estimate the epipole e (SVD of E)
  • 3. Build Rrect from e
  • 4. Decompose E into R and T
  • 5. Set R1=Rrect and R2 = RRrect
  • 6. Rotate each left camera point (warp image) 


[x’ y’ z’] = R1 [x y z]

  • 7. Rectified points as p = f/z’[x’ y’ z’]
  • 8. Repeat 6 and 7 for right camera points using R2
slide-47
SLIDE 47

Stereo Rectification Algorithm

  • 1. Estimate E using the 8 point algorithm
  • 2. Estimate the epipole e (solve Ee=0)
  • 3. Build Rrect from e
  • 4. Decompose E into R and T
  • 5. Set R1=Rrect and R2 = RRrect
  • 6. Rotate each left camera point x’~ Hx where H = KR1


*You may need to alter the focal length (inside K) to keep points within the

  • riginal image size
  • 7. Repeat 6 and 7 for right camera points using R2
slide-48
SLIDE 48

Unrectified

slide-49
SLIDE 49

Unrectified Rectified

slide-50
SLIDE 50

Unrectified Rectified