Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical...

84
Fundamentals of Stereo Vision Michael Bleyer LVA Stereo Vision

Transcript of Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical...

Page 1: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Fundamentals of Stereo Vision

Michael BleyerLVA Stereo Vision

Page 2: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

What Happened Last Time?

Human 3D perception (3D cinema)Computational stereo• Intuitive explanation of what is meant by disparity• Stereo matching problem

Various applications of stereo

Page 3: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

What Is Going to Happen Today?

Stereo from a technical point of view:• Stereo pipeline• Epipolar geometry• Epipolar rectification• Depth via triangulation

Challenges in stereo matchingCommonly used assumptionsMiddlebury stereo benchmark

Page 4: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Michael BleyerLVA Stereo Vision

Stereo from a Technical

Point of View

Page 5: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Stereo Pipeline

EpipolarRectification

Stereo Matching

Depth via Triangulation

Left Image Right Image

Rectified Right ImageRectified Left Image

Disparity Map

3D Scene Reconstruction

Page 6: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Stereo Pipeline

EpipolarRectification

Stereo Matching

Depth via Triangulation

Left Image Right Image

Rectified Right ImageRectified Left Image

Disparity Map

3D Scene Reconstruction

Discussed in this session

Page 7: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Stereo Pipeline

EpipolarRectification

Stereo Matching

Depth via Triangulation

Left Image Right Image

Rectified Right ImageRectified Left Image

Disparity Map

3D Scene Reconstruction

Discussed in this and all other sessions

Page 8: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Stereo Pipeline

Stereo Matching

Depth via Triangulation

Left Image Right Image

Rectified Right ImageRectified Left Image

Disparity Map

3D Scene Reconstruction

EpipolarRectification

Let us start here

Page 9: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Pinhole Camera

Simplest model for describing the projection of a 3D scene onto a 2D image.Model is commonly used in computer vision.

Focal Point

Image Plane

Page 10: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Image Formation Process

Let us assume we have a pinhole camera.The pinhole camera is characterized by its focal point Cland its image plane L.

Page 11: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Image Formation Process

We also have a second pinhole camera <Cr,R>.We assume that the camera system is fully calibrated, i.e. the 3D positions of <Cl, L> and <Cr,R> are known.

Page 12: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Image Formation Process

We have a 3D point P.

Page 13: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Image Formation Process

We compute the 2D projection pl of P onto the image plane of the left camera L by intersecting the ray from Cl to P with the plane L.This is what is happening when you take a 2D image of a 3D scene with your camera (image formation process).

Page 14: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Image Formation Process

We compute the 2D projection pl of P onto the image plane of the left camera L by intersecting the ray from Cl to P with the plane L.This is what is happening when you take a 2D image of a 3D scene with your camera (image formation process).

Nice, but actually we want to do exactly the opposite: “We have a 2D image and want to make 

it 3D.”

Page 15: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

3D Reconstruction

Task: We have a 2D point pl and want to compute its 3D position P.

Page 16: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

3D Reconstruction

P has to lie on the ray of Cl to pl.Problem: It can lie anywhere on this ray.

Page 17: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

3D Reconstruction

Let us assume we also know the 2D projection pr of P onto the right image plane R.

Page 18: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

3D Reconstruction

P can now be reconstructed by intersecting the rays Clpl and Crpr.

Page 19: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

3D Reconstruction

P can now be reconstructed by intersecting the rays Clpl and Crpr.

The challenging part is to find the pair of 

corresponding pixels pl and pr that are projections of the same 3D point P = 

Stereo Matching Problem

Page 20: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

3D Reconstruction

P can now be reconstructed by intersecting the rays Clpl and Crpr.

Problem: Given pl, the corresponding pixel pr can lie at any x‐ and y‐coordinate in 

the right image.

Can we make the search easier?

Page 21: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

We have stated that P has to lie on the ray Clpl.

Page 22: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

If we project each candidate 3D point onto the right image plane, we see that the all lie on a line in R.

Page 23: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

If we project each candidate 3D point onto the right image plane, we see that the all lie on a line in R.

Page 24: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

If we project each candidate 3D point onto the right image plane, we see that the all lie on a line in R.

Page 25: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

If we project each candidate 3D point onto the right image plane, we see that the all lie on a line in R.

Page 26: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

This line is called epipolar line of pl.

This epipolar line is the projection of the ray Clpl onto the right image plane R.The pixel pr is forced to lie on pl’s epipolar line.

Epipolar line of pl

Page 27: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Geometry

This line is called epipolar line of pl.

This epipolar line is the projection of the ray Clpl onto the right image plane R.The pixel pr is forced to lie on pl’s epipolar line.

Epipolar line of pl

To find the corresponding pixel, we only have to search along the epipolar line (1D 

instead of 2D search).

This search space restriction is known as epipolar constraint.

Page 28: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Rectification

Specifically interesting case:• Image plane L and R lie in a common plane.• X-axes are parallel to the baseline

Epipolar lines coincide with horizontal scanlines => corresponding pixels have the same y-coordinate

Baseline

X‐axis

Page 29: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Rectification

Specifically interesting case:• Image plane L and R lie in a common plane.• X-axes are parallel to the baseline

Epipolar lines coincide with horizontal scanlines => corresponding pixels have the same y-coordinate

Page 30: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Rectification

Specifically interesting case:• Image plane L and R lie in a common plane.• X-axes are parallel to the baseline

Epipolar lines coincide with horizontal scanlines => corresponding pixels have the same y-coordinate

Page 31: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Rectification

Specifically interesting case:• Image plane L and R lie in a common plane.• X-axes are parallel to the baseline

Epipolar lines coincide with horizontal scanlines => corresponding pixels have the same y-coordinate

Page 32: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Rectification

Specifically interesting case:• Image plane L and R lie in a common plane.• X-axes are parallel to the baseline

Epipolar lines coincide with horizontal scanlines => corresponding pixels have the same y-coordinate

To find the corresponding pixel, we only have to search along the horizontal 

scanline.

More convenient than tracing arbitrary epipolar lines.

The difference in x‐coordinates of corresponding pixels is called disparity

Page 33: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar RectificationThis special case can be achieved by reprojecting left and right images onto virtual cameras.This process is known as epipolarrectification.Throughout the rest of the lecture we assume that images have been rectified.

Original images – white lines represent epipolar lines

Rectified images – epipolar lines coincide with horizontal scanlines

Images taken from http://profs.sci.univr.it/~fusiello/rectif_cvol/node6.html

Page 34: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Epipolar Constraint – Concluding Remarks

Epipolar constraint should always be used, because:• 1D search is computationally faster than 2D

search.• Reduced search range lowers chance of finding a

wrong match (Quality of depth maps).• More or less the only constraint that will always be

valid in stereo matching (unless there are calibration errors).

Page 35: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Stereo Matching

EpipolarRectification

Stereo PipelineLeft Image Right Image

Rectified Right ImageRectified Right Image

Disparity Map

3D Scene Reconstruction

Let us for now assume that 

stereo matching has been solved and look at this point

Depth via Triangulation

Page 36: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via Triangulation

Page 37: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via Triangulation

Page 38: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via Triangulation

Similar Triangles:

fx

ZX l

=

Page 39: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via Triangulation

Similar Triangles:

fx

ZBX r

=−

Page 40: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via TriangulationFrom similar triangles:

Write X in explicit form:

Combine both equations:

Write Z in explicit form:

fx

ZX l

= fx

ZBX r

=−

dfB

xxfBZ

rl

.. =−

=

fxZX l.

= BfxZX r +=.

BfxZ

fxZ rl +=

..

fBxZxZ rl ... +=

fBxxZ rl .).( =−

This is disparity

Page 41: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via TriangulationFrom similar triangles:

Write X in explicit form:

Combine both equations:

Write Z in explicit form:

fx

ZX l

= fx

ZBX r

=−

dfB

xxfBZ

rl

.. =−

=

fxZX l.

= BfxZX r +=.

BfxZ

fxZ rl +=

..

fBxZxZ rl ... +=

fBxxZ rl .).( =−

This is disparity

Disparity and depth are inversely proportional!

Therefore, disparity is commonly used synonymously with depth.

Page 42: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Depth via Triangulation

EpipolarRectification

Stereo PipelineLeft Image Right Image

Rectified Right ImageRectified Right Image

Disparity Map

3D Scene Reconstruction

We will now focus on this problem 

(throughout the rest of the 

lecture)

Stereo Matching

Page 43: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Michael BleyerLVA Stereo Vision

Challenges in Stereo

Matching

Page 44: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Stereo Matching

Left 2D Image Right 2D Image

Disparity Map

Page 45: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Why is Stereo Matching Challenging? (1)Color inconsistencies:• When solving the stereo matching problem, we typically

assume that corresponding pixels have the same intensity/color (= Photo consistency assumption)

• That does not need to be true due to:− Image noise− Different illumination conditions in left and right images− Different sensor characteristics of the two cameras.− Specular reflections (mirroring)− Sampling artefacts− Matting artefacts

Page 46: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Why is Stereo Matching Challenging? (2)Untextured regions (Matching ambiguities)• There needs to be a certain amount of intensity/color variation

(i.e. texture) so that a pixel can be uniquely matched in the other view.

• Can you (as a human) depict depth if you are standing in front of a wall that is completely white?

Left image (no texture in the background)

Right image Computed disparity map (errors in background)

Page 47: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Why is Stereo Matching Challenging? (3)Occlusion Problem• There are pixels that are only visible in exactly one view.• We call this pixels occluded (or half-occluded)• It is difficult to estimate depth for these pixels.• Occlusion problem makes stereo more challenging than a lot of other computer

vision problems.

Occluded Pixel

Page 48: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

The Occlusion Problem

Let’s consider a simple scene composed of a foreground and a background object

Background Object Foreground 

Object

Page 49: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Regular case: • The white pixel P1 can be seen by both camera.

The Occlusion Problem

Page 50: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Occlusion in the right camera:• The left camera sees the grey pixel P2.• The ray from the right camera to P2 hits the white

foreground object => P2 cannot be seen by right camera.

The Occlusion Problem

Page 51: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

The Occlusion Problem

Occlusion in the left camera:• The right camera sees the grey pixel P3.• The ray from the left camera to P3 hits the white foreground

object => P3 cannot be seen by left camera.

Page 52: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

The Occlusion Problem

Occlusions occur in the proximity of disparity discontinuities.

Page 53: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Occlusions occur in the proximity of disparity discontinuities.

The Occlusion Problem

Occlusions occur as a consequence of discontinuities in depth.

They occur close object/depth boundaries.

They occur in both frames (symmetrical)

Page 54: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

In the left image, occlusions are located to the left of a disparity boundary.In the right image, occlusions are located to the right of a disparity boundary.

The Occlusion Problem

Left Image (Occlusions in red color)

Right Image (Occlusions in red color)

Page 55: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

It is difficult to find disparity in the matching point does not exist.Ignoring the occlusion problem leads to disparity artefacts near disparity borders.

The Occlusion Problem

Correct Disparity Map (Geometry of Left Image)

Computed Disparity Map (Occlusions Ignored)

Page 56: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

It is difficult to find disparity in the matching point does not exist.Ignoring the occlusion problem leads to disparity artefacts near disparity borders.

The Occlusion Problem

Correct Disparity Map (Geometry of Left Image)

Computed Disparity Map (Occlusions Ignored)

Disparity Artefacts to the left of depth boundaries

Page 57: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Michael BleyerLVA Stereo Vision

Commonly Used

Assumptions

Page 58: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

AssumptionsAssumptions are needed to solve the stereo matching problem.Stereo methods differ in• What assumptions they use• How they implement these assumptions

We have already learned two assumptions:• Which ones?

Page 59: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Photo Consistency and Epipolar Assumptions

Photo consistency assumption:• Corresponding pixels have the same intensity/color in both

images.

Epipolar assumption:• The matching point of a pixel has to lie on the same horizontal

scanline in the other image.

We can combine both assumptions to obtain our first stereo algorithm.Algorithm 1:• For each pixel p of the left image, search the pixel q in the right

image that− lies on the same y-coordinate as p (Epipolar assumption) and− has the most similar color in comparison to p (Photo Consistency).

Page 60: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Results of Algorithm 1

Quite disappointing, why?We have posed the following task:• I have a red pixel. Find me a red pixel in the other image.

Problem:• There are usually many red pixels in the other image (ambiguity)

We need additional assumptions.

Left Image Computed Disparity Map

Page 61: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Results of Algorithm 1

What is the most obvious difference between the correct and the computed disparity maps?

Correct Disparity Map Computed Disparity Map

Page 62: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Smoothness Assumption (1)Observation:• A correct disparity map typically consists of regions of

constant (or very similar) disparity. For example, lamp, head, table,…

We can give this apriori knowledge to a stereo algorithm in the form of a smoothness assumption

Correct Disparity MapLeft Image

Page 63: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Smoothness Assumption (2)Smoothness assumption:• Spatially close pixels have the same (or similar) disparity.• (By spatially close I mean pixels of similar image

coordinates.)

Smoothness assumption typically holds true almost everywhere, except at disparity borders.

Regions where smoothness assumption is valid

Regions where smoothness assumption is not valid

Page 64: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Smoothness Assumption (3)Almost every stereo algorithm uses the smoothness assumption.Stereo algorithms are commonly divided into two categories based on the form in which they apply the smoothness assumption.These categories are:• Local methods• Global methods

Page 65: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Local Methods

Compare small windows in left and right images.Within the window, pixels are supposed to have the same disparity => implicit smoothness assumption.We will learn a lot about them in the next session.

(a) Left image (b) Right image

Find point of maximum

correspondence

Compare colorvalues within

search windows

Page 66: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Global MethodsDefine a cost function to measure the quality of a disparity map:• High costs mean that the disparity map is bad.• Low costs mean it is good.

Costs function is typically in the form of:

where−Edata measures photo consistency−Esmooth measures smoothness

Global methods express smoothness assumption in an explicit form (as a smoothness term).The challenge is to find a disparity map of minimum costs (sessions 4 and 5).

smoothdata EEE +=

Page 67: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Uniqueness ConstraintThe uniqueness constraint will help us to handle the occlusion problem.It states:• A pixel in one frame has at most a single matching point in the

other frame.

In general valid, but broken for:• Transparent objects• Slanted surfaces

Page 68: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Uniqueness Constraint

Left Pixel

Occluding Object

0 Matching Points 

Page 69: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Uniqueness Constraint

Left Pixel 1 Matching Points 

Page 70: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Uniqueness Constraint

Left Pixel 2 Matching Points 

Page 71: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Uniqueness Constraint

Left Pixel 2 Matching Points 

If we assume objects to be opaque (non‐transparent), this case cannot 

occur

Page 72: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Other AssumptionsOrdering assumption:• The order in which pixels occur is preserved in both images.• Does not hold for thin foreground object.

Disparity gradient limit:• Originates from psychology• Not clear whether assumption is valid for arbitrary camera

setups.

Both assumptions have rarely been used recently => they are slightly obsolete.

Page 73: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Michael BleyerLVA Stereo Vision

Middlebury Stereo

Benchmark

Page 74: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Ground Truth Data

Ground truth = the correct solution to a given problem.The absence of ground truth data has represented a major problem in computer vision:• For most computer vision problems, not a single “real” test

image with ground truth solution has been available.• Computer-generated ground truth images do oftentimes not

reflect the challenges of real data recorded with a camera.• It is difficult to measure the progress in a field if there is no

commonly agreed data set with ground truth solution.

Left image Right image Ground truth disparities

Page 75: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Ground Truth Data

Ground Truth data is now available for a wide range of computer vision problems including:• Object recognition• Alpha matting• Optical flow• MRF-optimization• Multi view reconstruction• …

For stereo, ground truth data is available on the Middlebury Stereo Evaluation website http://vision.middlebury.edu/stereo/The Middlebury set is widely adopted in the stereo community.

Page 76: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

The Middlebury Set

Page 77: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

How Can One Generate Ground Truth Disparities?

Hand labelling:• Tsukuba test set• Extremely labor-intensive

Most other Middlebury ground truth disparity maps have been created using a more precise depth computation technique than stereo matching, namely structured light.

Tsukuba test set –disparity map

Page 78: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Setup Used for Generating the Middlebury Images

Different light patterns are projected onto the scene to compute a high-quality depth map (Depth from structured light).

Page 79: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Setup Used for Generating the Middlebury Images

Different light patterns are projected onto the scene to compute a high-quality depth map (Depth from structured light).

We are currently looking for students who shall set up a similar ground truth 

systems.

Tell me if you are interested.

Page 80: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Disparity Map Quality Evaluation in the Middlebury Benchmark

Estimation of wrong pixels:• Build absolute difference between computed and ground truth

disparity maps.• If absolute disparity difference is larger than one pixel, pixel is

counted as error.

3 Error metrics:• Percentage of erroneous pixels in (1) unoccluded regions, (2) the

whole image and (3) in regions close to disparity borders.

Ground truth disparity mapGround truth disparity map Error map (Pixels having an absolute disparity error

> 1 px)

Page 81: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

The Middlebury Online Benchmark

If you have implemented a stereo algorithm, you can evaluate its performance using the Middlebury benchmark.You have to run it on these 4 image pairs:

The 3 error metrics are then computed for each image pair.Your algorithm is then ranked according to the computed error values.

Page 82: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

The Middlebury Table

Currently, more than 70 methods evaluated.You should use this table to rank your stereo matching algorithm developed as your home work.

Man

y more

Page 83: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

General Findings in the Middlebury Table

Global methods outperform local methods.Local methods:• Adaptive weight methods represent the state-of-the-art.

Global methods:• Methods that apply Belief Propagation or Graph-Cuts in the

optimization step outperform dynamic programming methods (if such categorization makes sense)

All top-performing methods apply color segmentation.

Page 84: Fundamentals of Stereo Vision - TU Wien · What Is Going to Happen Today? Stereo from a technical point of view: • Stereo pipeline • Epipolar geometry • Epipolar rectification

Summary

3D geometryChallenges• Ambiguity• Occlusions

Assumptions• Photo consistency• Smoothness assumption• Uniqueness assumption

Middlebury benchmark