Fitting a Model to Data Reading: 15.1,

Slides:



Advertisements
Similar presentations
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.
Advertisements

Object Recognition using Invariant Local Features Applications l Mobile robots, driver assistance l Cell phone location or object recognition l Panoramas,
Computer Vision Detecting the existence, pose and position of known objects within an image Michael Horne, Philip Sterne (Supervisor)
Image alignment Image from
776 Computer Vision Jared Heinly Spring 2014 (slides borrowed from Jan-Michael Frahm, Svetlana Lazebnik, and others)
Object Recognition with Invariant Features n Definition: Identify objects or scenes and determine their pose and model parameters n Applications l Industrial.
Fitting: The Hough transform
Robust and large-scale alignment Image from
Lecture 5 Hough transform and RANSAC
Fitting lines. Fitting Choose a parametric object/some objects to represent a set of tokens Most interesting case is when criterion is not local –can’t.
Image alignment.
Object Recognition with Invariant Features n Definition: Identify objects or scenes and determine their pose and model parameters n Applications l Industrial.
Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth Fitting Choose a parametric object/some objects to represent a set of tokens Most.
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.
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2005 with a lot of slides stolen from Steve Seitz and.
Fitting. Choose a parametric object/some objects to represent a set of tokens Most interesting case is when criterion is not local –can’t tell whether.
Lecture 8: Image Alignment and RANSAC
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and.
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.
Lecture 10: Robust fitting CS4670: Computer Vision Noah Snavely.
Fitting.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
Image alignment.
CSE 185 Introduction to Computer Vision
Computer Vision - Fitting and Alignment
1 Interest Operators Harris Corner Detector: the first and most basic interest operator Kadir Entropy Detector and its use in object recognition SIFT interest.
Fitting & Matching Lecture 4 – Prof. Bregler Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.
HOUGH TRANSFORM Presentation by Sumit Tandon
Perceptual and Sensory Augmented Computing Visual Object Recognition Tutorial Visual Object Recognition Bastian Leibe & Computer Vision Laboratory ETH.
Object Detection 01 – Advance Hough Transformation JJCAO.
Example: line fitting. n=2 Model fitting Measure distances.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 14/15 – TP8 Segmentation Miguel Tavares Coimbra.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Computer Vision : CISC 4/689 Going Back a little Cameras.ppt.
Fitting: The Hough transform
EECS 274 Computer Vision Model Fitting. Fitting Choose a parametric object/some objects to represent a set of points Three main questions: –what object.
Computer Vision - Fitting and Alignment (Slides borrowed from various presentations)
Lecture 08 27/12/2011 Shai Avidan הבהרה: החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
CSE 185 Introduction to Computer Vision Feature Matching.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
776 Computer Vision Jan-Michael Frahm Spring 2012.
CS 2750: Machine Learning Linear Regression Prof. Adriana Kovashka University of Pittsburgh February 10, 2016.
Robust Estimation Course web page: vision.cis.udel.edu/~cv April 23, 2003  Lecture 25.
Fitting.
EE 7730 Parametric Motion Estimation. Bahadir K. Gunturk2 Parametric (Global) Motion Affine Flow.
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
Invariant Local Features Image content is transformed into local feature coordinates that are invariant to translation, rotation, scale, and other imaging.
Grouping and Segmentation. Sometimes edge detectors find the boundary pretty well.
776 Computer Vision Jan-Michael Frahm Spring 2012.
SIFT Scale-Invariant Feature Transform David Lowe
Fitting: Voting and the Hough Transform
Miguel Tavares Coimbra
Fitting.
Line Fitting James Hayes.
Nearest-neighbor matching to feature database
Exercise Class 11: Robust Tecuniques RANSAC, Hough Transform
Lecture 7: Image alignment
A special case of calibration
Fitting Curve Models to Edges
Features Readings All is Vanity, by C. Allan Gilbert,
Nearest-neighbor matching to feature database
Computer Vision - A Modern Approach
CSE 455 – Guest Lectures 3 lectures Contact Interest points 1
SIFT.
CSE 185 Introduction to Computer Vision
Calibration and homographies
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Presentation transcript:

Fitting a Model to Data Reading: 15.1, 15.5.2 Cluster image parts together by fitting a model to some selected parts Examples: A line fits well to a set of points. This is unlikely to be due to chance, so we represent the points as a line. A 3D model can be rotated and translated to closely fit a set of points or line segments. It it fits well, the object is recognized.

Line Grouping Problem Slide credit: David Jacobs

This is difficult because of: Extraneous data: clutter or multiple models We do not know what is part of the model? Can we pull out models with a few parts from much larger amounts of background clutter? Missing data: only some parts of model are present Noise Cost: It is not feasible to check all combinations of features by fitting a model to each possible subset

Equation for a line Representing a line in the usual form, y = mx + b, has the problem that m goes to infinity for vertical lines A better choice of parameters for the line is angle, θ, and perpendicular distance from the origin, d: x sin θ - y cos θ + d = 0

The Hough Transform for Lines Idea: Each point votes for the lines that pass through it. A line is the set of points (x, y) such that x sin θ - y cos θ + d = 0 Different choices of q, d give different lines For any (x, y) there is a one parameter family of lines through this point. Just let (x,y) be constants and for each value of q the value of d will be determined. Each point enters votes for each line in the family If there is a line that has lots of votes, that will be the line passing near the points that voted for it.

The Hough Transform for Lines d Figure 15.1, top half. Note that most points in the vote array are very dark, because they get only one vote. θ Tokens Votes

Hough Transform: Noisy line This is 15.1 lower half tokens votes

15.2; main point is that lots of noise can lead to large peaks in the array

Mechanics of the Hough transform Construct an array representing q, d For each point, render the curve (q, d) into this array, adding one vote at each cell Difficulties how big should the cells be? (too big, and we merge quite different lines; too small, and noise causes lines to be missed) How many lines? Count the peaks in the Hough array Treat adjacent peaks as a single peak Which points belong to each line? Search for points close to the line Solve again for line and iterate

Fewer votes land in a single bin when noise increases. This is the number of votes that the real line of 20 points gets with increasing noise (figure15.3) Fewer votes land in a single bin when noise increases.

Adding more clutter increases number of bins with false peaks. Figure 15.4; as the noise increases in a picture without a line, the number of points in the max cell goes up, too Adding more clutter increases number of bins with false peaks.

More details on Hough transform It is best to vote for the two closest bins in each dimension, as the locations of the bin boundaries is arbitrary. By “bin” we mean an array location in which votes are accumulated This means that peaks are “blurred” and noise will not cause similar votes to fall into separate bins Can use a hash table rather than an array to store the votes This means that no effort is wasted on initializing and checking empty bins It avoids the need to predict the maximum size of the array, which can be non-rectangular

When is the Hough transform useful? The textbook wrongly implies that it is useful mostly for finding lines In fact, it can be very effective for recognizing arbitrary shapes or objects The key to efficiency is to have each feature (token) determine as many parameters as possible For example, lines can be detected much more efficiently from small edge elements (or points with local gradients) than from just points For object recognition, each token should predict scale, orientation, and location (4D array) Bottom line: The Hough transform can extract feature groupings from clutter in linear time!

RANSAC (RANdom SAmple Consensus) Randomly choose minimal subset of data points necessary to fit model (a sample) Points within some distance threshold t of model are a consensus set. Size of consensus set is model’s support Repeat for N samples; model with biggest support is most robust fit Points within distance t of best model are inliers Fit final model to all inliers Two samples and their supports for line-fitting from Hartley & Zisserman Slide: Christopher Rasmussen

RANSAC: How many samples? How many samples are needed? Suppose w is fraction of inliers (points from line). n points needed to define hypothesis (2 for lines) k samples chosen. Probability that a single sample of n points is correct: Probability that all samples fail is: Choose k high enough to keep this below desired failure rate.

RANSAC: Computed k (p = 0.99) Sample size Proportion of outliers n 5% 10% 20% 25% 30% 40% 50% 2 3 5 6 7 11 17 4 9 19 35 13 34 72 12 26 57 146 16 24 37 97 293 8 20 33 54 163 588 44 78 272 1177 adapted from Hartley & Zisserman Slide credit: Christopher Rasmussen

After RANSAC RANSAC divides data into inliers and outliers and yields estimate computed from minimal set of inliers Improve this initial estimate with estimation over all inliers (e.g., with standard least-squares minimization) But this may change inliers, so alternate fitting with re-classification as inlier/outlier from Hartley & Zisserman Slide credit: Christopher Rasmussen

Automatic Matching of Images How to get correct correspondences without human intervention? Can be used for image stitching or automatic determination of epipolar geometry from Hartley & Zisserman Slide credit: Christopher Rasmussen

Feature Extraction Find features in pair of images using Harris corner detector Assumes images are roughly the same scale (we will discuss better features later in the course) from Hartley & Zisserman ~500 features found Slide credit: Christopher Rasmussen

Finding Feature Matches Select best match over threshold within a square search window (here 300 pixels2) using SSD or normalized cross-correlation for small patch around the corner from Hartley & Zisserman Slide credit: Christopher Rasmussen

Initial Match Hypotheses 268 matched features (over SSD threshold) in left image pointing to locations of corresponding right image features Slide credit: Christopher Rasmussen

Outliers & Inliers after RANSAC n is 4 for this problem (a homography relating 2 images) Assume up to 50% outliers 43 samples used with t = 1.25 pixels from Hartley & Zisserman 117 outliers 151 inliers

Discussion of RANSAC Advantages: General method suited for a wide range of model fitting problems Easy to implement and easy to calculate its failure rate Disadvantages: Only handles a moderate percentage of outliers without cost blowing up Many real problems have high rate of outliers (but sometimes selective choice of random subsets can help) The Hough transform can handle high percentage of outliers, but false collisions increase with large bins (noise)