HOUGH TRANSFORM CS 6350 C V

Similar documents
Fitting: The Hough transform

Lecture 9: Hough Transform and Thresholding base Segmentation

Fitting: The Hough transform

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

Finding 2D Shapes and the Hough Transform

Lecture 15: Segmentation (Edge Based, Hough Transform)

Model Fitting: The Hough transform I

Fitting: The Hough transform

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

Computer Vision 6 Segmentation by Fitting

Lecture 8: Fitting. Tuesday, Sept 25

Straight Lines and Hough

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

Model Fitting: The Hough transform II

Lecture 4: Finding lines: from detection to model fitting

(Refer Slide Time: 0:32)

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

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

E0005E - Industrial Image Analysis

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

Pattern recognition systems Lab 3 Hough Transform for line detection

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

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

Elaborazione delle Immagini Informazione Multimediale. Raffaella Lanzarotti

Introduction. Chapter Overview

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

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

Chapter 11 Arc Extraction and Segmentation

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

Edge detection. Gradient-based edge operators

EECS 442 Computer vision. Fitting methods

OBJECT detection in general has many applications

RANSAC and some HOUGH transform

Edge Detection. EE/CSE 576 Linda Shapiro

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

CS 664 Image Matching and Robust Fitting. Daniel Huttenlocher

Massachusetts Institute of Technology. Department of Computer Science and Electrical Engineering /6.866 Machine Vision Quiz I

EECS490: Digital Image Processing. Lecture #20

Lecture 12 Level Sets & Parametric Transforms. sec & ch. 11 of Machine Vision by Wesley E. Snyder & Hairong Qi

Distance and Angles Effect in Hough Transform for line detection

Feature Detectors and Descriptors: Corners, Lines, etc.

Other Linear Filters CS 211A

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

Motion Detection. Final project by. Neta Sokolovsky

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

Matching and Tracking

Chapter - 2: Geometry and Line Generations

CPSC 425: Computer Vision

Image Processing and Computer Vision

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

Fitting D.A. Forsyth, CS 543

Graphics and Interaction Transformation geometry and homogeneous coordinates

CAP 5415 Computer Vision Fall 2012

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

Biomedical Image Analysis. Point, Edge and Line Detection

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

An Extension to Hough Transform Based on Gradient Orientation

Example 2: Straight Lines. Image Segmentation. Example 3: Lines and Circular Arcs. Example 1: Regions

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

Example 1: Regions. Image Segmentation. Example 3: Lines and Circular Arcs. Example 2: Straight Lines. Region Segmentation: Segmentation Criteria

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

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

Circular Hough Transform

Laboratory of Applied Robotics

EE368 Project Report CD Cover Recognition Using Modified SIFT Algorithm

CURVES OF CONSTANT WIDTH AND THEIR SHADOWS. Have you ever wondered why a manhole cover is in the shape of a circle? This

New Hough Transform-based Algorithm for Detecting L-shaped Linear Structures

Lecture 8 Fitting and Matching

An Automated Image-based Method for Multi-Leaf Collimator Positioning Verification in Intensity Modulated Radiation Therapy

Coarse-to-Fine Search Technique to Detect Circles in Images

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

Model Fitting. Introduction to Computer Vision CSE 152 Lecture 11

6. Object Identification L AK S H M O U. E D U

DETECTION AND ROBUST ESTIMATION OF CYLINDER FEATURES IN POINT CLOUDS INTRODUCTION

Generalized Hough Transform, line fitting

IOSR Journal of Electronics and communication Engineering (IOSR-JCE) ISSN: , ISBN: , PP:

Prof. Kristen Grauman

CS 231A Computer Vision (Fall 2012) Problem Set 3

18.02 Final Exam. y = 0

BIM472 Image Processing Image Segmentation

Example: Line fitting. Difficulty of line fitting. Fitting lines. Fitting lines. Fitting lines. Voting 9/22/2009

Computer Vision Lecture 6

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

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

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

ECG782: Multidimensional Digital Signal Processing

(Refer Slide Time: 00:02:00)

Edge and local feature detection - 2. Importance of edge detection in computer vision

SPECIAL TECHNIQUES-II

Line Drawing. Foundations of Computer Graphics Torsten Möller

LINEAR PROGRAMMING: A GEOMETRIC APPROACH. Copyright Cengage Learning. All rights reserved.

Background for Surface Integration

= f (a, b) + (hf x + kf y ) (a,b) +

Digital Image Processing Fundamentals

Feature Matching and Robust Fitting

Multivariable Calculus

Detecting Elliptic Objects Using Inverse. Hough{Transform. Joachim Hornegger, Dietrich W. R. Paulus. The following paper will appear in the

Robust Ring Detection In Phase Correlation Surfaces

Lecture 9 Fitting and Matching

The Three Dimensional Coordinate System

Transcription:

HOUGH TRANSFORM CS 6350 C V

HOUGH TRANSFORM The problem: Given a set of points in 2-D, find if a sub-set of these points, fall on a LINE.

Hough Transform One powerful global method for detecting edges (lines and parametric curves) is called the Hough transform. Let us suppose that we are looking for straight lines in an image. If we take a point (x',y') in the image, all lines which pass through that pixel have the form y' = m x' + c for varying values of m and c. See Figure below:

However, this equation can also be written as c = -x' m + y' where, we now consider x' and y' to be constants, and m and c as varying. This is a straight line on a graph of c against m as shown in Figure below: Each different line through the point (x', y') corresponds to one of the points on the line in (m, c) space (termed as Hough space).

Now consider two pixels p and q in (x, y) space which lie on the same line. For each pixel, all of the possible lines through it are represented by a single line in (m, c) ) space. Thus the single line in (x, y) space which goes through both pixels lies on the intersection ti of the two lines representing p and q in (m, c) ) space, as illustrated by Figure Identify the point <--> line correspondences interchangeably between these two spaces: Spatial coordinate and parametric (Hough).

However, this equation can also be written as c = -x' m + y' where, we now consider x' and y' to be constants, and m and c as varying. This is a straight line on a graph of c against m as shown in Figure below: Each different line through the point (x', y') corresponds to one of the points on the line in (m, c) space (termed as Hough space).

Taking this one step further, All pixels which h lie on the same line in (x, y) ) space are represented by lines which all pass through a single point in (m, c) ) space. The single point through which they all pass gives the values of m and c in the equation of the line: y = m x + c. The steps to detect straight lines in an image: 1. Quantize (m, c) space into a two-dimensional array A for appropriate steps of m and c. 2. Initialize all elements of A(m, (, c) ) to zero. 3. For each pixel (x', y') which lies on some edge in the image, we add 1 to all elements of A(m, c) ) whose indices m and c satisfy y' = m x' + c. Search for elements of A(m, c) which have large values -- Each one found corresponds to a line in the original image.

One useful property of the Hough transform is that the pixels, which lie on the line, need not all be contiguous. For example all of the pixels lying on the two dotted lines in For example, all of the pixels lying on the two dotted lines in Figure below, will be recognized as lying on the same straight line. This can be very useful when trying to detect lines with short breaks in them due to noise, or when objects are partially occluded as shown below:

Drawback: The figure above clearly demonstrates one disadvantage of the Hough transform method. It gives an infinite line as expressed by the pair of m and c values, rather than a finite line segment with two welldefined endpoints. One practical difficulty is that, the y = m x + c form for representing a straight line breaks down for vertical lines, when m becomes infinite. To avoid this problem, it is better to use the alternative formulation as given below: xcos +ysin =

To avoid this problem, it is better to use the alternative formulation as given below: xcos +ysin = What is the output in the p parametric ( space??

Note, however, that a point in (x, y) space is now represented by a curve in ( ) space rather than a straight line. Otherwise, the method is unchanged.

Two points in (x, y) space will now be represented by two different curves in ( ) space rather than straight lines. The intersection corresponds to the parameters of the line in (x, y) space, formed by joining those two points.

Find similarity with Radon Transform

Point Features Votes

Algorithm for HT Initialize all accumulator cells in H to Zeros For each edge pixel (x,y) in image For θ = -90 to 90 ρ = x cos θ + y sin θ ++ H(i θ,j ρ ); end end Find the value(s) of (θ, ρ)s, where H(i θ,j ρ )s are local maxima. Dt Detected tdli line(s) ()in the image are obtained bti using: ρ k = x cos θ k + y sin θ k ρ θ

For each data point, a number of lines are plotted going through it, all at different angles. These are shown as solid lines. For each solid line draw a line perpendicular to it from the origin. These are shown as dashed lines. The length and angle of each dashed line is measured. The results are shown in tables. This is repeated for each data point. A graph of length (R or Dist.) against angle, known as a Hough space graph, is then created. A case of implementation with three points: <--Construct an Construct an R-table from here

Presence of noise Features Votes Peak gets fuzzy and hard to locate

Random Noise Features Votes Noise produces spurious peaks in the accumulator array/r-table

Case of two Case of two thick lines

Original Edge Detected Image Detection Lines Parameter Space

In the Hough transform, feature points vote for all possibilities through that point. This can cause unwanted clutter in the accumulator and produce false matches/alarms (take large gradient edges only). Suppose that after we find the global maximum we remove all votes cast by feature points on or near the corresponding match in the image space. We can then continue the process by looking for the next largest global maximum, remembering it, and removing the votes from its points.

Operational tradeoffs for the Hough transform Issue of Resolution/Quantization of Accumulator cells: How big should the CELLS be? Too big - large votes obtained when too many different lines correspond to a single bucket and we merge quite different lines; Too small - miss lines, because some points that are not exactly collinear cast votes for different buckets; problem becomes adverse with noise.

Additional processing to create robustness in Hough transform Post-processing steps: A. How many lines? - Count the peaks in the Hough array - Treat adjacent peaks as a single peak - Smooth array, threshold and thin isolated clusters of bright spots B. Which points belong to each line? - Search for points close to the line - Solve again for line (use edge orientation) and iterate - Use a coarse to fine strategy

Other shapes Square Circular?

Hough Transform for Parametric Curves The Hough transform is not restricted to detecting straight lines, though that is a common use. The Hough transform can be used to detect other type of curves in an image as well as straight lines. Other geometrical shapes that can be described with a few parameters are also well suited to it. The Hough transform can be used to detect other type of curves in an image as well as straight lines. For example, if we wish to find circles, with equation: (x - a) 2 + (y - b) 2 = R 2 Then, A circle is specified with three parameters: the X and Y coordinates of its centre (a & b), and R, its radius. To find circles using a Hough transform, you need a three-dimensional accumulator array. Each Point in 2-D space yields (in 3-D Hough space) a: CONE

Each edge element votes for all the circles that it could lie on, and the 3-D array is searched for peaks that give circle positions and radii. If you happen to know the radius in advance, you only need a 2-D accumulator. Then, Every point in (x, y) space corresponds to a surface in (a, b, r) space (we can vary any two of the parameters a, b and r, the third is determined by the equation of the circle). The basic method is, thus, modified to use a three-dimensional Hough Space (3-D array) A(a, b, r). ) All points in it, which satisfy the equation for a circle, are incremented. Use of Gradient information at each pixel (edge), converts the problem to a 2-D problem (1-D search). Th C i l f i H h t t f d t The Conical surface in Hough space gets transformed to a: LINE

Use of Gradient information at each pixel (edge), converts the problem to a 2-D problem (1-D search). The Conical surface in Hough space gets transformed to a: LINE r(θ)

More complicated shapes can be found - a general ellipse, for example, needs a 5-D parameter space. So the method is really useful for simple and parametric curves. The concept of Hough space has been used in many other applications, wherever there is a scope of a search in multi- dimensional space. G (X, C) = 0 In practice, the technique takes rapidly increasing amounts of time for more complicated curves as the number of variables (and hence the number of dimensions of the array A) increases. The two other factors on which the time complexity depends are: the level of discretization (higher value necessary for more accuracy) number of feature points present in the input

The Generalized Hough Transform, introduced by D.H. Ballard in 1981, was a modification of the Hough Transform using the principle of template matching. This modification enables the Hough Transform to be used not only to detect an object described with an analytic equation (e.g. line, circle, etc), but also to detect an arbitrary object described with its model. The problem of finding the object (described with a model) in the image can be solved by finding the model's position in the image. In the Generalized Hough Transform, the problem of finding the model's position is transformed into a problem of finding the transformation parameter that maps the model onto the image. ^[1] D.H. Ballard, "Generalizing the Hough Transform to [ ], g g Detect Arbitrary Shapes", Pattern Recognition, Vol.13, No.2, p.111-122, 1981.

Generalized e ed 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 θ a R-table may have multiple entries for each p θ r(θ)

For model shape: construct a R-table 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 the reference point with most supporting edges (only translation invariant in 2-D). For scale and orientation invariance, first construct additional tables for all plausible discrete values of and s; as T s [R( )] and [R( hen vote for : p + r(θ,s)

4-D Hough space for GHT: S { a,, s } where a = (x a, y a ) denotes a reference origin for the shape, the shape's orientation, and s is a scalar scaling factor.

Hough transform: +ves All points are processed independently, so can cope with occlusion Some robustness to noise: noise points unlikely l to contribute t consistently to any single bin Can detect t multiple l instances of a model in a single pass

Hough transform: -ves 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