Homography estimation

Similar documents
10/03/11. Model Fitting. Computer Vision CS 143, Brown. James Hays. Slides from Silvio Savarese, Svetlana Lazebnik, and Derek Hoiem

Hough Transform and RANSAC

EECS 442 Computer vision. Fitting methods

Lecture 9 Fitting and Matching

Feature Matching and Robust Fitting

Lecture 8 Fitting and Matching

Fitting. Instructor: Jason Corso (jjcorso)! web.eecs.umich.edu/~jjcorso/t/598f14!! EECS Fall 2014! Foundations of Computer Vision!

Multi-stable Perception. Necker Cube

Instance-level recognition

Photo by Carl Warner

Image Features: Local Descriptors. Sanja Fidler CSC420: Intro to Image Understanding 1/ 58

Instance-level recognition

Model Fitting, RANSAC. Jana Kosecka

Fitting. Fitting. Slides S. Lazebnik Harris Corners Pkwy, Charlotte, NC

Fitting: The Hough transform

RANSAC and some HOUGH transform

Model Fitting. Introduction to Computer Vision CSE 152 Lecture 11

Fitting: The Hough transform

Fitting: The Hough transform

CS 664 Image Matching and Robust Fitting. Daniel Huttenlocher

Perception IV: Place Recognition, Line Extraction

Instance-level recognition part 2

Model Fitting: The Hough transform I

(More) Algorithms for Cameras: Edge Detec8on Modeling Cameras/Objects. Connelly Barnes

Fitting (LMedS, RANSAC)

Feature Detectors and Descriptors: Corners, Lines, etc.

Image correspondences and structure from motion

Straight Lines and Hough

EE795: Computer Vision and Intelligent Systems

CS231A Midterm Review. Friday 5/6/2016

Vision par ordinateur

Srikumar Ramalingam. Review. 3D Reconstruction. Pose Estimation Revisited. School of Computing University of Utah

RANSAC: RANdom Sampling And Consensus

CS 231A Computer Vision (Winter 2018) Problem Set 3

Instance-level recognition II.

Image warping and stitching

Automatic Image Alignment (feature-based)

Lecture 9: Hough Transform and Thresholding base Segmentation

Computer Vision 6 Segmentation by Fitting

Srikumar Ramalingam. Review. 3D Reconstruction. Pose Estimation Revisited. School of Computing University of Utah

Image warping and stitching

CS 395T Lecture 12: Feature Matching and Bundle Adjustment. Qixing Huang October 10 st 2018

Image warping and stitching

Uncertainties: Representation and Propagation & Line Extraction from Range data

Image Processing and Computer Vision

Estimate Geometric Transformation

Prof. Noah Snavely CS Administrivia. A4 due on Friday (please sign up for demo slots)

CS 231A Computer Vision (Winter 2014) Problem Set 3

Feature Matching and RANSAC

Other Linear Filters CS 211A

Fi#ng & Matching Region Representa3on Image Alignment, Op3cal Flow

Observations. Basic iteration Line estimated from 2 inliers

Feature Matching + Indexing and Retrieval

Homographies and RANSAC

INFO0948 Fitting and Shape Matching

Fitting D.A. Forsyth, CS 543

HOUGH TRANSFORM CS 6350 C V

CS 558: Computer Vision 4 th Set of Notes

Lecture 3.3 Robust estimation with RANSAC. Thomas Opsahl

COMPARATIVE STUDY OF DIFFERENT APPROACHES FOR EFFICIENT RECTIFICATION UNDER GENERAL MOTION

Lecture: RANSAC and feature detectors

Automatic Image Alignment

Template Matching Rigid Motion

Lecture 4: Finding lines: from detection to model fitting

Mosaics. Today s Readings

Miniature faking. In close-up photo, the depth of field is limited.

Multiple View Geometry. Frank Dellaert

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

Automatic Image Alignment

Template Matching Rigid Motion. Find transformation to align two images. Focus on geometric features

Prof. Kristen Grauman

Methods for Representing and Recognizing 3D objects

Lecture 8: Fitting. Tuesday, Sept 25

Fitting. Choose a parametric object/some objects to represent a set of tokens Most interesting case is when criterion is not local

Feature Based Registration - Image Alignment

Nonparametric estimation of multiple structures with outliers

Lecture 15: Segmentation (Edge Based, Hough Transform)

Final Exam Assigned: 11/21/02 Due: 12/05/02 at 2:30pm

Object Recognition with Invariant Features

3D Reconstruction of a Hopkins Landmark

Nonparametric estimation of multiple structures with outliers

CSE 252B: Computer Vision II

Camera Geometry II. COS 429 Princeton University

Fitting. Lecture 8. Cristian Sminchisescu. Slide credits: K. Grauman, S. Seitz, S. Lazebnik, D. Forsyth, J. Ponce

Lecture 9: inverting the imaging process calibration, recovery of world position, mosaicing

Robust Geometry Estimation from two Images

3D Environment Reconstruction

Stereo and Epipolar geometry

PS3 Review Session. Kuan Fang CS231A 02/16/2018

A Summary of Projective Geometry

Model Fitting: The Hough transform II

ROBUST LINE-BASED CALIBRATION OF LENS DISTORTION FROM A SINGLE VIEW

Computer Vision I. Announcements. Random Dot Stereograms. Stereo III. CSE252A Lecture 16

Week 2: Two-View Geometry. Padua Summer 08 Frank Dellaert

CS1114: Study Guide 2

GENERALIZING THE HOUGH TRANSFORM TO DETECT ARBITRARY SHAPES. D. H. Ballard Pattern Recognition Vol. 13 No

human vision: grouping k-means clustering graph-theoretic clustering Hough transform line fitting RANSAC

Multi-stable Perception. Necker Cube

HOUGH TRANSFORM. Plan for today. Introduction to HT. An image with linear structures. INF 4300 Digital Image Analysis

Problem Set 3 CMSC 426 Due: Thursday, April 3

Transcription:

RANSAC continued

Homography estimation x w? ~x img H~x w

Homography estimation? x img ~x w = H 1 ~x img

Homography estimation (0,0) (1,0) (6.4,2.8) (8.0,2.9) (5.6, 4.0) (7.8, 4.2) (0,1) (1,1) Ah =0s.tkhk =1

Homography estimation (0,0) (1,0) (6.4,2.8) (8.0,2.9) (5.6, 4.0) (7.8, 4.2) (0,1) (1,1) min h kahk 2 s.t khk =1

Camera calibration Y Y Z O O X X Z min kapk 2 s.t kpk =1 p

Homography estimation (0,0) (1,0) (6.4,2.8) (8.0,2.9) (5.6, 4.0) (7.8, 4.2) (0,1) (1,1) min h kahk 2 s.t khk =1

Homography estimation: obtaining correspondences min h kahk 2 s.t khk =1

Homography estimation Given images A and B 1. Compute image features for A and B 2. Match features between A and B 3. Compute homography between A and B What do we do when correspondences are incorrect?

Homography fitting and incorrect correspondences min h kahk 2 s.t khk =1 Correspondences create matrix A What if many correspondences are actually incorrect? Even true H cannot satisfy constraint! Outliers

Outliers outliers inliers

A general class of problems Need to fit a model, i.e., find parameters e.g., H for homography Have some data points to find parameters e.g. correspondences (x w, x img ) Need at least k data points to find parameters e.g., 4 correspondences for homography Many data points might be completely incorrect, i.e., even correct model won t fit them e.g., incorrect correspondences

Another example Need to fit a model, i.e., find parameters e.g., m,b for line fitting Have some data points to find parameters e.g. points (x, y) Need at least k data points to find parameters e.g., 2 points for line Many data points might be completely incorrect, i.e., even correct model won t fit them

Robustness Problem: Fit a line to these datapoints Least squares fit

Robust model fitting Correct data = inliers, incorrect data = outliers If we knew inliers, fitting model is easy e.g., for homography, set up matrix A min kahk 2 s.t khk =1 h If we knew model, identifying inliers is easy Inliers agree with model, outliers disagree Chicken and egg problem!

Key idea A single model will satisfy all inliers No single model will satisfy all outliers Outliers will all disagree on model they like Happy families are all alike; every unhappy family is unhappy in its own way. -Leo Tolstoy, Ana Karenina

Key idea Identify model that agrees with most points Given a hypothesized line Count the number of points that agree with the line Agree = within a small distance of the line I.e., the inliers to that line For all possible lines, select the one with the largest number of inliers

Counting inliers

Counting inliers Inliers: 3

Counting inliers Inliers: 20

How do we find the best line? Unlike least-squares, no simple closed-form solution Hypothesize-and-test Try out many lines, keep the best one Which lines?

RANSAC (Random Sample Consensus) Line fitting example Algorithm: 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 Illustration by Savarese

RANSAC Line fitting example Algorithm: 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

RANSAC Line fitting example N I = 6 d Algorithm: 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

RANSAC Algorithm: d 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 N I =14

RANSAC Idea: All the inliers will agree with each other on the translation vector; the (hopefully small) number of outliers will (hopefully) disagree with each other RANSAC only has guarantees if there are < 50% outliers All good matches are alike; every bad match is bad in its own way. Tolstoy via Alyosha Efros

RANSAC Inlier threshold related to the amount of noise we expect in inliers Often model noise as Gaussian with some standard deviation (e.g., 3 pixels) Number of rounds related to the percentage of outliers we expect, and the probability of success we d like to guarantee Suppose there are 20% outliers, and we want to find the correct answer with 99% probability How many rounds do we need?

How many rounds? If we have to choose k samples each time with an inlier ratio p and we want the right answer with probability P proportion of inliers p k 95% 90% 80% 75% 70% 60% 50% 2 2 3 5 6 7 11 17 3 3 4 7 9 11 19 35 4 3 5 9 13 17 34 72 5 4 6 12 17 26 57 146 6 4 7 16 24 37 97 293 7 4 8 20 33 54 163 588 8 5 9 26 44 78 272 1177 P = 0.99 Source: M. Pollefeys

proportion of inliers p k 95% 90% 80% 75% 70% 60% 50% 2 2 3 5 6 7 11 17 3 3 4 7 9 11 19 35 4 3 5 9 13 17 34 72 5 4 6 12 17 26 57 146 6 4 7 16 24 37 97 293 7 4 8 20 33 54 163 588 8 5 9 26 44 78 272 1177 P = 0.99

RANSAC pros and cons Pros Simple and general Applicable to many different problems Often works well in practice Cons Parameters to tune Sometimes too many iterations are required Can fail for extremely low inlier ratios

RANSAC An example of a voting -based fitting scheme Each hypothesis gets voted on by each data point, best hypothesis wins There are many other types of voting schemes E.g., Hough transforms

Hough transform What possible lines can this point lie on? (m,b) must satisfy: y = mx + b This is the equation of a line in m and b y m x b

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

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

Hough transform y m x b y m 3 5 3 3 2 2 3 7 11 10 4 3 2 3 1 4 5 2 2 1 0 1 3 3 Slide from S. Savarese x b

Hough transform y m x b

Hough transform d q

Hough transform : circles Suppose we want to fit circles to points Assume we know the radius, but don t know the centres Given a point (x,y), what possible circles of radius r can it lie on? center (c x, c y ) must satisfy (x - c x ) 2 + (y-c y ) 2 = r 2 center must lie on a circle!

Hough transform : circles Suppose we want to fit circles to points Assume we know the radius, but don t know the centres Given a point (x,y), what possible circles of radius r can it lie on? center (c x, c y ) must satisfy (x - c x ) 2 + (y-c y ) 2 = r 2 center must lie on a circle!

Hough transform: circles What happens if we don t know the radius of the circle? How big should the Hough space be?

Hough transform: general form Suppose we have to fit a model with some parameters to some data Construct a grid of parameter values d parameters with k possible values for each: k x k x x k array d times k d elements Each data point puts in a vote for all sets of parameter values it likes Look for parameter settings with votes>threshold

Hough transform Simple Can deal with multiple correct answers Can only work if only a small number of parameters to fit (e.g. 2-3) Can we use this for homography fitting?