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

Similar documents
Template Matching Rigid Motion

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

Feature Detectors and Descriptors: Corners, Lines, etc.

Announcements. Recognition (Part 3) Model-Based Vision. A Rough Recognition Spectrum. Pose consistency. Recognition by Hypothesize and Test

Recognition (Part 4) Introduction to Computer Vision CSE 152 Lecture 17

Finding 2D Shapes and the Hough Transform

CS 534: Computer Vision 3D Model-based recognition

CS443: Digital Imaging and Multimedia Perceptual Grouping Detecting Lines and Simple Curves

Lecture 9: Hough Transform and Thresholding base Segmentation

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

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

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

Feature Matching and Robust Fitting

EECS 442 Computer vision. Fitting methods

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

CS664 Lecture #21: SIFT, object recognition, dynamic programming

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

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

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

What is Computer Vision?

Fitting: The Hough transform

Lecture 9 Fitting and Matching

Lecture 8 Fitting and Matching

Computer Vision 6 Segmentation by Fitting

Fitting: The Hough transform

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

EE795: Computer Vision and Intelligent Systems

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

CS 534: Computer Vision Segmentation and Perceptual Grouping

Fitting D.A. Forsyth, CS 543

Other Linear Filters CS 211A

Image warping and stitching

Model Fitting: The Hough transform I

CS 664 Image Matching and Robust Fitting. Daniel Huttenlocher

Introduction. Introduction. Related Research. SIFT method. SIFT method. Distinctive Image Features from Scale-Invariant. Scale.

HOUGH TRANSFORM CS 6350 C V

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

Object and Class Recognition I:

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

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

CS231A Midterm Review. Friday 5/6/2016

Sung-Eui Yoon ( 윤성의 )

Image warping and stitching

Lecture 15: Segmentation (Edge Based, Hough Transform)

Bayes Risk. Classifiers for Recognition Reading: Chapter 22 (skip 22.3) Discriminative vs Generative Models. Loss functions in classifiers

Fitting: The Hough transform

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

Classifiers for Recognition Reading: Chapter 22 (skip 22.3)

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

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

Homography estimation

Image warping and stitching

Correspondence. CS 468 Geometry Processing Algorithms. Maks Ovsjanikov

CS664 Lecture #16: Image registration, robust statistics, motion

Nearest Neighbor Classifiers

CS4670: Computer Vision

Matching and Tracking

Some material taken from: Yuri Boykov, Western Ontario

CAP 6412 Advanced Computer Vision

Instance-level recognition

Lecture 8: Fitting. Tuesday, Sept 25

OBJECT detection in general has many applications

CAP 5415 Computer Vision Fall 2012

arxiv: v1 [cs.cv] 2 May 2016

Visuelle Perzeption für Mensch- Maschine Schnittstellen

CMU-Q Lecture 4: Path Planning. Teacher: Gianni A. Di Caro

Generalized Hough Transform, line fitting

Perception IV: Place Recognition, Line Extraction

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

Object Recognition Using Pictorial Structures. Daniel Huttenlocher Computer Science Department. In This Talk. Object recognition in computer vision

EE795: Computer Vision and Intelligent Systems

Straight Lines and Hough

Review for the Final

References. Additional lecture notes for 2/18/02.

TA Section 7 Problem Set 3. SIFT (Lowe 2004) Shape Context (Belongie et al. 2002) Voxel Coloring (Seitz and Dyer 1999)

University of Cambridge Engineering Part IIB Module 4F12 - Computer Vision and Robotics Mobile Computer Vision

In what follows, we will focus on Voronoi diagrams in Euclidean space. Later, we will generalize to other distance spaces.

Stereo and Epipolar geometry

Joint Vanishing Point Extraction and Tracking. 9. June 2015 CVPR 2015 Till Kroeger, Dengxin Dai, Luc Van Gool, Computer Vision ETH Zürich

Computer Vision. Image Segmentation. 10. Segmentation. Computer Engineering, Sejong University. Dongil Han

3D Point Cloud Processing

Instance-level recognition

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

Object Category Detection: Sliding Windows

Hough Transform and RANSAC

INFO0948 Fitting and Shape Matching

Category vs. instance recognition

Matching of Stereo Curves - A Closed Form Solution

Mathematical Morphology and Distance Transforms. Robin Strand

Image Processing: Final Exam November 10, :30 10:30

Augmented Reality VU. Computer Vision 3D Registration (2) Prof. Vincent Lepetit

Optimal Grouping of Line Segments into Convex Sets 1

Bitangent 3. Bitangent 1. dist = max Region A. Region B. Bitangent 2. Bitangent 4

Polygonal Approximation of Closed Contours

Robotics Programming Laboratory

Matching. Compare region of image to region of image. Today, simplest kind of matching. Intensities similar.

Object Recognition with Invariant Features

CPSC 425: Computer Vision

Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

IN5520 Digital Image Analysis. Two old exams. Practical information for any written exam Exam 4300/9305, Fritz Albregtsen

Transcription:

Template Matching Rigid Motion Find transformation to align two images. Focus on geometric features (not so much interesting with intensity images) Emphasis on tricks to make this efficient. Problem Definition An Image is a set of 2D geometric features, along with positions. An Object is a set of 2D/3D geometric features, along with positions. A pose positions the object relative to the image. 2D Translation; 2D translation + rotation; 2D translation, rotation and scale; planar or 3D object positioned in 3D with perspective or scaled orth. The best pose places the object features nearest the image features 1

Two parts to the problem Definition of cost function. Search method for finding best pose. 1. Can phrase this as search among poses. 2. Or as search among correspondences 3. There are connections between two. Example 2

Cost Function We look at this first, since it defines the problem. Again, no perfect measure; Trade-offs between veracity of measure and computational considerations. One-to-one vs. many-to-one Bounded error vs. metric Example: Chamfer Matching Many-to-one, distance For every edge point in the transformed object, compute the distance to the nearest image edge point. Sum distances. d i min(, q, p, q i 2 n i p p q 1 i 1 i m,, ) 3

Main Feature: Every model point matches an image point. An image point can match 0, 1, or more model points. Variations Sum a different distance f(d) = d 2 or Manhattan distance. f(d) = 1 if d < threshold, 0 otherwise. This is called bounded error. Use maximum distance instead of sum. This is called: directed Hausdorff distance. Use other features Corners. Lines. Then position and angles of lines must be similar. Model line may be subset of image line. 4

Other comparisons Enforce each image feature can match only one model feature. Enforce continuity, ordering along curves. These are more complex to optimize. Pose Search: Standard Optimization Heuristics Brute force search with dense sampling. Random starting point + gradient descent. Multiple random starting points Stochastic gradient descent Any other optimization method you can think of. 5

Clever Idea 1: Chamfer Matching with the Distance Transform 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 3 2 1 0 1 3 4 3 2 1 0 1 Example: Each pixel has (Manhattan) distance to nearest edge pixel. D.T. Adds Efficiency Compute once. Fast algorithms to compute it. Makes Chamfer Matching simple. 6

Then, try all translations of model edges. Add distances under each edge pixel. That is, correlate edges with Distance Transform 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 3 2 1 0 1 3 4 3 2 1 0 1 Computing Distance Transform It s only done once, per problem, not once per pose. Basically a shortest path problem. Simple solution passing through image once for each distance. First pass mark edges 0. Second, mark 1 anything next to 0, unless it s already marked. Etc. Actually, a more clever method requires 2 passes. 7

Chamfer Matching Complexity Brute force approach: for each pose, compare each model point to every image point. O(pnm). p = number poses, n = number of image points, m = number of model points. With distance transform: compute D.T., then for every pose, sum value under each model edge. O(s + pm). s = number of pixels, which is about same as p. Clever Idea 2: Ransac Match enough features in model to features in image to determine pose. Examples: match a point and determine translation. match a corner and determine translation and rotation. Points and translation, rotation, scaling? Lines and rotation and translation? 8

(Forsyth & Ponce) 9

Complexity Suppose model has m points and image has n points. There are nm matches. When we match a model point, there is a 1/n probability this match is right. If we match k model points, probability all are right is approximately (1/n) k. If we repeat this L times, probability that at least one pose is right is: k 1 L 1 (1 n ) Figure from Object recognition using alignment, D.P. Huttenlocher and S. Ullman, Proc. Int. Conf. Computer Vision, 1986, copyright IEEE, 1986 10

The Hough Transform for Lines A line is the set of points (x, y) such that: y = mx + b For any (x, y) there is a line in (m,b) space describing the lines through this point. Just let (x,y) be constants and m, b be unknowns. Each point gets to vote for each line in the family; if there is a line that has lots of votes, that should be the line passing through the points Mechanics of the Hough transform Construct an array representing m, b For each point, render the line y=mx+b into this array, adding one at each cell Questions how big should the cells be? (too big, and we cannot distinguish between quite different lines; too small, and noise causes lines to be missed) How many lines? count the peaks in the Hough array Who belongs to which line? tag the votes Can modify voting, peak finding to reflect noise. Big problem if noise in Hough space different from noise in image space. 11

Generalized Hough Transform Some pros and cons Run-time for line finding Complexity of RANSAC n*n*n Complexity of Hough n*d 12

Error behavior Hough handles error with buckets. This gives a larger set of lines consistent with point, but adhoc. Ransac handles error with threshold. Wellmotivated for error in other points, but not for error in first 2 points. But works if we find some 2 points w/ low error. Error handling sloppy -> clutter bigger problem. Many variations to handle these issues. Pose: Generalized Hough Transform Like Hough Transform, but for general shapes. Example: match one point to one point, and for every rotation of the object its translation is determined. Example: match enough features to determine pose, then vote for best pose. 13

Correspondence: Interpretation Tree Search Represent all possible sets of matches as exponential sized tree. Each node involves another match Wildcard allowed for no matches. Prune tree when set of matches incompatible (this seems to imply bounded error). Trick: some fast way of evaluating compatability. Trick: different tree search algorithms. Best first. A*. 2D Euclidean Transformation Check pairwise compatibility Fast Conservative test a m n 14

Cass: Correspondence pose duality Suppose we match two features with bounded error. There is a set of transformations that fit. For nm matches, nm sets. As these intersect, they carve transformation space into regions. Within a region, feasible matches are the same. If sets are convex, #regions is limited. If everything is linear, this becomes easier. Example: points, 2D translation L-infinity norm 15

Every cell is bounded by axial lines. Must contain point where two lines intersect. No more than (nm) 2 cells. If we sample points where all pairs of lines intersect, we sample all cells. General case Can extend to any linear transformation and convex, polygonal error bound. Every model point and every error line lead to hyperplane in transformation space. These divide transformation space into convex cells. Each has vertices at intersection of d hyperplanes. Complexity (mn) d 16

Can also mix and match Alignment, then tree search. continue to add feasible additional matches. Greedy heuristics RANSAC + distance transform Summary All these methods exponential in dimension of transformation. Clever & effective for translation, 2D euclidean. Too slow for 3D to 2D recognition Grouping heuristics Roberts group quadrilaterals, then alignment. Lowe Perceptually salient grouping based on parallelism, proximity,. 17