Pattern recognition systems Lab 3 Hough Transform for line detection

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

HOUGH TRANSFORM CS 6350 C V

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

Straight Lines and Hough

Edge detection. Gradient-based edge operators

Edge Detection. EE/CSE 576 Linda Shapiro

Computer Vision 6 Segmentation by Fitting

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

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

E0005E - Industrial Image Analysis

HOUGH TRANSFORM FOR INTERIOR ORIENTATION IN DIGITAL PHOTOGRAMMETRY

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

Fitting: The Hough transform

EECS490: Digital Image Processing. Lecture #20

Finding 2D Shapes and the Hough Transform

Model Fitting. Introduction to Computer Vision CSE 152 Lecture 11

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

Lecture 15: Segmentation (Edge Based, Hough Transform)

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

Model Fitting: The Hough transform I

EECS 442 Computer vision. Fitting methods

Feature Matching and Robust Fitting

Automated Detection for Baseball Batter Analysis Using Image Processing and Segmentation Methods

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

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

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

CAP 5415 Computer Vision Fall 2012

EECS490: Digital Image Processing. Lecture #21

International Journal of Advance Engineering and Research Development. Iris Recognition and Automated Eye Tracking

Object Shape Recognition in Image for Machine Vision Application

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

Lecture 9: Hough Transform and Thresholding base Segmentation

Lecture 8: Fitting. Tuesday, Sept 25

Computer and Machine Vision

Introduction. Chapter Overview

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

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

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

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

Fitting: The Hough transform

Fitting: The Hough transform

Filtering Images. Contents

Distance and Angles Effect in Hough Transform for line detection

Part-Based Skew Estimation for Mathematical Expressions

An Extension to Hough Transform Based on Gradient Orientation

A Review of Skew Detection Techniques for Document

LANE DEPARTURE WARNING SYSTEM FOR VEHICLE SAFETY

RANSAC and some HOUGH transform

Lecture 7: Most Common Edge Detectors

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

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

Lecture 4: Finding lines: from detection to model fitting

On a fast discrete straight line segment detection

A GPU based Real-Time Line Detector using a Cascaded 2D Line Space

Edge and corner detection

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

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

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

OBJECT detection in general has many applications

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

Image Segmentation Image Thresholds Edge-detection Edge-detection, the 1 st derivative Edge-detection, the 2 nd derivative Horizontal Edges Vertical

EE368 Project Report CD Cover Recognition Using Modified SIFT Algorithm

Laboratory of Applied Robotics

Motion Detection. Final project by. Neta Sokolovsky

Generalized Hough Transform, line fitting

Segmentation I: Edges and Lines

ENV Laboratory 2: Graphing

Chapter 11 Arc Extraction and Segmentation

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

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

Chapter - 2: Geometry and Line Generations

EDGE EXTRACTION ALGORITHM BASED ON LINEAR PERCEPTION ENHANCEMENT

(Refer Slide Time: 0:32)

Circular Hough Transform

Auto-Digitizer for Fast Graph-to-Data Conversion

Computer Science Faculty, Bandar Lampung University, Bandar Lampung, Indonesia

EE795: Computer Vision and Intelligent Systems

Elaborazione delle Immagini Informazione Multimediale. Raffaella Lanzarotti

CS 664 Image Matching and Robust Fitting. Daniel Huttenlocher

Edge Detection Using Streaming SIMD Extensions On Low Cost Robotic Platforms

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

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

Direction Fields; Euler s Method

FPGA IMPLEMENTATION FOR REAL TIME SOBEL EDGE DETECTOR BLOCK USING 3-LINE BUFFERS

Image Processing and Computer Vision

Feature Detectors and Descriptors: Corners, Lines, etc.

Detecting square-shaped objects using the Hough transform

CIRCULAR MOIRÉ PATTERNS IN 3D COMPUTER VISION APPLICATIONS

ECG782: Multidimensional Digital Signal Processing

Fast Road Sign Detection Using Hough Transform for Assisted Driving of Road Vehicles

AN APPROACH FOR GENERIC DETECTION OF CONIC FORM

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

Model Fitting: The Hough transform II

Perception IV: Place Recognition, Line Extraction

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

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

EN1610 Image Understanding Lab # 3: Edges

Image Processing

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

Transcription:

Pattern recognition systems Lab 3 Hough Transform for line detection 1. Objectives The main objective of this laboratory session is to implement the Hough Transform for line detection from edge images. 2. Theoretical overview The classical Hough transform is a method that solves an important image processing problem: finding lines in an image that contains a set of interest points. The straightforward method of computing lines from each pair of points has an increased computational complexity of O(n 2 ), and is unusable for a large number of points. The Hough transform was first proposed and patented by Peter Hough [Hou62]. It is a realtime method to count how many points are placed on each possible line in the image. It relies on the representation of the lines in the slope-intercept form (y=ax+b), and on building the line parameter space, also called Hough accumulator. For each image interest point, all possible lines are considered, and the corresponding elements in the line parameter space are incremented. Relevant image lines are located at the locations of the local ima in the line parameter space. The initial proposal was focused on the detection of lines in video images, based on a slope and free-term line representation. This representation is not optimal because it is not bounded: in order to represent all the possible lines in an image, the slope and the intercept terms should vary between - and +. The work of Duda and Hart [Dud72] made the Hough transform more popular in the computer vision field. The main problem of the original Hough transform (unbounded parameters) is solved by using the so-called normal parameterization. The normal parameterization of a line consists of representing the line by the normal vector and the distance from origin to the line along its direction. The normal representation (1) is commonly referred to as the - representation (Fig. 1). Fig. 1. Line represented by its normal vector at angle and the distance along the normal vector from the origin to the line.

The equation satisfied by a point (x,y) is then given by: xcos( ) ysin( ) (1) Parameter quantization plays an important role in decreasing the computational complexity of the method. Quantization determines the size of the Hough accumulator. For each of the two line parameters a quantization level must be established, depending on the desired accuracy (ex. the accuracy of can be of 10, 1, 0.5 pixels etc, the accuracy of can be of 10 deg, 1 deg, 0.5 deg etc). The parameters and have a limited range considering the fact that an image has a limited size. The imum value for is the diagonal of the image. Depending on the interval selected for, there are mainly two equivalent configurations for the line parameter range. The first one is proposed in the original work and we will employ the second one: 1. [ 90,90 ) or [0,180 ), [, ] 2. [0,360 ), [0, ] (2) Let us assume that the Hough accumulator H represents the quantized line parameter space. The quantization steps for and are and respectively. Their imum values are and. The accumulator will have a size of ( / x / ). H is built with the following simple steps: 1. Initialize H with 0. 2. For each edge point P(x, y) compute all possible lines and increment the associated locations from H: for each from to (with a step of compute xcos( ) ysin( ) if [0, ] increment H( end for The increment operation of a Hough location can also be weighted, if different weights are desired for each interest point. Once the accumulator is built, relevant lines are extracted as the local peaks of the accumulator. Local peaks are found at places where the accumulator is larger than all neighboring cell. An example of line detection based on the Hough transform is presented below (Fig. 2). The parameter ranges for this example are [0, 360) degrees for, [0, 144] pixels for. The parameter accuracy is 1 degree for and 1 pixel for. Choosing the correct level of quantization is important. If the quantization is too fine, then the resolution increases, but so does the processing time, and also the chance that collinear points will fall into different accumulator bins (this might cause multiple detections and the fragmentation of certain lines).

a. b. c. d. e. Fig. 2. a. An image containing a pattern with straight borders corrupted by salt-and-pepper like noise, b. The edges detected with the Canny edge detector, c. The most relevant image lines are displayed with green, associated to the most relevant 8 peaks from the Hough accumulator, d. The Hough accumulator displayed using an intensity encoding, e. The Hough accumulator displayed in 3D, using color encoding. Although the Hough transform is widely used for line detection, it can also work with more complex curves as long as an adequate parameterization is available. Duda and Hart [Dud72] also proposed the detection of circles based on the Hough transform. In this case a 3D parameter space is needed and each interest point is transformed into a right circular cone in the parameter space (all the possible circles containing the point). Later, Ballard generalized the Hough transform to detect arbitrary non-analytical shapes [Bal81].

3. Implementation Details Use the simplest configuration for parameter quantization: 1 pixel for and 1 degree for. Use the second option for the parameters range from formula (2). The size of the Hough accumulator will have D + 1 rows and 360 columns, where D is the image diagonal. Mat Hough(D+1,360,CV_32SC1); //matrix with int values Initialize the accumulator to zero using: Hough.setTo(0); Modify the accumulator like: Hough.at<int>(ro, theta)++; The accumulator needs to be normalized to have values in the range 0-255 to be viewed as a grayscale image. Use the normalize method or find the imum from the accumulator and call the following conversion. Note that the subsequent operations are performed on the original accumulator. Mat houghimg; Hough.convertTo(houghImg, CV_8UC1, 255.f/Hough); In order to locate peaks in the accumulator, you will test for each Hough element if it is a local imum in a squared window (n x n) centered on the element. Use a custom structure to store and sort the local ima. The < operator of the structure was overwritten to use the > operator between the peak values specifically to sort descending when the sort method from the algorithm library is called. struct peak{ int theta, ro, hval; bool operator < (const peak& o) const { return hval > o.hval; } }; 4. Practical Work 1. Compute the Hough accumulator based on the edge image and display it as a grayscale image. 2. Locate the largest k local ima from the accumulator. Try using different window sizes such as: 3x3, 7x7 or 11x11. 3. Draw lines that correspond to the peaks found. Use both the original image and the edge image for visualization.

5. References [Hou62] P. Hough, Method and means for recognizing complex patterns, US patent 3,069,654, 1962. [Dud72] R. O. Duda and P. E. Hart, "Use of the Hough Transformation to Detect Lines and Curves in Pictures," Comm. ACM, Vol. 15, pp. 11 15, 1972. [Bal81] D. H. Ballard, "Generalizing the Hough Transform to Detect Arbitrary Shapes", Pattern Recognition, Vol.13, No.2, p.111-122, 1981.