Top Banner
Review • Previous section: – Feature detection and matching – Model fitting and outlier rejection
53

Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Review

• Previous section:– Feature detection and matching– Model fitting and outlier rejection

Page 2: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Project 2 questions?

Page 3: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Review: Interest points

• Keypoint detection: repeatable and distinctive– Corners, blobs, stable regions– Harris, DoG, MSER

Page 4: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Harris Detector [Harris88]

• Second moment matrix

)()(

)()()(),( 2

2

DyDyx

DyxDxIDI III

IIIg

4

1. Image derivatives

2. Square of derivatives

3. Gaussian filter g(I)

Ix Iy

Ix2 Iy

2 IxIy

g(Ix2) g(Iy

2) g(IxIy)

222222 )]()([)]([)()( yxyxyx IgIgIIgIgIg

])),([trace()],(det[ 2DIDIhar

4. Cornerness function – both eigenvalues are strong

har5. Non-maxima suppression

1 2

1 2

det

trace

M

M

(optionally, blur first)

Page 5: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Review: Local Descriptors

• Most features can be thought of as templates, histograms (counts), or combinations

• Most available descriptors focus on edge/gradient information– Capture texture information– Color rarely used

K. Grauman, B. Leibe

Page 6: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

x

y

b

m

x

y m3 5 3 3 2 2

3 7 11 10 4 3

2 3 1 4 5 2

2 1 0 1 3 3

bSlide from S. Savarese

Review: Hough transform

Page 7: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Review: RANSAC

14INAlgorithm:

1. Sample (randomly) the number of points required to fit the model (#=2)2. Solve for model parameters using samples 3. Score by the fraction of inliers within a preset threshold of the model

Repeat 1-3 until the best model is found with high confidence

Page 8: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Review: 2D image transformations

Szeliski 2.1

Page 9: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

CS143, Brown

James Hays

Stereo:Epipolar geometry

Slides by Kristen Grauman

Page 10: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Multiple views

Hartley and Zisserman

Lowestereo visionstructure from motionoptical flow

Page 11: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Why multiple views?• Structure and depth are inherently ambiguous from

single views.

Images from Lana Lazebnik

Page 12: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Why multiple views?• Structure and depth are inherently ambiguous from

single views.

Optical center

P1P2

P1’=P2’

Page 13: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

• What cues help us to perceive 3d shape and depth?

Page 14: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Shading

[Figure from Prados & Faugeras 2006]

Page 15: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Focus/defocus

[figs from H. Jin and P. Favaro, 2002]

Images from same point of view, different camera parameters

3d shape / depth estimates

Page 16: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Texture

[From A.M. Loh. The recovery of 3-D structure using visual texture patterns. PhD thesis]

Page 17: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Perspective effects

Image credit: S. Seitz

Page 18: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Motion

Figures from L. Zhang http://www.brainconnection.com/teasers/?main=illusion/motion-shape

Page 19: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Occlusion

Rene Magritt'e famous painting Le Blanc-Seing (literal translation: "The Blank Signature") roughly translates as "free hand" or "free rein".

Page 20: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Estimating scene shape

• “Shape from X”: Shading, Texture, Focus, Motion…

• Stereo: – shape from “motion” between two views– infer 3d shape of scene from two (multiple)

images from different viewpoints

scene pointscene point

optical centeroptical center

image planeimage plane

Main idea:

Page 21: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Outline

• Human stereopsis

• Stereograms

• Epipolar geometry and the epipolar constraint

– Case example with parallel optical axes

– General case with calibrated cameras

Page 22: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Human eye

Fig from Shapiro and Stockman

Pupil/Iris – control amount of light passing through lens

Retina - contains sensor cells, where image is formed

Fovea – highest concentration of cones

Rough analogy with human visual system:

Page 23: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Human stereopsis: disparity

Human eyes fixate on point in space – rotate so that corresponding images form in centers of fovea.

Page 24: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Disparity occurs when eyes fixate on one object; others appear at different visual angles

Human stereopsis: disparity

Page 25: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Random dot stereograms

• Julesz 1960: Do we identify local brightness patterns before fusion (monocular process) or after (binocular)?

• To test: pair of synthetic images obtained by randomly spraying black dots on white objects

Page 26: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Random dot stereograms

Forsyth & Ponce

Page 27: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Random dot stereograms

Page 28: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Random dot stereograms

• When viewed monocularly, they appear random; when viewed stereoscopically, see 3d structure.

• Conclusion: human binocular fusion not directly associated with the physical retinas; must involve the central nervous system

• Imaginary “cyclopean retina” that combines the left and right image stimuli as a single unit

• High level scene understanding not required for Stereo

Page 29: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Stereo photography and stereo viewers

Invented by Sir Charles Wheatstone, 1838 Image from fisher-price.com

Take two pictures of the same subject from two slightly different viewpoints and display so that each eye sees only one of the images.

Page 30: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

http://www.johnsonshawmuseum.org

Page 31: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

http://www.johnsonshawmuseum.org

Page 32: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

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

Page 33: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

http://www.well.com/~jimg/stereo/stereo_list.html

Page 34: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Autostereograms

Images from magiceye.com

Exploit disparity as depth cue using single image.

(Single image random dot stereogram, Single image stereogram)

Page 35: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Images from magiceye.com

Autostereograms

Page 36: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Estimating depth with stereo

• Stereo: shape from “motion” between two views

• We’ll need to consider:• Info on camera pose (“calibration”)• Image point correspondences

scene pointscene point

optical optical centercenter

image planeimage plane

Page 37: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Two cameras, simultaneous views

Single moving camera and static scene

Stereo vision

Page 38: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Camera parameters

Camera frame 1

Intrinsic parameters:Image coordinates relative to camera Pixel coordinates

Extrinsic parameters:Camera frame 1 Camera frame 2

Camera frame 2

• Extrinsic params: rotation matrix and translation vector

• Intrinsic params: focal length, pixel sizes (mm), image center point, radial distortion parameters

We’ll assume for now that these parameters are given and fixed.

Page 39: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Outline

• Human stereopsis

• Stereograms

• Epipolar geometry and the epipolar constraint

– Case example with parallel optical axes

– General case with calibrated cameras

Page 40: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Geometry for a simple stereo system

• First, assuming parallel optical axes, known camera parameters (i.e., calibrated cameras):

Page 41: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

baseline

optical center (left)

optical center (right)

Focal length

World point

image point (left)

image point (right)

Depth of p

Page 42: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

• Assume parallel optical axes, known camera parameters (i.e., calibrated cameras). What is expression for Z?

Similar triangles (pl, P, pr) and (Ol, P, Or):

Geometry for a simple stereo system

Z

T

fZ

xxT rl

lr xx

TfZ

disparity

Page 43: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Depth from disparity

image I(x,y) image I´(x´,y´)Disparity map D(x,y)

(x´,y´)=(x+D(x,y), y)

So if we could find the corresponding points in two images, we could estimate relative depth…

Page 44: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Basic stereo matching algorithm

• If necessary, rectify the two stereo images to transform epipolar lines into scanlines

• For each pixel x in the first image– Find corresponding epipolar scanline in the right image– Examine all pixels on the scanline and pick the best match x’– Compute disparity x-x’ and set depth(x) = fB/(x-x’)

Page 45: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Matching cost

disparity

Left Right

scanline

Correspondence search

• Slide a window along the right scanline and compare contents of that window with the reference window in the left image

• Matching cost: SSD or normalized correlation

Page 46: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Left Right

scanline

Correspondence search

SSD

Page 47: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Left Right

scanline

Correspondence search

Norm. corr

Page 48: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Effect of window size

W = 3 W = 20

• Smaller window+ More detail– More noise

• Larger window+ Smoother disparity maps– Less detail

Page 49: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Failures of correspondence search

Textureless surfaces Occlusions, repetition

Non-Lambertian surfaces, specularities

Page 50: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Results with window search

Window-based matching Ground truth

Data

Page 51: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

How can we improve window-based matching?

• So far, matches are independent for each point

• What constraints or priors can we add?

Page 52: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Summary• Depth from stereo: main idea is to triangulate from

corresponding image points.• Epipolar geometry defined by two cameras

– We’ve assumed known extrinsic parameters relating their poses

• Epipolar constraint limits where points from one view will be imaged in the other– Makes search for correspondences quicker

• Terms: epipole, epipolar plane / lines, disparity, rectification, intrinsic/extrinsic parameters, essential matrix, baseline

Page 53: Review Previous section: – Feature detection and matching – Model fitting and outlier rejection.

Coming up

– Stereo Algorithms– Structure from Motion