Model Fitting. Introduction to Computer Vision CSE 152 Lecture 11

Similar documents
Generalized Hough Transform, line fitting

Announcements. Hough Transform [ Patented 1962 ] Generalized Hough Transform, line fitting. Assignment 2: Due today Midterm: Thursday, May 5 in class

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

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

Model Fitting, RANSAC. Jana Kosecka

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

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

EECS 442 Computer vision. Fitting methods

Vision par ordinateur

Feature Detectors and Descriptors: Corners, Lines, etc.

Lecture 8 Fitting and Matching

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

Lecture 9 Fitting and Matching

Homography estimation

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Multiple View Geometry. Frank Dellaert

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Feature Matching and Robust Fitting

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

Hough Transform and RANSAC

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

CS 558: Computer Vision 4 th Set of Notes

RANSAC and some HOUGH transform

E0005E - Industrial Image Analysis

Lecture 9: Hough Transform and Thresholding base Segmentation

Issues with Curve Detection Grouping (e.g., the Canny hysteresis thresholding procedure) Model tting They can be performed sequentially or simultaneou

Lecture 8: Fitting. Tuesday, Sept 25

Edge Detection. CSE 576 Ali Farhadi. Many slides from Steve Seitz and Larry Zitnick

Computer Vision 6 Segmentation by Fitting

Automatic Image Alignment (feature-based)

EE795: Computer Vision and Intelligent Systems

An edge is not a line... Edge Detection. Finding lines in an image. Finding lines in an image. How can we detect lines?

Other Linear Filters CS 211A

Lecture 15: Segmentation (Edge Based, Hough Transform)

Image Stitching. Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi

Image correspondences and structure from motion

Lecture: RANSAC and feature detectors

Feature Based Registration - Image Alignment

Uncertainties: Representation and Propagation & Line Extraction from Range data

Instance-level recognition

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

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

Feature Selection. Ardy Goshtasby Wright State University and Image Fusion Systems Research

CS 664 Image Matching and Robust Fitting. Daniel Huttenlocher

Multi-stable Perception. Necker Cube

Homographies and RANSAC

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

Lecture 4: Finding lines: from detection to model fitting

HOUGH TRANSFORM CS 6350 C V

Computational Optical Imaging - Optique Numerique. -- Multiple View Geometry and Stereo --

Announcements, schedule. Lecture 8: Fitting. Weighted graph representation. Outline. Segmentation by Graph Cuts. Images as graphs

Instance-level recognition

Instance-level recognition II.

Structure from Motion. Introduction to Computer Vision CSE 152 Lecture 10

Image Processing and Computer Vision

CS231A Midterm Review. Friday 5/6/2016

Edge Detection. EE/CSE 576 Linda Shapiro

Edge detection. Gradient-based edge operators

INFO0948 Fitting and Shape Matching

Anno accademico 2006/2007. Davide Migliore

Robust Geometry Estimation from two Images

Finding 2D Shapes and the Hough Transform

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

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

Perception IV: Place Recognition, Line Extraction

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

Stereo and Epipolar geometry

Motion Tracking and Event Understanding in Video Sequences

Parameter estimation. Christiano Gava Gabriele Bleser

Instance-level recognition part 2

Pattern recognition systems Lab 3 Hough Transform for line detection

ECE 470: Homework 5. Due Tuesday, October 27 in Seth Hutchinson. Luke A. Wendt

Agenda. Rotations. Camera calibration. Homography. Ransac

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

COMPARATIVE STUDY OF DIFFERENT APPROACHES FOR EFFICIENT RECTIFICATION UNDER GENERAL MOTION

Announcements. Segmentation (Part 2) Image Segmentation. From images to objects. Image histograms. What do histograms look like?

CAP 5415 Computer Vision Fall 2012

Feature Matching and RANSAC

Two-view geometry Computer Vision Spring 2018, Lecture 10

RANSAC: RANdom Sampling And Consensus

Photo by Carl Warner

Automatic Image Alignment

Random Sample Consensus (RANSAC) Algorithm, A Generic Implementation Release 1.0

Edges and Lines Readings: Chapter 10: better edge detectors line finding circle finding

Straight Lines and Hough

Computer Vision for HCI. Topics of This Lecture

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

Graphics and Interaction Transformation geometry and homogeneous coordinates

CSE 252B: Computer Vision II

OBJECT detection in general has many applications

Segmentation (Part 2)

Computer Vision I Name : CSE 252A, Fall 2012 Student ID : David Kriegman Assignment #1. (Due date: 10/23/2012) x P. = z

A Summary of Projective Geometry

Fitting: Voting and the Hough Transform April 23 rd, Yong Jae Lee UC Davis

Edges and Lines Readings: Chapter 10: better edge detectors line finding circle finding

Agenda. Rotations. Camera models. Camera calibration. Homographies

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Capturing, Modeling, Rendering 3D Structures

Elaborazione delle Immagini Informazione Multimediale. Raffaella Lanzarotti

Local invariant features

Transcription:

Model Fitting CSE 152 Lecture 11

Announcements Homework 3 is due May 9, 11:59 PM Reading: Chapter 10: Grouping and Model Fitting

What to do with edges? Segment linked edge chains into curve features (e.g., line segments). Group unlinked or unrelated edges into lines (or curves in general). Accurately fitting parametric curves (e.g., lines) to grouped edge points.

Hough Transform [ Patented 1962 ]

Finding lines in an image y b (m 0,b 0 ) image space x Hough space m Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space

Finding lines in an image y b (x 0,y 0 ) image space x Hough space m Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space What does a point (x 0, y 0 ) in the image space map to? The equation of any line passing through (x 0, y 0 ) has form y 0 = mx 0 + b This is a line in Hough space: b = -x 0 m + y 0

Hough Transform Algorithm Typically use a different parameterization d is the perpendicular distance from the line to the origin is the angle this perpendicular makes with the x axis Basic Hough transform algorithm 1. Initialize H[d, ]=0 ; H is called accumulator array 2. for each edge point I[x,y] in the image for = 0 to 180 H[d, ] += 1 3. Find the value(s) of (d, ) where H[d, ] is the global maximum 4. The detected line in the image is given by What s the running time (measured in # votes)?

Hough Transform: 20 colinear points Image Accumulator y d d, representation of line Drawn as: d = xcos + ysin Maximum accumulator value is 20 x Note: accumulator array range: theta: 0-360, d: positive θ

Hough Transform: Random points Image Accumulator y d x d, representation of line Drawn as: d = xcos + ysin Maximum accumulator value is 4 θ

Hough Transform: Noisy line Image Accumulator y d d, representation of line Drawn as: d = xcos + ysin Maximum accumulator value is 6 x θ

Extension: Oriented Edges

Hough Transform for Curves Generalized Hough Transform The Hough transform can be generalized to detect any curve that can be expressed in parametric form: y = f(x, a 1, a 2, a p ) or g(x,y,a 1,a 2, a p ) = 0 a 1, a 2, a p are the parameters The parameter space is p-dimensional The accumulating array is large

Example: Finding circles Equation for circle is (x x c ) 2 + (y y c ) 2 = r 2 where the parameters are the circle s center (x c, y c ) and radius r. Three dimensional generalized Hough space. Given an edge point (x,y), 1. Loop over all values of (x c, y c ), 2. Compute r 3. Increment H(x c, y c, r)

Transmission Electron Microscopy (TEM) Image of Keyhole Limpet Hemocyanin (KLH) with detected particles

3D Maps of KLH Three-dimensional maps of KLH at a resolution of 23.5 Å reconstructed using particles extracted either manually or automatically as described in the text. (a), (b) The side- and top- view of a 3D map reconstructed from a set of 1042 manually selected particle images.

Processing in Stage 1 for KLH Canny edge detection. A sequence of ordered Hough transforms (HTs) is applied in order from the computationally simplest one to the most complex one. Edges covered by the detected shapes are removed immediately from edge images following the application of the last HT. Image Edge Detection Circle Detection Circle Coords. Remove Circles Rect. Coords. Rectangle Detection Candidate Particles

Picking KLH Particles in Stage 1 Zhu et al., IEEE Transactions on Medical Imaging, 2003

Line Fitting

(x i,y i ) Problem: minimize Line Fitting Given n points (x i, y i ), estimate parameters of line ax i + by i -d = 0 subject to the constraint that a 2 + b 2 = 1 Note: ax i + by i - d is distance from (x i, y i ) to line. Cost Function: Sum of squared distances between each point and the line with respect to (a,b,d). 1. Minimize E with respect to d: E 1 0 d d n n i 1 ax i by i ax by Where ( x, y) is the mean of the data points

Line Fitting 2. Substitute d back into E where where n=(a b) T. 3. Minimize E= Un 2= n T U T Un=n T Sn with respect to a, b subject to the constraint n T n = 1. Note that S is given by S = which is real, symmetric, and positive definite

Line Fitting 4. This is a constrained optimization problem in n. Solve with Lagrange multiplier L(n) = n T Sn (n T n 1) Take partial derivative (gradient) w.r.t. n and set to 0. L = 2Sn n = 0 or Sn = n n=(a,b) is an Eigenvector of the symmetric matrix S (the one corresponding to the smallest Eigenvalue). 5. d is computed from Step 1.

RANSAC Slides shamelessly taken from Frank Dellaert and Marc Pollefeys and modified

Fitting a straight line Simpler Example Inliers Outliers

No point with d > t RANSAC: Discard Outliers RANdom SAmple Consensus Fischler & Bolles 1981 Copes with a large proportion of outliers

Main Idea Select 2 points at random Fit a line Support = number of inliers Line with most inliers wins

Why will this work? Best line has most support More support -> better fit

RANSAC Objective Robust fit of model to data set S which contains outliers Algorithm (i) Randomly select a sample of s data points from S and instantiate the model from this subset. (ii) Determine the set of data points S i which are within a distance threshold t of the model. The set S i is the consensus set of samples and defines the inliers of S. (iii) If the size of S i is greater than some threshold T, reestimate the model using all the points in S i and terminate (iv) If the size of S i is less than T, select a new subset and repeat the above. (v) After N trials the largest consensus set S i is selected, and the model is re-estimated using all the points in the subset S i

Number of trials Choose N (number of trials) so that, with probability p, at least one random sample is free from outliers. e.g., p=0.99 1 1 e s N 1 p N log 1 p /log 1 1 e e: proportion of outliers s: Number of points needed for the model s proportion of outliers e s 5% 10% 20% 25% 30% 40% 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

Number of inliers threshold Typically, terminate when inlier ratio reaches expected ratio of inliers N (number of trials) e proportion of outliers T 1 e N

Distance threshold Choose threshold t so probability for inlier is α (e.g., 0.95) Often empirically 2 Zero-mean Gaussian noise σ then d follows 2 distribution with m=codimension of model m (codimension=dimension of space dimension of subspace) Codimension Model t 2 1 E, F, 2D line 3.84σ 2 2 P 5.99σ 2

Using RANSAC to estimate the Fundamental Matrix What is the model? What is the sample size and where do the samples come from? What distance do we use to compute the consensus set? How often do outliers occur?

Other models 2D motion models Typically: points in two images Candidates: Translation Euclidean Similarity Affine Projective

Feature Detection and Matching Input Images

Feature Detection and Matching Detected Corners

Feature Detection and Matching Simple Matching

Feature Detection and Matching Simple Matching Including Outlier Rejection

Mosaicing: Homography Estimate with RANSAC

Motion Reading: Next Lecture Section 10.6.1: Optical Flow and Motion Section 10.6.2: Flow Models Introductory Techniques for 3-D Computer Vision, Trucco and Verri Chapter 8: Motion