Hough Transform CS 691 E Spring 2016. Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.

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

Feature Matching and Robust Fitting Computer Vision CS 143, Brown James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe 2008 AAAI Tutorial.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Image alignment Image from
Fitting: The Hough transform
Lecture 5 Hough transform and RANSAC
CS 558 C OMPUTER V ISION Lecture VIII: Fitting, RANSAC, and Hough Transform Adapted from S. Lazebnik.
1 Model Fitting Hao Jiang Computer Science Department Oct 6, 2009.
1 Image Recognition - I. Global appearance patterns Slides by K. Grauman, B. Leibe.
Image alignment.
1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.
Fitting a Model to Data Reading: 15.1,
Object Recognition Using Geometric Hashing
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.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Fitting & Matching Lectures 7 & 8 – Prof. Fergus Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.
Fitting and Registration
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.
Computer Vision - Fitting and Alignment
Computer Vision More Image Features Hyunki Hong School of Integrative Engineering.
Fitting and Registration Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/14/12.
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.
HOUGH TRANSFORM Presentation by Sumit Tandon
Photo by Carl Warner. Feature Matching and Robust Fitting Computer Vision James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe.
Fitting : Voting and the Hough Transform Monday, Feb 14 Prof. Kristen Grauman UT-Austin.
Object Detection 01 – Advance Hough Transformation JJCAO.
CS 1699: Intro to Computer Vision Matching and Fitting Prof. Adriana Kovashka University of Pittsburgh September 29, 2015.
Generalized Hough Transform
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
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.
EECS 274 Computer Vision Model Fitting. Fitting Choose a parametric object/some objects to represent a set of points Three main questions: –what object.
Fitting Thursday, Sept 24 Kristen Grauman UT-Austin.
1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.
Computer Vision - Fitting and Alignment (Slides borrowed from various presentations)
Object Detection 01 – Basic Hough Transformation JJCAO.
Hough Transform Procedure to find a shape in an image Shape can be described in parametric form Shapes in image correspond to a family of parametric solutions.
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.
Fitting : Voting and the Hough Transform Thursday, September 17 th 2015 Devi Parikh Virginia Tech 1 Slide credit: Kristen Grauman Disclaimer: Many slides.
CS 2750: Machine Learning Linear Regression Prof. Adriana Kovashka University of Pittsburgh February 10, 2016.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Detecting Image Features: Corner. Corners Given an image, denote the image gradient. C is symmetric with two positive eigenvalues. The eigenvalues give.
CS 558 C OMPUTER V ISION Fitting, RANSAC, and Hough Transfrom Adapted from S. Lazebnik.
1 Hough Transform. 2 A Technique to Isolate Features of a Particular Shape within an Image The classical Hough transform is most commonly used for the.
776 Computer Vision Jan-Michael Frahm Spring 2012.
CS 2770: Computer Vision Fitting Models: Hough Transform & RANSAC
Segmentation by fitting a model: Hough transform and least squares
Fitting: Voting and the Hough Transform
Fitting.
Line Fitting James Hayes.
Fitting: The Hough transform
Fitting: Voting and the Hough Transform (part 2)
A special case of calibration
Fitting: Voting and the Hough Transform April 24th, 2018
Photo by Carl Warner.
Prof. Adriana Kovashka University of Pittsburgh October 19, 2016
Photo by Carl Warner.
776 Computer Vision Jan-Michael Frahm.
CSE 185 Introduction to Computer Vision
Presentation transcript:

Hough Transform CS 691 E Spring 2016

Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik

Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not vote consistently for any single model Missing data doesn’t matter as long as there are enough features remaining to agree on a good model

Hough transform An early type of voting scheme General outline: – Discretize parameter space into bins – For each feature point in the image, put a vote in every bin in the parameter space that could have generated this point – Find bins that have the most votes P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959 Image space Hough parameter space

Parameter space representation A line in the image corresponds to a point in Hough space Image spaceHough parameter space Source: S. Seitz

Parameter space representation What does a point (x 0, y 0 ) in the image space map to in the Hough space? Image spaceHough parameter space

Parameter space representation What does a point (x 0, y 0 ) in the image space map to in the Hough space? – Answer: the solutions of b = –x 0 m + y 0 – This is a line in Hough space Image spaceHough parameter space

Parameter space representation Where is the line that contains both (x 0, y 0 ) and (x 1, y 1 )? Image spaceHough parameter space (x 0, y 0 ) (x 1, y 1 ) b = –x 1 m + y 1

Parameter space representation Where is the line that contains both (x 0, y 0 ) and (x 1, y 1 )? – It is the intersection of the lines b = –x 0 m + y 0 and b = –x 1 m + y 1 Image spaceHough parameter space (x 0, y 0 ) (x 1, y 1 ) b = –x 1 m + y 1

Problems with the (m,b) space: – Unbounded parameter domain – Vertical lines require infinite m Parameter space representation

Problems with the (m,b) space: – Unbounded parameter domain – Vertical lines require infinite m Alternative: polar representation Parameter space representation Each point will add a sinusoid in the ( ,  ) parameter space

Algorithm outline Initialize accumulator H to all zeros For each edge point (x,y) in the image For θ = 0 to 180 ρ = x cos θ + y sin θ H(θ, ρ) = H(θ, ρ) + 1 end end Find the value(s) of (θ, ρ) where H(θ, ρ) is a local maximum – The detected line in the image is given by ρ = x cos θ + y sin θ ρ θ

features votes Basic illustration

Square Circle Other shapes

Several lines

featuresvotes Effect of noise

featuresvotes Effect of noise Peak gets fuzzy and hard to locate

Effect of noise Number of votes for a line of 20 points with increasing noise:

Random points Uniform noise can lead to spurious peaks in the array featuresvotes

Random points As the level of uniform noise increases, the maximum number of votes increases too:

Practical details Try to get rid of irrelevant features – Take only edge points with significant gradient magnitude Choose a good grid / discretization – Too coarse: large votes obtained when too many different lines correspond to a single bucket – Too fine: miss lines because some points that are not exactly collinear cast votes for different buckets Increment neighboring bins (smoothing in accumulator array) Who belongs to which line? – Tag the votes

Hough transform: Pros Can deal with non-locality and occlusion Can detect multiple instances of a model in a single pass Some robustness to noise: noise points unlikely to contribute consistently to any single bin

Hough transform: Cons Complexity of search time increases exponentially with the number of model parameters Non-target shapes can produce spurious peaks in parameter space It’s hard to pick a good grid size

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

Hough transform for circles How many dimensions will the parameter space have? Given an oriented edge point, what are all possible bins that it can vote for?

Hough transform for circles Conceptually equivalent procedure: for each (x,y,r), draw the corresponding circle in the image and compute its “support” x y r What is more efficient: going from the image space to the parameter space or vice versa?

Generalized Hough transform We want to find a shape defined by its boundary points and a reference point D. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, Pattern Recognition 13(2), 1981, pp Generalizing the Hough Transform to Detect Arbitrary Shapes a

p Generalized Hough transform We want to find a shape defined by its boundary points and a reference point For every boundary point p, we can compute the displacement vector r = a – p as a function of gradient orientation θ D. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, Pattern Recognition 13(2), 1981, pp Generalizing the Hough Transform to Detect Arbitrary Shapes a θ r(θ)

Generalized Hough transform For model shape: construct a table indexed by θ storing displacement vectors r as function of gradient direction Detection: For each edge point p with gradient orientation θ: – Retrieve all r indexed with θ – For each r(θ), put a vote in the Hough space at p + r(θ) Peak in this Hough space is reference point with most supporting edges Assumption: translation is the only transformation here, i.e., orientation and scale are fixed Source: K. Grauman

Example model shape

Example displacement vectors for model points

Example range of voting locations for test point

Example range of voting locations for test point

Example votes for points with θ =

Example displacement vectors for model points

Example range of voting locations for test point

votes for points with θ = Example

Application in recognition Instead of indexing displacements by gradient orientation, index by “visual codeword” B. Leibe, A. Leonardis, and B. Schiele, Combined Object Categorization and Segmentation with an Implicit Shape Model, ECCV Workshop on Statistical Learning in Computer Vision 2004Combined Object Categorization and Segmentation with an Implicit Shape Model training image visual codeword with displacement vectors

Application in recognition Instead of indexing displacements by gradient orientation, index by “visual codeword” B. Leibe, A. Leonardis, and B. Schiele, Combined Object Categorization and Segmentation with an Implicit Shape Model, ECCV Workshop on Statistical Learning in Computer Vision 2004Combined Object Categorization and Segmentation with an Implicit Shape Model test image

Homography The transformation between two views of a planar surface The transformation between images from two cameras that share the same center

Fitting a homography Recall: homogenenous coordinates Converting to homogenenous image coordinates Converting from homogenenous image coordinates

Fitting a homography Recall: homogenenous coordinates Equation for homography: Converting to homogenenous image coordinates Converting from homogenenous image coordinates

Fitting a homography Equation for homography: 3 equations, only 2 linearly independent 9 entries, 8 degrees of freedom (scale is arbitrary)

Direct linear transform H has 8 degrees of freedom (9 parameters, but scale is arbitrary) One match gives us two linearly independent equations Four matches needed for a minimal solution (null space of 8x9 matrix) More than four: homogeneous least squares

Application: Panorama stitching

Recognizing panoramas M. Brown and D. Lowe, “Recognizing Panoramas,” ICCV 2003.“Recognizing Panoramas,” Given contents of a camera memory card, automatically figure out which pictures go together and stitch them together into panoramas