Binocular Stereo Take 2 images from different known viewpoints 1 - - PDF document

binocular stereo
SMART_READER_LITE
LIVE PREVIEW

Binocular Stereo Take 2 images from different known viewpoints 1 - - PDF document

Binocular Stereo Take 2 images from different known viewpoints 1 st calibrate Identify corresponding points between 2 images Derive the 2 lines on which world point lies Intersect 2 lines Public Library, Stereoscopic


slide-1
SLIDE 1

1

Binocular Stereo

  • Take 2 images from different known

viewpoints ⇒ 1st calibrate

  • Identify corresponding points between 2

images

  • Derive the 2 lines on which world point lies
  • Intersect 2 lines

Public Library, Stereoscopic Looking Room, Chicago, by Phillips, 1923

slide-2
SLIDE 2

2

slide-3
SLIDE 3

3

Stereo

  • Basic Principle: Triangulation

– Gives reconstruction as intersection of two rays – Requires

  • calibration
  • point correspondence
slide-4
SLIDE 4

4

Depth from Disparity

f u u’ baseline z C C’ X f

input image (1 of 2) [Szeliski & Kang ‘95] depth map 3D rendering

slide-5
SLIDE 5

5

Multi-View Geometry

  • Different views of a scene are not unrelated
  • Several relationships exist between two, three and

more cameras

  • Question: Given an image point in one image,

does this restrict the position of the corresponding image point in another image?

slide-6
SLIDE 6

6

Epipolar Geometry: Formalism

  • Depth can be reconstructed based on

corresponding points (disparity)

  • Finding corresponding points is hard &

computationally expensive

  • Epipolar geometry helps to significantly reduce

search from 2-D to 1-D line

Epipolar Geometry: Demo

Java Applet

http://www- sop.inria.fr/robotvis/personnel/sbougnou/Meta3DViewer/EpipolarGeo.html Sylvain Bougnoux, INRIA Sophia Antipolis

slide-7
SLIDE 7

7

  • Scene point P projects to image point pl =

(xl, yl, fl) in left image and point pr = (xr, yr, fr) in right image

  • Epipolar plane contains P, Ol, Or, pl and pr –

called co-planarity constraint

  • Given point pl in left image, its

corresponding point in right image is on line defined by intersection of epipolar plane defined by pl, Ol, Or and image Ir – called epipolar line of pl

  • In other words, pl and Ol define a ray where P

may lie; projection of this ray into Ir is the epipolar line

Marc Pollefeys, University of Leuven, Belgium, Siggraph 2001 Course

slide-8
SLIDE 8

8

Epipolar Line Geometry

  • Epipolar Constraint: The correct match

for a point pl is constrained to a 1D search along the epipolar line in Ir

  • All epipolar planes defined by all points in

Il contain the line Ol Or ⇒ All epipolar lines in Ir intersect at a point, er, called the epipole

  • Left and right epipoles, el and er, defined

by the intersection of line OlOr with the left and right images Il and Ir, respectively

slide-9
SLIDE 9

9

slide-10
SLIDE 10

10

Epipolar Geometry

Marc Pollefeys, University of Leuven, Belgium, Siggraph 2001 Course

Epipolar Geometry: Rectification

  • [Trucco 157-160]
  • Motivation: Simplify search for corresponding

points along scan lines (avoids interpolation and simplify sampling)

  • Technique: Image planes parallel -> pairs of

conjugate epipolar lines become collinear and parallel to image axis.

slide-11
SLIDE 11

11

Stereo Image Rectification

  • Image Reprojection

– reproject image planes onto common plane parallel to line between optical centers – a homography (3x3 transform) applied to both input images – pixel motion is horizontal after this transformation – C. Loop and Z. Zhang, Computing Rectifying Homographies for Stereo Vision, Computer Vision and Pattern Recognition Conf., 1999

Rectification

Marc Pollefeys, University of Leuven, Belgium, Siggraph 2001 Course

slide-12
SLIDE 12

12

Rectification Example

before after

Rectification Procedure

Given: Intrinsic and extrinsic parameters for 2 cameras

  • 1. Rotate left camera so that the epipole goes to

infinity along the horizontal axis ⇒ left image parallel to baseline

  • 2. Rotate right camera using same transformation
  • 3. Rotate right camera by R, the transformation of

the right camera frame with respect to the left camera

  • 4. Adjust scale in both cameras

Implement as backward transformations, and resample using bilinear interpolation

slide-13
SLIDE 13

13

  • Conjugate Epipolar Line: A pair of

epipolar lines in Il and Ir defined by P, Ol and Or

  • Conjugate (i.e., corresponding) Pair: A

pair of matching image points from Il and Ir that are projections of a single scene point

Definitions

slide-14
SLIDE 14

14

slide-15
SLIDE 15

15

slide-16
SLIDE 16

16

slide-17
SLIDE 17

17

slide-18
SLIDE 18

18

slide-19
SLIDE 19

19

slide-20
SLIDE 20

20

slide-21
SLIDE 21

21

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

Improvement: match windows

slide-22
SLIDE 22

22 stereo left image right image disparities

Stereo Correspondence

disparity = x1-x2 is inversely proportional to depth

3D scene structure recovery

(x1,y) (x2,y)

slide-23
SLIDE 23

23

Stereo Matching

  • Features vs. pixels?

– Do we extract features prior to matching?

Julesz-style Random Dot Stereogram

slide-24
SLIDE 24

24

Difficulties in Stereo Correspondence

2) Low texture: ? ? Perfect case:

never happens!

left image right image

1) Image noise:

slide-25
SLIDE 25

25

Local Approach

  • Look at one image patch

at at time

  • Solve many small

problems independently

  • Faster, less accurate

Global Approach

  • Look at the whole image
  • Solve one large problem
  • Slower, more accurate

How Difficult is Correspondence?

  • local works for high texture
  • enough texture in a patch to

disambiguate

high texture

  • global works up to medium

texture

  • propagates estimates from

textured to untextured regions

medium texture low texture

  • salient regions work up to low

texture

  • propagation fails; some regions

are inherently ambiguous, match

  • nly unambiguous regions

d i f f i c u l t y

slide-26
SLIDE 26

26

Local Approach [Levine’73]

left image right image

p

1

C 1

2

C 2

3

C 3

+ + +

2 2 2 2

=

Common C

p

d = i

which gives best

i

C

(SSD)

Fixed Window Size Problems

true disparities fixed small window fixed large window left image

need different window shapes

slide-27
SLIDE 27

27

Window Size

– Smaller window

+ –

– Larger window

+ –

W = 3 W = 20 Better results with adaptive window

  • T. Kanade and M. Okutomi, A Stereo

Matching Algorithm with an Adaptive Window: Theory and Experiment, Proc.

  • Int. Conf. Robotics and Automation,

1991

  • D. Scharstein and R. Szeliski. Stereo

matching with nonlinear diffusion, Int. J. Computer Vision, 28(2):155-174, 1998

  • Effect of window size

Sample Compact Windows [Veksler 2001]

slide-28
SLIDE 28

28

Comparison to Fixed Window

Veksler’s compact windows:16% errors

true disparities fixed small window: 33% errors fixed large window: 30% errors

1.67 0.53 1.69 2.79 1.00 1.79 1.52

Venus

0.33 1.61 3.36

Veksler’s var. windows

0.26 0.61 8.08

  • Multiw. Cut

2.39 0.42 1.86

Graph cuts

1.79 0.36 1.27

GC+occl.

0.84 0.98 1.15

Belief prop

0.31 1.30 1.94

Graph cuts

0.37 0.34 1.58

Layered

Map Sawtooth Tsukuba Algorithm

Results (% Errors)

a l l g l

  • b

a l

slide-29
SLIDE 29

29

Constraints

2) most nearby pixels should have similar disparity disparity continuous in most places except a few places: disparity discontinuity 1) corresponding pixels should be close in color p q

Additional geometric constraints for correspondence

  • Ordering of points:

Continuous surface: same order in both images.

  • Is that always true?

A B C A B C A B C A B C

slide-30
SLIDE 30

30 Forbidden Zone of M

Forbidden Zone

m1 m2 M N n1 n2

Practical applications:

– Object bulges out: ok – In general: ordering across whole image is not reliable feature – Use ordering constraints for neighbors of M within small neighborhood

  • nly
slide-31
SLIDE 31

31

slide-32
SLIDE 32

32

slide-33
SLIDE 33

33

slide-34
SLIDE 34

34

slide-35
SLIDE 35

35

slide-36
SLIDE 36

36

slide-37
SLIDE 37

37

slide-38
SLIDE 38

38

slide-39
SLIDE 39

39

Global Approach [Horn’81, Poggio’84, …]

encode desirable properties of d in E(d): ( ) ( )

( ) ( ) ( )

{ } { }

∑ ∑

Ρ ∈ Ν ∈ Ν ∈

+ =

p eighbors q , p q p p d

d , d P d M d E min arg

match pixels of similar color most nearby pixels have similar disparity

E(d)=E

p

d

q

d

r

d MAP-MRF 2

NP-hard problem ⇒ need approximations

slide-40
SLIDE 40

40

Stereo as Energy Minimization

  • Matching cost formulated as energy

– “data” term penalizing bad matches – “neighborhood term” encouraging spatial smoothness (continuity; disparity gradient)

) , ( ) , ( ) , , ( y d x y x d y x D + − = J I

similar) something (or d2 and d1 labels with pixels adjacent

  • f

cost ) , (

2 1 2 1

d d d d V − = =

∑ ∑

+ =

) 2 , 2 ( ), 1 , 1 ( 2 , 2 1 , 1 ) , ( ,

) , ( ) , , (

y x y x neighbors y x y x y x y x

d d V d y x D E

Minimization Methods

  • 1. Continuous d: Gradient Descent

– Gets stuck in local minimum

  • 2. Discrete d: Simulated Annealing

[Geman and Geman, PAMI 1984]

– Takes forever or gets stuck in local minimum

slide-41
SLIDE 41

41

Stereo as a Graph Problem [Boykov, 1999]

Pixels

Labels (disparities) d1 d2 d3

edge weight edge weight

) , , (

3

d y x D ) , (

1 1 d

d V

Graph Definition

d1 d2 d3

  • Initial state

– Each pixel connected to it’s immediate neighbors – Each disparity label connected to all of the pixels

slide-42
SLIDE 42

42

Stereo Matching by Graph Cuts

d1 d2 d3

  • Graph Cut

– Delete enough edges so that

  • each pixel is (transitively) connected to exactly one label node

– Cost of a cut: sum of deleted edge weights – Finding min cost cut equivalent to finding global minimum of the energy function

Graph Cuts

  • Solved in polynomial time w/ min-cut/max-flow
  • Boykov and Kolmogorov algorithm

– runs in seconds

Cut C

edges

  • Graph G=(V,E)
  • Edge weight w: E

R

  • Cost(C) = w(edge)
  • Problem: find min Cost cut

+

in C

slide-43
SLIDE 43

43

Results of Boykov’s Graph Cut Algorithm

Results

Boykov et al., Fast Approximate Energy Minimization via Graph Cuts,

  • Proc. Int. Conf. Computer Vision, 1999

Ground truth

Local: Compact Window Global: Expansion

18 sec 16% error 75 sec, 16% error 10 sec 0.33% error 33 sec, 0.35% error

5 = λ

100 = λ

high texture

12 sec, 3.36% error

medium texture

32 sec, 1.86% error,

20 = λ

slide-44
SLIDE 44

44

Difficulties

  • Parameter selection
  • Running time: from 34 to 86 seconds

( ) ( )

( ) ( ) ( )

{ } { }

∑ ∑

Ρ ∈ Ν ∈ Ν ∈

≠ δ λ + =

p q , p q p p

d d d M d E

smaller allows more discontinuities

λ

  • ptimal = 5

λ

  • ptimal = 20

λ

Computing a Multi-way Cut

  • With two labels: classical min-cut problem

– Solvable by standard network flow algorithms

  • polynomial time in theory, nearly linear in practice
  • More than 2 labels: NP-hard [Dahlhaus et al., STOC ‘92]

– But efficient approximation algorithms exist

  • Within a factor of 2 of optimal
  • Computes local minimum in a strong sense

– even very large moves will not improve the energy

  • Y. Boykov, O. Veksler and R. Zabih, Fast Approximate Energy

Minimization via Graph Cuts, Proc. Int. Conf. Computer Vision, 1999 – Basic idea

  • reduce to a series of 2-way-cut sub-problems, using one of:

– swap move: pixels with label L1 can change to L2, and vice- versa – expansion move: any pixel can change it’s label to L1

slide-45
SLIDE 45

45

State of the Art

Late 90’s state of the art Recent state of the art left image true disparities 5.23% errors 1.86% errors

Evaluation of Stereo Algorithms

http://bj.middlebury.edu/~schar/stereo/web/ results.php “A taxonomy and evaluation of dense two- frame stereo correspondence algorithms,”

  • Int. J. Computer Vision, 2002
slide-46
SLIDE 46

46

Algorithm Tsukuba Sawtooth Venus Map

Layered 1.58 0.34 1.52 0.37 Belief prop. 1.94 1.30 1.79 0.31 Graph cuts 1.15 0.98 1.00 0.84 GC+occl. 1.27 0.36 2.79 1.79 Graph cuts 1.86 0.42 1.69 2.39

  • Multiw. cut

8.08 0.61 0.53 0.26

  • Comp. win.

3.36 1.61 1.67 0.33 Realtime 4.25 1.32 1.53 0.81

  • Bay. diff.

6.49 1.45 4.00 0.20 SSD+MF 3.49 2.03 2.57 0.22 Cooperative 5.23 2.21 3.74 0.66

  • Stoch. diff.

3.95 2.45 2.45 1.31 Genetic 2.96 2.21 2.49 1.04 Pix-to-pix 5.12 2.31 6.30 0.50 Max flow 2.98 3.47 2.16 3.13

  • Scanl. opt.

5.08 4.06 9.44 1.84

  • Dyn. prog.

4.12 4.84 10.1 3.33 Shao 9.67 4.25 6.01 2.36 MMHM 9.76 4.76 6.48 8.42

  • Max. surf.

11.10 5.51 4.36 4.17

Database by D. Scharstein and R. Szeliski

% errors

slide-47
SLIDE 47

47

The Effect of Baseline on Depth Estimation

slide-48
SLIDE 48

48

1/z width of a pixel width of a pixel 1/z

pixel matching score

slide-49
SLIDE 49

49

slide-50
SLIDE 50

50

slide-51
SLIDE 51

51

Real-Time Stereo

  • Used for robot navigation (and other tasks)

– Several software-based real-time stereo techniques have been developed (most based on simple discrete search)

Nomad robot searches for meteorites in Antartica

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

– Camera calibration errors – Poor image resolution – Occlusions – Violations of brightness constancy (specular reflections) – Large motions – Low-contrast image regions

Stereo Reconstruction Pipeline

  • Steps

– Calibrate cameras – Rectify images – Compute disparity – Estimate depth

  • What will cause errors?
slide-52
SLIDE 52

52

Active Stereo with Structured Light

  • Project “structured” light patterns onto the object

– simplifies the correspondence problem

camera 2 camera 1 projector camera 1 projector

Li Zhang’s one-shot stereo

Laser Scanning

  • Optical triangulation

– Project a single stripe of laser light – Scan it across the surface of the object – This is a very precise version of structured light scanning

Direction of travel Object CCD CCD image plane Laser Cylindrical lens Laser sheet

Digital Michelangelo Project

http://graphics.stanford.edu/projects/mich/

slide-53
SLIDE 53

53

Portable 3D Laser Scanners

Minolta Vivid 910 can scan 300,000 points in 2.5 sec