Photo by Carl Warner. Feature Matching and Robust Fitting Computer Vision James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe.

Slides:



Advertisements
Similar presentations
CSE 473/573 Computer Vision and Image Processing (CVIP)
Advertisements

Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Feature Matching and Robust Fitting Computer Vision CS 143, Brown James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe 2008 AAAI Tutorial.
Computer Vision CS 143, Brown James Hays
TP14 - Local features: detection and description Computer Vision, FCUP, 2014 Miguel Coimbra Slides by Prof. Kristen Grauman.
Object Recognition using Invariant Local Features Applications l Mobile robots, driver assistance l Cell phone location or object recognition l Panoramas,
Photo by Carl Warner.
776 Computer Vision Jared Heinly Spring 2014 (slides borrowed from Jan-Michael Frahm, Svetlana Lazebnik, and others)
Fitting: The Hough transform
Locating and Describing Interest Points
CS 558 C OMPUTER V ISION Lecture VIII: Fitting, RANSAC, and Hough Transform Adapted from S. Lazebnik.
A Study of Approaches for Object Recognition
Object Recognition with Invariant Features n Definition: Identify objects or scenes and determine their pose and model parameters n Applications l Industrial.
Fitting. We’ve learned how to detect edges, corners, blobs. Now what? We would like to form a higher-level, more compact representation of the features.
Interest Points and Corners Computer Vision CS 143, Brown James Hays Slides from Rick Szeliski, Svetlana Lazebnik, Derek Hoiem and Grauman&Leibe 2008 AAAI.
Fitting a Model to Data Reading: 15.1,
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and.
CS4670: Computer Vision Kavita Bala Lecture 7: Harris Corner Detection.
Fitting: The Hough transform
Robust estimation Problem: we want to determine the displacement (u,v) between pairs of images. We are given 100 points with a correlation score computed.
Scale-Invariant Feature Transform (SIFT) Jinxiang Chai.
Fitting.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Fitting and Registration
CSE 185 Introduction to Computer Vision
Computer Vision - Fitting and Alignment
Locating and Describing Interest Points Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/02/10 Acknowledgment: Many keypoint slides.
Fitting and Registration Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/14/12.
Local invariant features Cordelia Schmid INRIA, Grenoble.
Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Fitting & Matching Lecture 4 – Prof. Bregler Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.
CS 1699: Intro to Computer Vision Matching and Fitting Prof. Adriana Kovashka University of Pittsburgh September 29, 2015.
CSE 185 Introduction to Computer Vision Local Invariant Features.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Fitting: The Hough transform
Model Fitting Computer Vision CS 143, Brown James Hays 10/03/11 Slides from Silvio Savarese, Svetlana Lazebnik, and Derek Hoiem.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Computer Vision - Fitting and Alignment (Slides borrowed from various presentations)
CSE 185 Introduction to Computer Vision Feature Matching.
Project 3 questions? Interest Points and Instance Recognition Computer Vision CS 143, Brown James Hays 10/21/11 Many slides from Kristen Grauman and.
Lecture 9 Feature Extraction and Motion Estimation Slides by: Michael Black Clark F. Olson Jean Ponce.
CS654: Digital Image Analysis
Presented by David Lee 3/20/2006
Fitting.
CSE 185 Introduction to Computer Vision Local Invariant Features.
Lecture 10: Harris Corner Detector CS4670/5670: Computer Vision Kavita Bala.
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
CS 558 C OMPUTER V ISION Fitting, RANSAC, and Hough Transfrom Adapted from S. Lazebnik.
Grouping and Segmentation. Sometimes edge detectors find the boundary pretty well.
Segmentation by fitting a model: Hough transform and least squares
SIFT Scale-Invariant Feature Transform David Lowe
Lecture 13: Feature Descriptors and Matching
Presented by David Lee 3/20/2006
Lecture 07 13/12/2011 Shai Avidan הבהרה: החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Local features: main components
Project 1: hybrid images
Line Fitting James Hayes.
Motion illusion, rotating snakes
TP12 - Local features: detection and description
Source: D. Lowe, L. Fei-Fei Recap: edge detection Source: D. Lowe, L. Fei-Fei.
Fitting: The Hough transform
A special case of calibration
Fitting.
Photo by Carl Warner.
Photo by Carl Warner.
Segmentation by fitting a model: robust estimators and RANSAC
Fitting CS 678 Spring 2018.
CSE 185 Introduction to Computer Vision
Feature descriptors and matching
Presentation transcript:

Photo by Carl Warner

Feature Matching and Robust Fitting Computer Vision James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe 2008 AAAI Tutorial Read Szeliski 4.1

Project 2 questions?

This section: correspondence and alignment Correspondence: matching points, patches, edges, or regions across images ≈

Overview of Keypoint Matching K. Grauman, B. Leibe B1B1 B2B2 B3B3 A1A1 A2A2 A3A3 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 region 5. Match local descriptors

Harris Corners – Why so complicated? Can’t we just check for regions with lots of gradients in the x and y directions? – No! A diagonal line would satisfy that criteria Current Window

Harris Detector [ Harris88 ] Second moment matrix 9 1. Image derivatives 2. Square of derivatives 3. Gaussian filter g(  I ) IxIx IyIy Ix2Ix2 Iy2Iy2 IxIyIxIy g(I x 2 )g(I y 2 ) g(I x I y ) 4. Cornerness function – both eigenvalues are strong har 5. Non-maxima suppression (optionally, blur first)

Harris Corners – Why so complicated? What does the structure matrix look here? Current Window

Harris Corners – Why so complicated? What does the structure matrix look here? Current Window

Harris Corners – Why so complicated? What does the structure matrix look here? Current Window

Review: Interest points Keypoint detection: repeatable and distinctive – Corners, blobs, stable regions – Harris, DoG, MSER

Comparison of Keypoint Detectors Tuytelaars Mikolajczyk 2008

Review: Choosing an interest point 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

Review: Local 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 K. Grauman, B. Leibe

How do we decide which features match?

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

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

Matching Local Features Threshold based on the ratio of 1 st nearest neighbor to 2 nd nearest neighbor distance. Lowe IJCV 2004

SIFT Repeatability Lowe IJCV 2004

SIFT Repeatability

How do we decide which features match?

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 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

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

Simple example: Fitting a line

Least squares line fitting Data: (x 1, y 1 ), …, (x n, y n ) Line equation: y i = m x i + b Find ( m, b ) to minimize (x i, y i ) y=mx+b Matlab: p = A \ y; Modified from S. Lazebnik

Problem with “vertical” least squares Not rotation-invariant Fails completely for vertical lines Slide from S. Lazebnik

Total least squares If (a 2 +b 2 =1) then Distance between point (x i, y i ) is |ax i + by i + c| (x i, y i ) ax+by+c=0 Unit normal: N=(a, b) Slide modified from S. Lazebnik proof: LineDistance2-Dimensional.html LineDistance2-Dimensional.html

Total least squares If (a 2 +b 2 =1) then Distance between point (x i, y i ) is |ax i + by i + c| Find (a, b, c) to minimize the sum of squared perpendicular distances (x i, y i ) ax+by+c=0 Unit normal: N=(a, b) Slide modified from S. Lazebnik

Total least squares Find (a, b, c) to minimize the sum of squared perpendicular distances (x i, y i ) ax+by+c=0 Unit normal: N=(a, b) Solution is eigenvector corresponding to smallest eigenvalue of A T A See details on Raleigh Quotient: Slide modified from S. Lazebnik

Recap: Two Common Optimization Problems Problem statementSolution Problem statementSolution (matlab)

Least squares (global) optimization Good 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.

Least squares: Robustness to noise Least squares fit to the red points:

Least squares: Robustness to noise Least squares fit with an outlier: Problem: squared error heavily penalizes outliers

Robust least squares (to deal with outliers) General approach: minimize u i (x i, θ) – residual of i th point w.r.t. model parameters θ ρ – robust function with scale parameter σ The robust function ρ Favors a configuration with small residuals Constant penalty for large residuals Slide from S. Savarese

Choosing the scale: Just right The effect of the outlier is minimized

The error value is almost the same for every point and the fit is very poor Choosing the scale: Too small

Choosing the scale: Too large Behaves much the same as least squares

Robust estimation: Details Robust fitting is a nonlinear optimization problem that must be solved iteratively Least squares solution can be used for initialization Scale of robust function should be chosen adaptively based on median residual

Other ways to search for parameters (for when no closed form solution exists) Line search 1.For each parameter, step through values and choose value that gives best fit 2.Repeat (1) until no parameter changes Grid search 1.Propose several sets of parameters, evenly sampled in the joint set 2.Choose best (or top few) and sample joint parameters around the current best; repeat Gradient descent 1.Provide initial position (e.g., random) 2.Locally search for better parameters by following gradient

Hypothesize and test 1.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

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

x y b m y = m x + b Hough transform Given a set of points, find the curve or line that explains the data points best P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959 Hough space Slide from S. Savarese

x y b m x ym b Hough transform Slide from S. Savarese

x y Hough transform Issue : parameter space [m,b] is unbounded… P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959 Hough space Use a polar representation for the parameter space Slide from S. Savarese

features votes Hough transform - experiments Slide from S. Savarese

featuresvotes Need to adjust grid size or smooth Hough transform - experiments Noisy data Slide from S. Savarese

Issue: spurious peaks due to uniform noise featuresvotes Hough transform - experiments Slide from S. Savarese

1. Image  Canny

2. Canny  Hough votes

3. Hough votes  Edges Find peaks and post-process

Hough transform example

Incorporating image gradients Recall: when we detect an edge point, we also know its gradient direction But this means that the line is uniquely determined! Modified Hough transform: For each edge point (x,y) θ = gradient orientation at (x,y) ρ = x cos θ + y sin θ H(θ, ρ) = H(θ, ρ) + 1 end

Finding lines using Hough transform Using m,b parameterization Using r, theta parameterization – Using oriented gradients Practical considerations – Bin size – Smoothing – Finding multiple lines – Finding line segments

Next lecture RANSAC Connecting model fitting with feature matching