37

Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

Embed Size (px)

Citation preview

Page 1: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010
Page 2: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

Lecture 12Lecture 12 Stereo Reconstruction IIStereo Reconstruction II

Mata kuliah : T0283 - Computer VisionTahun : 2010

Page 3: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 3

Learning ObjectivesLearning Objectives

After carefullyAfter carefully listening this lecture, students will listening this lecture, students will be able to do the following :be able to do the following :

demonstrate 3D stereo computation by solving demonstrate 3D stereo computation by solving point-point- correspondence problems and correspondence problems and fundamentalfundamental matrix.matrix.

Calculate object-depth information using Calculate object-depth information using disparity and disparity and triangulation techniquestriangulation techniques

Page 4: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 4

An algorithm for stereo An algorithm for stereo reconstructionreconstruction

1. For each point in the first image determine the corresponding point in the second image

(this is a search problem)

2. For each pair of matched points determine the 3D point by triangulation

(this is an estimation problem)

Page 5: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 5

Epipolar lineEpipolar line

Epipolar constraint• Reduces correspondence problem to 1D

search along an epipolar line

Page 6: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 6

Algebraic representation of epipolar Algebraic representation of epipolar geometrygeometryWe know that the epipolar geometry defines a We know that the epipolar geometry defines a mappingmapping

x l/

point in first image

epipolar line in second

image• the map only depends on the cameras P, P/ (not on structure)

• it will be shown that the map is linear and can be written as

Page 7: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 7

Stereo correspondence algorithms

Page 8: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 8

Problem statementProblem statement

GivenGiven:: two images and their associated cameras two images and their associated cameras computecompute

corresponding image points.corresponding image points.

Algorithms may be classified into two types:Algorithms may be classified into two types:

1.1. Dense:Dense: compute a correspondence at every pixel compute a correspondence at every pixel

2.2. Sparse:Sparse: compute correspondences only for features compute correspondences only for features

The methods may be top down or bottom upThe methods may be top down or bottom up

Page 9: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 9

Top down matching Top down matching

1. Group model (house, windows, etc) independently in each image

2. Match points (vertices) between images

Page 10: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 10

Bottom up matchingBottom up matching• epipolar geometry reduces the correspondence search from 2D to a 1D search on corresponding epipolar lines

• 1D correspondence problem

b/

a/

bca

CBA

c/

Page 11: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 11

Example image pair – parallel Example image pair – parallel camerascameras

Page 12: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 12

First imageFirst image

Page 13: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 13

Second imageSecond image

Page 14: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 14

Dense correspondence algorithmDense correspondence algorithm

Search problem (geometric constraint): for each point in the left image, the corresponding point in the right image lies on the epipolar line (1D ambiguity)

Disambiguating assumption (photometric constraint): the intensity neighbourhood of corresponding points are similar across images

Measure similarity of neighbourhood intensity by cross-correlation

Parallel camera example – epipolar lines are corresponding rasters

epipolar line

Page 15: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 15

Intensity profiles

• Clear correspondence between intensities, but also noise and ambiguity

Page 16: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 16

Normalized Cross CorrelationNormalized Cross Correlation

region A region B

vector a vector b

write regions as vectors

a

b

Page 17: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 17

Cross-correlation of neighbourhood Cross-correlation of neighbourhood regionsregions

epipolar line

Page 18: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 18

left image bandright image band

cross correlation

1

0

0.5

x

Page 19: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 19

left image band

right image band

cross correlation

1

0

x

0.5

target region

Page 20: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 20

Why is cross-correlation such a poor measure in the second case?

1. The neighborhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

front-parallel surfaceimaged length the

same

slanting surfaceimaged lengths differ

Page 21: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 21

Limitations of similarity constraintLimitations of similarity constraint

Textureless surfaces Occlusions, repetition

Non-Lambertian surfaces, specularities

Page 22: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 22

Results with window searchResults with window search

Window-based matching Ground truth

Data

Page 23: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 23

Sketch of a dense correspondence Sketch of a dense correspondence algorithmalgorithm

For each pixel in the left imageFor each pixel in the left imageccompute the neighbourhood cross correlation ompute the neighbourhood cross correlation along the corresponding epipolar line in the right along the corresponding epipolar line in the right imageimagetthe corresponding pixel is the one with the he corresponding pixel is the one with the highest cross correlationhighest cross correlation

ParametersParameterssize (scale) of neighbourhoodsize (scale) of neighbourhoodsearch disparity search disparity

Other constraintsOther constraintsuniquenessuniquenessorderingorderingssmoothmoothness ofness of disparity field disparity field

ApplicabilityApplicabilitytextured scene, largely fronto-paralleltextured scene, largely fronto-parallel

Page 24: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 24

Example dense correspondence algorithm

left image right image

Page 25: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 25

3D Reconstruction

intensity = depthright image depth map

Page 26: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 26

range map

Pentagon exampleleft image right image

Page 27: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 27

RectificationRectification

e e /

For converging cameras epipolar lines are not paralle

Page 28: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 28

Project images onto plane parallel to baseline

epipolar plane

Page 29: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 29

Rectification continuedRectification continued

Convert converging cameras to parallel camera geometry by an image mapping

Image mapping is a 2D homography (projective transformation)

Page 30: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 30

Example original stereo pair

rectified stereo pair

Page 31: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 31

Note• image movement (disparity) is inversely proportional to depth Z • depth is inversely proportional to disparity

Example: depth and disparity for a parallel camera stereo rig

Then, y/ = y, and the disparity

Derivation

x

x /d

Page 32: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 32

TriangulationTriangulation

Page 33: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 33

Problem statementProblem statementGiven:Given: corresponding measured (i.e. noisy) points corresponding measured (i.e. noisy) points x x and and xx// , and cameras (exact) P and P , and cameras (exact) P and P//, compute the 3D point , compute the 3D point XX

Problem: in the presence of noise, back projected rays do not intersect

rays are skew in space

Measured points do not lie on corresponding epipolar lines

C C /

x x /

Page 34: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 34

1. Vector solution1. Vector solution

C C /

Compute the mid-point of the shortest line between the two rays

Page 35: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 35

2. Linear triangulation (algebraic solution)2. Linear triangulation (algebraic solution)

Page 36: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 36

Page 37: Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T0283 - Computer Vision Tahun: 2010

January 20, 2010 T0283 - Computer Vision 37

3. Minimizing a geometric/statistical error3. Minimizing a geometric/statistical error