introduction to computer vision 3d vision topic 9 stereo vision (i) cmpsci 591a/691a cmpsci 570/670

36
Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Post on 20-Dec-2015

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision 3D Vision3D Vision

Topic 9Stereo Vision (I)

CMPSCI 591A/691ACMPSCI 570/670

Page 2: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision 2D to 3D Inference2D to 3D Inference

Observations Objects are mostly 3D Images are 2D arrays of intensity, color values, etc. 3D depth information is not explicitly encoded in images (it is explicitly recorded in range images)

However, 2D analysis implicitly uses 3D info 3D structures are generally not random

coherency in motion Man-made objects are of regular shapes and boundaries

straight lines and smooth curves in images Explicit 3D information can be recovered using 2D shape cues

disparities in stereo shading change due to orientation texture gradient due to view point change etc.

Page 3: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision

View Images as “windows” into the 3D world

Page 4: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Shape Inference TechniquesShape Inference Techniques

Page 5: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision StereoStereo

The Stereo Problem Reconstruct scene geometry from two or more calibrated images

Basic Principle: Triangulation Gives reconstruction as intersection of two rays Requires point correspondence

This is the hard part

Page 6: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Stereo VisionStereo Vision

Problem Infer 3D structure of a scene from two or more images taken from

different viewpoints

Two primary Sub-problems Correspondence problem (stereo match) -> disparity map

Similarity instead of identity Occlusion problem: some parts of the scene are visible in one eye only

Reconstruction problem -> 3D What we need to know about the cameras’ parameters Often a stereo calibration problem

Lectures on Stereo Vision Stereo Geometry – Epipolar Geometry (*) Correspondence Problem (*) – Two classes of approaches 3D Reconstruction Problems – Three approaches

Page 7: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision A Stereo PairA Stereo Pair

Problems Correspondence problem (stereo match) -> disparity map Reconstruction problem -> 3D

CMU CIL Stereo Dataset : Castle sequencehttp://www-2.cs.cmu.edu/afs/cs/project/cil/ftp/html/cil-ster.html

?

3D?

Page 8: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision More Images…More Images…

Page 9: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision More Images…More Images…

Page 10: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision More Images…More Images…

Page 11: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision More Images…More Images…

Page 12: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision More Images…More Images…

Page 13: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Stereo ViewStereo View

Left View Right View

Disparity

Page 14: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Stereo DisparityStereo Disparity

The separation between two matching objects is called the stereo disparity.

Disparity is measured in pixels and can be positive or negative (conventions differ). It will vary across the image.

Page 15: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Disparity and DepthDisparity and Depth

If the cameras are pointing in the same direction, the geometry is simple. b is the baseline of the camera system, Z is the depth of the object, d is the disparity (left x minus right x) and f is the focal length of the cameras.

Then the unknown depth is given by

b

Z =f bd

Page 16: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Basic Stereo ConfigurationBasic Stereo Configuration

Page 17: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Parallel CamerasParallel Cameras

Disparity is inversely proportional to depth—so stereo is most accurate for close objects. Once we have found depth, the other coordinates in 3-D follow easily — e.g. taking either

one of the images:

where x is the image coordinate, and likewise for Y.

Page 18: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Converging CamerasConverging Cameras

This is the more realistic case. The depth at which the cameras converge, Z0, is

the depth at which objects have zero disparity. Finding Z0 is part of stereo calibration.

Closer objects have convergent disparity (numerically positive) and further objects have divergent disparity (numerically negative).

Object at depth Z

Page 19: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision The Correspondence ProblemThe Correspondence Problem

To measure disparity, we first have to find corresponding points in the two images.

This turns out not to be easy. Our own visual systems can match at a low level, as shown by

random-dot stereograms, in which the individual images have no structure above pixel scale, but which when fused show a clear 3-D shape.

Page 20: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Stereo MatchingStereo Matching

Stereo matchers need to start from some assumptions. Corresponding image regions are similar. A point in one image may only match a single point in the other image. If two matched features are close together in the images, then in most casestheir disparities will

be similar, because the environment is made of continuous surfaces separated by boundaries. Many matching methods exist. The basic distinction is between

feature-based methods which start from image structure extracted by preprocessing; and correlation-based methods which start from individual grey-levels.

Page 21: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Feature Based MethodsFeature Based Methods

Extract feature descriptions: regions, lines, ….

Pick a feature in the left image. Take each feature in the right image in turn (or just those close to the epipolar line), and

measure how different it is from the original feature:

Size,aspect ratio,average grey leveletc.

Page 22: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Feature-Based MethodsFeature-Based Methods

S is a measure of similarity w0 etc. are weights, and the other symbols are different measures of the feature in the right and left images,

such as length, orientation, average grey level and so on. Choose the right-image feature with the largest value of S as the best match for

the original left-image feature. Repeat starting from the matched feature in the right image, to see if we achieve

consistency.

Page 23: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Feature Based MethodsFeature Based Methods

It is possible to use very simple features (just points, in effect) if the constraint that the disparity should vary smoothly is taken into account.

Feature-based methods give a sparse set of disparities — disparities are only found at feature positions.

Page 24: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Correlation Based MethodsCorrelation Based Methods

Take a small patch of the left image as a mask and convolve it with the part of the right image close to the epipolar line. Over an area

The peak of the convolution output gives the position of the matching area of the right image, and hence the disparity of the best match.

Page 25: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision

section of leftimage convolve

Convolution peak at position of corresponding patch in right image

Correlation-Based MethodsCorrelation-Based Methods

Convolution-based methods can give a dense set of disparities — disparities are found for every pixel.

These methods can be very computationally intensive, but can be done efficiently on parallel hardware.

Where to search?

Page 26: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Stereo CorrespondenceStereo Correspondence

Epipolar Constraint Reduces correspondence problem to 1D search along conjugate epipolar lines

Stereo rectification: make epipolar lines horizontal

Page 27: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Correspondence DifficultiesCorrespondence Difficulties

Why is the correspondence problem difficult? Some points in each image will have no corresponding points

in the other image.(1) the cameras might have different fields of view.

(2) due to occlusion.

A stereo system must be able to determine the image parts that should not be matched.

Page 28: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision VariationsVariations Scale-space. Methods that exploit scale-space can be very powerful.

Smooth the image using Gaussian kernels Match each feature with the nearest one in the other image — location will be approximate because

of blurring. Use the disparities found to guide the search for matches in a less smoothed image.

Relaxation. This is important in the context of neural modelling. Set up possible feature matches in a network. Construct an energy function that captures the constraints of the problem. Make incremental changes to the matches so that the energy is steadily reduced.

Page 29: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision

Very precise stereo systems can be made to estimate disparity at sub-pixel accuracies. This is important for industrial inspection and mapping from aerial and satellite images.

In controlled environments, structured light (e.g. stripes of light) can be used to provide easy matches for a stereo system.

Other Aspects of StereoOther Aspects of Stereo

Page 30: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Structured LightStructured Light

Structured lighting Feature-based methods are not applicable when the objects have

smooth surfaces (i.e., sparse disparity maps make surface reconstruction difficult).

Patterns of light are projected onto the surface of objects, creating interesting points even in regions which would be otherwise smooth.

Finding and matching such points is simplified by knowing the geometry of the projected patterns.

Page 31: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision

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

Stanford’s Digital Michaelangelo ProjectStanford’s Digital Michaelangelo Project

maximum height of gantry: 7.5 metersweight including subbase: 800 kilograms

Page 32: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer VisionStanford’s Digital Michaelangelo ProjectStanford’s Digital Michaelangelo Project

480 individually aimed scans2 billion polygons7,000 color images32 gigabytes30 nights of scanning1,080 man-hours22 people

Page 33: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Correspondence ProblemsCorrespondence Problems

Which point matches with which point?

Page 34: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision DifficultiesDifficulties

Multiple matches are always likely Simple features (e.g., black dots)

large number of potential matches precise disparity

Complex features (e.g., polygons) small number of potential matches less precise disparity

Page 35: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Trinocular StereoTrinocular Stereo

From H. G. Wells, War of the Worlds

Page 36: Introduction to Computer Vision 3D Vision Topic 9 Stereo Vision (I) CMPSCI 591A/691A CMPSCI 570/670

Introduction to

Computer Vision Three Camera StereoThree Camera Stereo

A powerful way of eliminate spurious matches Hypothesize matches between A & B Matches between A & C on green epipolar line Matches between B & C on red epipolar line There better be something at the intersection