Hough Transforms CSE 6367 – Computer Vision Vassilis Athitsos University of Texas at Arlington.

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

Hough Transform Reading Watt, An edge is not a line... How can we detect lines ?
Segmentation (2): edge detection
Uncertainty Representation. Gaussian Distribution variance Standard deviation.
Edge Detection CSE P 576 Larry Zitnick
Hough Transform Jeremy Wyatt. The story so far We know how to find edges by convolving with the derivative of a Gaussian filter in two directions We then.
Fitting: The Hough transform
Lecture 5 Hough transform and RANSAC
0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Detecting.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 16 / 2008 Instructor: Michael Eckmann.
GENERALIZED HOUGH TRANSFORM. Recap on classical Hough Transform 1.In detecting lines – The parameters  and  were found out relative to the origin (0,0)
Accumulator Array at A(1,2) –for y = ax + b we apply 1,2, to x, y, resulting in b = 2 – 1a at B(2,4) –for y = ax + b we apply 2,4, to x, y, resulting.
Object Recognition A wise robot sees as much as he ought, not as much as he can Search for objects that are important lamps outlets wall corners doors.
Color a* b* Brightness L* Texture Original Image Features Feature combination E D 22 Boundary Processing Textons A B C A B C 22 Region Processing.
Parallel Processing – Final Project Performed by:Nitsan Mane Jonathan Distler PP9.
Moments area of the object center of mass  describe the image content (or distribution) with respect to its axes.
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
Stockman MSU/CSE Fall 2009 Finding region boundaries.
Image Features, Hough Transform Image Pyramid CSE399b, Spring 06 Computer Vision Lecture 10
CS 376b Introduction to Computer Vision 04 / 15 / 2008 Instructor: Michael Eckmann.
Hough Transform. Detecting Lines Hough transform detects lines in images Equation of line is: y = mx + b or Hough transform uses an array called accumulator.
© 2010 Cengage Learning Engineering. All Rights Reserved.
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.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
02 – Object Modeling Overview Point Selection Bounding Box Line Equation Least Square Line Equation Conclusions.
Fitting & Matching Lecture 4 – Prof. Bregler Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.
HOUGH TRANSFORM Presentation by Sumit Tandon
HOUGH TRANSFORM & Line Fitting Introduction  HT performed after Edge Detection  It is a technique to isolate the curves of a given shape / shapes.
Fitting : Voting and the Hough Transform Monday, Feb 14 Prof. Kristen Grauman UT-Austin.
CSSE463: Image Recognition Day 25 This week This week Today: Finding lines and circles using the Hough transform (Sonka 6.26) Today: Finding lines and.
Lecture 08 Detecting Shape Using Hough Transform Lecture 08 Detecting Shape Using Hough Transform Mata kuliah: T Computer Vision Tahun: 2010.
Tracking CSE 6367 – Computer Vision Vassilis Athitsos University of Texas at Arlington.
HOUGH TRANSFORM. Introduced in 1962 by Paul Hough pronounced like “tough” according to orm.html.
Fitting: The Hough transform
Many slides from Steve Seitz and Larry Zitnick
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
University of Texas at Arlington
Object Detection 01 – Basic Hough Transformation JJCAO.
Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
Hough transform and geometric transform
Edges and Lines Readings: Chapter 10:
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Edge Segmentation in Computer Images CSE350/ Sep 03.
Detecting Image Features: Corner. Corners Given an image, denote the image gradient. C is symmetric with two positive eigenvalues. The eigenvalues give.
Object Recognition. Segmentation –Roughly speaking, segmentation is to partition the images into meaningful parts that are relatively homogenous in certain.
: Chapter 13: Finding Basic Shapes 1 Montri Karnjanadecha ac.th/~montri Image Processing.
Grouping and Segmentation. Sometimes edge detectors find the boundary pretty well.
HOUGH TRANSFORM.
CSSE463: Image Recognition Day 26
Fitting: Voting and the Hough Transform
Chauffeur Shade Alabsa.
Detection of discontinuity using
Exercise Class 11: Robust Tecuniques RANSAC, Hough Transform
Fourier Transform: Real-World Images
Fitting Curve Models to Edges
Image Processing, Leture #12
Edge Detection CSE 455 Linda Shapiro.
CSSE463: Image Recognition Day 26
CSSE463: Image Recognition Day 26
Hough Transform.
CSSE463: Image Recognition Day 27
CSSE463: Image Recognition Day 26
Edge Detection Today’s readings Cipolla and Gee Watt,
Finding Basic Shapes Hough Transforms
CSSE463: Image Recognition Day 26
Finding Line and Curve Segments from Edge Images
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Presentation transcript:

Hough Transforms CSE 6367 – Computer Vision Vassilis Athitsos University of Texas at Arlington

Hough Transforms Goal: identify simple geometric shapes in images, such as lines and circles. Example: find the most prominent line in an image.

Hough Transforms Goal: identify simple geometric shapes in images, such as lines and circles. Example: find the most prominent line in an image.

Code for Previous Results function result = hough_demo(image, threshold, result_number) % detect edges edges = canny(image, threshold); % find lines [h theta rho] = hough(edges); % draw the most prominent line on the image. result = image * 0.7; for i = 1:result_number max_value = max(max(h)); [rho_indices, theta_indices] = find(h == max_value); rho_index = rho_indices(1); theta_index = theta_indices(1); distance = rho(rho_index); angle = theta(theta_index); result = draw_line2(result, distance, angle); h(rho_index, theta_index) = 0; end

What is a Straight Line?

It is infinite. It is defined in multiple ways:

Defining Straight Lines How many parameters do we need to define a line?

Defining Straight Lines How many parameters define a line? One option: –a point (x0, y0) and a theta. Another option: –two points (x0, y0) and (x1, y1). NOTE: for representing 2D points, two conventions are common: (x, y), where x is horizontal coord., y is vertical coord. (i, j), where i is vertical coord, j is horizontal coord. –In any piece of code, ALWAYS VERIFY THE CONVENTION.

Defining Straight Lines How many parameters define a line? One option: –a point (x0, y0) and a theta. Another option: –two points (x0, y0) and (x1, y1). Any problem with the above two parametrizations?

Defining Straight Lines How many parameters define a line? One option: –a point (x0, y0) and a theta. Another option: –two points (x0, y0) and (x1, y1). Any problem with the above two parametrizations? –It is redundant. A line has infinite parametrizations/representations.

Defining Straight Lines y = c1 * x + c2 –Problems?

Defining Straight Lines y = c1 * x + c2 –The above parametrization cannot represent vertical lines.

Defining Straight Lines Can we define a line in a non-redundant way?

Defining Straight Lines Defining a line using rho and theta: rho = x*cos(theta) + y*sin(theta) –rho: distance of line from origin. –theta: direction PERPENDICULAR to line. –The line is the set of (x, y) values satisfying the equation.

Voting for Lines Every edge pixel votes for all the lines it is a part of. Vote array: # of rhos x # of thetas. –We choose how much we want to discretize. –Votes collected in a single for loop.

Voting for Lines - Pseudocode counters = zeros(# of rhos, # of thetas) For every pixel (i, j): –if (i, j) not an edge pixel, then continue –for every theta in thetas: rho = find_rho(i, j, theta) counters(rho, theta)++;

Voting for Lines - Pseudocode counters = zeros(# of rhos, # of thetas) For every pixel (i, j): –if (i, j) not an edge pixel, then continue –for every theta in thetas: rho = find_rho(i, j, theta) counters(rho, theta)++; How long does it take?

Voting for Lines - Pseudocode counters = zeros(# of rhos, # of thetas) For every pixel (i, j): –if (i, j) not an edge pixel, then continue –for every theta in thetas: rho = find_rho(i, j, theta) counters(rho, theta)++; How long does it take? –# pixels * # thetas. –# edge pixels * # thetas.

Hough Transform for Lines The Hough transform for lines simply computes the votes for all lines.

Using the Matlab Hough Function function result = hough_demo(image, threshold, result_number) % calls canny(image, threshold), does hough transform % on the resulting edge % image, and draws the top "result_number" results. edges = canny(image, threshold); [h theta rho] = hough(edges); result = image * 0.5; for i = 1:result_number max_value = max(max(h)); [rho_indices, theta_indices] = find(h == max_value); rho_index = rho_indices(1); theta_index = theta_indices(1); distance = rho(rho_index); angle = theta(theta_index); result = draw_line2(result, distance, angle); h(rho_index, theta_index) = 0; end

Voting for Lines Using edge orientations to make it faster:

Voting for Lines Using edge orientations to make it faster: Use the orientation of an edge pixel to limit the thetas that it votes for.

Voting for Lines – Pseudocode 2 counters = zeros(# of rhos, # of thetas) For every pixel (i, j): –if (i, j) not an edge pixel, then continue –o = gradient_orientations(i, j) –pixel_thetas = thetas such that abs(angle(o, theta)) <= thr. –for every theta in pixel_thetas: rho = find_rho(i, j, theta) counters(rho, theta)++;

Defining Circles

Parameters: center_x, center_y, radius. (x - center_x) 2 + (y - center_y) 2 = radius 2 The circle is the set of all (x, y) values satisfying the above equation.

Hough Transform on Circles What is the voting space? Who votes? What does each voter vote for?

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. –size of array: Who votes? What does each voter vote for?

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. –size of array: # centers * # radii. Who votes? What does each voter vote for?

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. –size of array: # centers * # radii. –Coarser discretizations can be used. combine 3x3 neighborhoods for center locations. choose step at which radii are sampled. Who votes? What does each voter vote for?

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. Who votes? What does each voter vote for?

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. Who votes? –Every edge pixel. What does each voter vote for?

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. Who votes? –Every edge pixel. What does each voter vote for? –Every edge pixel votes for all the circles that it belongs to.

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. Who votes? –Every edge pixel. What does each voter vote for? –Every edge pixel votes for all the circles that it can belong to. –Faster version:

Hough Transform on Circles What is the voting space? –the set of all circles that can be defined. Who votes? –Every edge pixel. What does each voter vote for? –Every edge pixel votes for all the circles that it can belong to. –Faster version: every edge pixel (i, j) votes for all the circles that it can belong to, such that the line from (i, j) to the circle center makes a relatively small angle with the gradient orientation at (i, j).

Hough Transform on Circles What does each voter vote for? –Every edge pixel votes for all the circles that it can belong to. –Faster version: every edge pixel (i, j) votes for all the circles that it can belong to, such that the line from (i, j) to the circle center makes a relatively small angle with the gradient orientation at (i, j). How long does it take?

Hough Transform on Circles What does each voter vote for? –Every edge pixel votes for all the circles that it can belong to. –Faster version: every edge pixel (i, j) votes for all the circles that it can belong to, such that the line from (i, j) to the circle center makes a relatively small angle with the gradient orientation at (i, j). How long does it take? –# edge pixels * # pixels * # radii.

General Hough Transforms In theory, we can use Hough transforms to detect more complicated shapes. In practice, this requires memory and time exponential to the number of parameters, and is usually not practical.