cse 185 introduction to computer vision

29
CSE 185 Introduction to Computer Vision Feature Matching

Upload: eljah

Post on 18-Mar-2016

56 views

Category:

Documents


1 download

DESCRIPTION

CSE 185 Introduction to Computer Vision. Feature Matching. Feature matching. Correspondence: matching points, patches, edges, or regions across images. ≈. Keypoint matching. 1. Find a set of distinctive key- points. 2. Define a region around each keypoint. A 1. B 3. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CSE 185  Introduction to Computer Vision

CSE 185 Introduction to Computer

VisionFeature Matching

Page 2: CSE 185  Introduction to Computer Vision

Feature matching• Correspondence: matching points,

patches, edges, or regions across images

Page 3: CSE 185  Introduction to Computer Vision

Keypoint matching

AfBf

B1

B2

B3A1

A2 A3

Tffd BA ),(

1. Find a set of distinctive key- points

3. Extract and normalize the region content

2. Define a region around each keypoint

4. Compute a local descriptor from the normalized region5. Match local descriptors

Page 4: CSE 185  Introduction to Computer Vision

Review: Interest points

• Keypoint detection: repeatable and distinctive– Corners, blobs, stable

regions– Harris, DoG, MSER– SIFT

Page 5: CSE 185  Introduction to Computer Vision

Which interest detector• What do you want it for?

– Precise localization in x-y: Harris– Good localization in scale: Difference of Gaussian– Flexible region shape: MSER

• Best choice often application dependent– Harris-/Hessian-Laplace/DoG work well for many natural

categories– MSER works well for buildings and printed things

• Why choose?– Get more points with more detectors

• There have been extensive evaluations/comparisons– [Mikolajczyk et al., IJCV’05, PAMI’05]– All detectors/descriptors shown here work well

Page 6: CSE 185  Introduction to Computer Vision

Local feature descriptors• Most features can be thought

of as templates, histograms (counts), or combinations

• The ideal descriptor should be– Robust and distinctive– Compact and efficient

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

Page 7: CSE 185  Introduction to Computer Vision

How do we decide which features match?

Page 8: CSE 185  Introduction to Computer Vision

Feature matching• Szeliski 4.1.3

– Simple feature-space methods– Evaluation methods– Acceleration methods– Geometric verification (Chapter 6)

Page 9: CSE 185  Introduction to Computer Vision

Feature matching• Simple criteria: One feature matches

to another if those features are nearest neighbors and their distance is below some threshold.

• Problems:– Threshold is difficult to set– Non-distinctive features could have lots

of close matches, only one of which is correct

Page 10: CSE 185  Introduction to Computer Vision

Fitting: find the parameters of a model that best fit the data

Alignment: find the parameters of the transformation that best align matched points

Fitting and alignment

Page 11: CSE 185  Introduction to Computer Vision

Checkerboard• Often used in camera calibration

Page 12: CSE 185  Introduction to Computer Vision

Fitting and alignment• Design challenges

– Design a suitable goodness of fit measure• Similarity should reflect application goals• Encode robustness to outliers and noise

– Design an optimization method• Avoid local optima• Find best parameters quickly

Page 13: CSE 185  Introduction to Computer Vision

Fitting and alignment: Methods• Global optimization / Search for

parameters– Least squares fit– Robust least squares– Iterative closest point (ICP)

• Hypothesize and test– Generalized Hough transform– RANSAC

Page 14: CSE 185  Introduction to Computer Vision

Least squares line fitting• Data: (x1, y1), …, (xn, yn)

• Line equation: yi = m xi + b• Find (m, b) to minimize

022 yAApA TT

dpdE

n

i ii bxmyE1

2)((xi, yi)

y=mx+b

yAAApyAApA TTTT 1

Matlab: p = A \ y;

Page 15: CSE 185  Introduction to Computer Vision

Least squares (global) optimizationGood• Clearly specified objective• Optimization is easy

Bad• May not be what you want to optimize • Sensitive to outliers

– Bad matches, extra points• Doesn’t allow you to get multiple good fits

– Detecting multiple objects, lines, etc.

Page 16: CSE 185  Introduction to Computer Vision

Hypothesize and test1. Propose parameters

– Try all possible– Each point votes for all consistent parameters– Repeatedly sample enough points to solve for

parameters

2. Score the given parameters– Number of consistent points, possibly weighted by

distance

3. Choose from among the set of parameters– Global or local maximum of scores

4. Possibly refine parameters using inliers

Page 17: CSE 185  Introduction to Computer Vision

Hough transform: Outline

1. Create a grid of parameter values

2. Each point votes for a set of parameters, incrementing those values in grid

3. Find maximum or local maxima in grid

Page 18: CSE 185  Introduction to Computer Vision

x

y

b

m

y = m x + b

Given a set of points, find the curve or line that explains the data points best

Hough space

Hough transform

Duality: Each point has a dual line in the parameter space

m = -(1/x)b + y/x

Page 19: CSE 185  Introduction to Computer Vision

x

y

b

m

x

y m3 5 3 3 2 23 7 11 10 4 32 3 1 4 5 22 1 0 1 3 3

b

Hough transform

Page 20: CSE 185  Introduction to Computer Vision

x

y

Issue : parameter space [m,b] is unbounded…

Hough space)

sin()

sincos(

rxy

Use a polar representation for the parameter space

Hough transform

Duality: Each point has a dual curve in the parameter space

sincos 00 yxr

Page 21: CSE 185  Introduction to Computer Vision

features votes

Hough transform: Experiments

Page 22: CSE 185  Introduction to Computer Vision

Hough transform

Page 23: CSE 185  Introduction to Computer Vision

features votes

Need to adjust grid size or smooth

Noisy data

Hough transform: Experiments

Page 24: CSE 185  Introduction to Computer Vision

Issue: spurious peaks due to uniform noisefeatures votes

Hough transform: Experiments

Page 25: CSE 185  Introduction to Computer Vision

1. Image Canny

Page 26: CSE 185  Introduction to Computer Vision

2. Canny Hough votes

Page 27: CSE 185  Introduction to Computer Vision

3. Hough votes Edges

Find peaks and post-process

Page 28: CSE 185  Introduction to Computer Vision

Hough transform example

Page 29: CSE 185  Introduction to Computer Vision

Hough transform: Finding lines• Using m,b parameterization• Using r, theta parameterization

– Using oriented gradients• Practical considerations

– Bin size– Smoothing– Finding multiple lines– Finding line segments