Straight Lines and Hough

Similar documents
Fitting: The Hough transform

Fitting: The Hough transform

Fitting: The Hough transform

Model Fitting: The Hough transform I

Hough Transform and RANSAC

Edge Detection. Computer Vision Shiv Ram Dubey, IIIT Sri City

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

Feature Matching and Robust Fitting

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

CS5670: Computer Vision

Lecture 4: Finding lines: from detection to model fitting

Review of Filtering. Filtering in frequency domain

Edge and Texture. CS 554 Computer Vision Pinar Duygulu Bilkent University

Edge detection. Goal: Identify sudden. an image. Ideal: artist s line drawing. object-level knowledge)

Edge Detection. EE/CSE 576 Linda Shapiro

Lecture 9: Hough Transform and Thresholding base Segmentation

Edge Detection CSC 767

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

Finding 2D Shapes and the Hough Transform

HOUGH TRANSFORM CS 6350 C V

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

Edge and corner detection

Segmentation I: Edges and Lines

DIGITAL IMAGE PROCESSING

Edges and Binary Images

Edge detection. Winter in Kraków photographed by Marcin Ryczek

Edge detection. Winter in Kraków photographed by Marcin Ryczek

Multi-stable Perception. Necker Cube

Solution: filter the image, then subsample F 1 F 2. subsample blur subsample. blur

Edge detection. Gradient-based edge operators

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

EECS 442 Computer vision. Fitting methods

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

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

Lecture 8: Fitting. Tuesday, Sept 25

Biomedical Image Analysis. Point, Edge and Line Detection

CS4670: Computer Vision Noah Snavely

What is an edge? Paint. Depth discontinuity. Material change. Texture boundary

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

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

Other Linear Filters CS 211A

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

Lecture 7: Most Common Edge Detectors

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

Feature Tracking and Optical Flow

EE795: Computer Vision and Intelligent Systems

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

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

Prof. Feng Liu. Winter /15/2019

Lecture 9 Fitting and Matching

Practical Image and Video Processing Using MATLAB

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

Lecture 8 Fitting and Matching

Lecture 6: Edge Detection

Lecture 15: Segmentation (Edge Based, Hough Transform)

Edge Detection (with a sidelight introduction to linear, associative operators). Images

Feature Tracking and Optical Flow

Feature Detectors and Descriptors: Corners, Lines, etc.

Instance-level recognition

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

Perception IV: Place Recognition, Line Extraction

EN1610 Image Understanding Lab # 3: Edges

Anno accademico 2006/2007. Davide Migliore

EECS490: Digital Image Processing. Lecture #20

Edges and Binary Image Analysis. Thurs Jan 26 Kristen Grauman UT Austin. Today. Edge detection and matching

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Edge Detection. CSC320: Introduction to Visual Computing Michael Guerzhoy. René Magritte, Decalcomania. Many slides from Derek Hoiem, Robert Collins

Does everyone have an override code?

Filtering Applications & Edge Detection. GV12/3072 Image Processing.

Photo by Carl Warner

Image gradients and edges

Instance-level recognition

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Local Image preprocessing (cont d)

[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

Digital Image Processing. Image Enhancement - Filtering

Pattern recognition systems Lab 3 Hough Transform for line detection

Templates, Image Pyramids, and Filter Banks

Image Analysis. Edge Detection

E0005E - Industrial Image Analysis

Image gradients and edges April 11 th, 2017

Homography estimation

Image gradients and edges April 10 th, 2018

Filtering in frequency domain

Low-level Vision Processing Algorithms Speaker: Ito, Dang Supporter: Ishii, Toyama and Y. Murakami

Image Analysis. Edge Detection

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

Edge Detection. CMPUT 206: Introduction to Digital Image Processing. Nilanjan Ray. Source:

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Prof. Kristen Grauman

EE795: Computer Vision and Intelligent Systems

Computer Vision. Recap: Smoothing with a Gaussian. Recap: Effect of σ on derivatives. Computer Science Tripos Part II. Dr Christopher Town

Filters (cont.) CS 554 Computer Vision Pinar Duygulu Bilkent University

Edge Detection. CS664 Computer Vision. 3. Edges. Several Causes of Edges. Detecting Edges. Finite Differences. The Gradient

Computer Vision I. Announcement. Corners. Edges. Numerical Derivatives f(x) Edge and Corner Detection. CSE252A Lecture 11

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

Edge linking. Two types of approaches. This process needs to be able to bridge gaps in detected edges due to the reason mentioned above

Boundaries and Sketches

Image Processing

Edge Detection. Today s reading. Cipolla & Gee on edge detection (available online) From Sandlot Science

Transcription:

09/30/11 Straight Lines and Hough Computer Vision CS 143, Brown James Hays Many slides from Derek Hoiem, Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li

Project 1 A few project highlights Common mistakes Gaussian pyramid stores blurred images. Laplacian pyramid doesn t have all the information needed for correct reconstruction. Absolute paths in source code or html Many of the results not very convincing because high and low frequencies are too different

Project 2 Questions?

Canny edge detector 1. Filter image with x, y derivatives of Gaussian 2. Find magnitude and orientation of gradient 3. Non-maximum suppression: Thin multi-pixel wide ridges down to single pixel width 4. Thresholding and linking (hysteresis): Define two thresholds: low and high Use the high threshold to start edge curves and the low threshold to continue them MATLAB: edge(image, canny ) Source: D. Lowe, L. Fei-Fei

Finding straight lines One solution: try many possible lines and see how many points each line passes through Hough transform provides a fast way to do this

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 Image space Hough parameter space P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959

Parameter space representation A line in the image corresponds to a point in Hough space Image space Hough 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 space Hough 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 space Hough parameter space

Parameter space representation Where is the line that contains both (x 0, y 0 ) and (x 1, y 1 )? Image space Hough parameter space (x 1, y 1 ) (x 0, y 0 ) 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 space Hough parameter space (x 1, y 1 ) (x 0, y 0 ) b = x 1 m + y 1

Parameter space representation 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 x cos y sin 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 θ

Basic illustration features votes

Other shapes Square Circle

Several lines

A more complicated image http://ostatic.com/files/images/ss_hough.jpg

Effect of noise features votes

Effect of noise features Peak gets fuzzy and hard to locate votes

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

Dealing with noise 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) Try to get rid of irrelevant features Take only edge points with significant gradient magnitude

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 y image space Hough parameter space r ( x, y) r I( x, y) (x,y) ( x, y) r I( x, y) x x y

Hough transform for circles Conceptually equivalent procedure: for each (x,y,r), draw the corresponding circle in the image and compute its support r y x Is this more or less efficient than voting with features?

Finding straight lines Another solution: get connected components of pixels and check for straightness

Finding line segments using connected components 1. Compute canny edges Compute: gx, gy (DoG in x,y directions) Compute: theta = atan(gy / gx) 2. Assign each edge to one of 8 directions 3. For each direction d, get edgelets: find connected components for edge pixels with directions in {d-1, d, d+1} 4. Compute straightness and theta of edgelets using eig of x,y 2 nd moment matrix of their points M 2 x x x x y y 2 x x y y y y [ v, λ] eig( Μ) 5. Threshold on straightness, store segment atan 2( v(2,2), v(1,2)) conf Larger eigenvector 2 / 1 Slides from Derek Hoiem

1. Image Canny

2. Canny lines straight edges

Comparison Hough Transform Method Connected Components Method

Things to remember Canny edge detector = smooth derivative thin threshold link Generalized Hough transform = points vote for shape parameters Straight line detector = canny + gradient orientations orientation binning linking check for straightness

Next classes Generalized Hough Transform Fitting and Registration EM (mixture models)

Questions