Lecture 08 Detecting Shape Using Hough Transform Lecture 08 Detecting Shape Using Hough Transform Mata kuliah: T0283 - Computer Vision Tahun: 2010.

Slides:



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

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.
Copyright © Cengage Learning. All rights reserved.
Edge Detection CSE P 576 Larry Zitnick
Fitting: The Hough transform
Lecture 5 Hough transform and RANSAC
1 Model Fitting Hao Jiang Computer Science Department Oct 6, 2009.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
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.
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Parallel Processing – Final Project Performed by:Nitsan Mane Jonathan Distler PP9.
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
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.
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Edge Detection.
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.
Segmentation Slides Credit: Jim Rehg, G.Tech. Christopher Rasmussen, UD John Spletzer, Lehigh Also, Slides adopted from material provided by David Forsyth.
Hough Transform (Section 10.2) CS474/67. Edge Linking and Boundary Detection Edge detection does not yield connected boundaries. Edge linking and boundary.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
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.
Lecture 11 Stereo Reconstruction I Lecture 11 Stereo Reconstruction I Mata kuliah: T Computer Vision Tahun: 2010.
Hough Transform on the GPU Presented by Javier Garcia November 29, 2010.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Segmentation Course web page: vision.cis.udel.edu/~cv May 7, 2003  Lecture 31.
From Pixels to Features: Review of Part 1 COMP 4900C Winter 2008.
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.
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.
Hough Transform : A preliminary study Indranil Das HEP Devn., SINP.
Fitting : Voting and the Hough Transform Monday, Feb 14 Prof. Kristen Grauman UT-Austin.
Object Detection 01 – Advance Hough Transformation JJCAO.
Generalized Hough Transform
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
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.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
HOUGH TRANSFORM. Introduced in 1962 by Paul Hough pronounced like “tough” according to orm.html.
Fitting: The Hough transform
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Session 2 – Hough Transformation Ashay Tejwani. Video Processing In the last session we saw that an image can be represented by an array of RGB values.
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.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
Edges and Lines Readings: Chapter 10:
Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
: Chapter 13: Finding Basic Shapes 1 Montri Karnjanadecha ac.th/~montri Image Processing.
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.
HOUGH TRANSFORM.
CSSE463: Image Recognition Day 26
Fitting: Voting and the Hough Transform
Detection of discontinuity using
Finding Lines in Images
Fitting Curve Models to Edges
Image Processing, Leture #12
Hough Transform COMP 4900C Winter 2008.
CSSE463: Image Recognition Day 26
CSSE463: Image Recognition Day 26
Hough Transform.
CSSE463: Image Recognition Day 27
CSSE463: Image Recognition Day 26
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:

Lecture 08 Detecting Shape Using Hough Transform Lecture 08 Detecting Shape Using Hough Transform Mata kuliah: T Computer Vision Tahun: 2010

January 20, 2010T Computer Vision3 Learning Objectives After carefullylistening this lecture, students will be able to do the following : After carefully listening this lecture, students will be able to do the following : explain how Hough Transforms are used to detect primitive shapes such as line and circle explain how Hough Transforms are used to detect primitive shapes such as line and circle demonstrate HT-based line and circle detection using MATLAB/OpenCV demonstrate HT-based line and circle detection using MATLAB/OpenCV

January 20, 2010T Computer Vision4 Line Detection Using Mask The mask shown below can be used to detect lines at various orientation

January 20, 2010T Computer Vision5 Hough Transform An algorithm to group edge points from edge detectors or from any other process

January 20, 2010T Computer Vision6 Straight Line Case Consider the slope-intercept equation of line y = ax + b a, b are constant, x is a variable, and y is a function of x Rewrite the equation as follows : b = -xa + y Now x, y are constant, a is a variable, b is a function of a

January 20, 2010T Computer Vision7 Algorithm The following properties are true Points lying on the same line in the x-y space, define lines in the parameter space which all intersect at the same point The coordinates of the point of intersection define the parameters of the line in the x-y space Algorithm For each edge point (x,y) for (a = a min ; a ≤ a max ; a++) b = -xa +y; P[a][b] ++;/*accumulator array*/ Find local maxima in P[a][b]

January 20, 2010T Computer Vision8 Problem with slope-intercept equation The slope can become very large or infinity. It will be impossible to quantize such a large space Polar representation of lines x cos  + y sin  =  (if the line is vertical,  = 0, x =  )   x 1,y 1 x y

January 20, 2010T Computer Vision9 Polar Representation of Lines HT uses the parametric representation of a line:  = x cos  + y sin  (*)  is the distance from the origin to the line along a vector  is the distance from the origin to the line along a vector perpendicular to the line. perpendicular to the line.  is the angle between the x-axis and this vector  is the angle between the x-axis and this vector. Hough function generates a parameter space matrix whose rows and columns correspond to  and  values whose rows and columns correspond to  and  values respectively. respectively. Peak values in this space represent potential lines in the input image. input image.

January 20, 2010T Computer Vision10 Algorithm Construct accumulator array in 2D ( ,  ) Initial values 0 Select granularity of angle  For instance 10  increments For every edge point Compute  using (*) Increment accumulator array by one for each computed ( ,  ) pair.

January 20, 2010T Computer Vision11 Hough Transform

January 20, 2010T Computer Vision12 Hough Transform

January 20, 2010T Computer Vision13 Hough Transform : Issues Noise Points slightly off curve result in multiple intersections Can use larger bins, smooth accumulator array Non-maximum suppression a good idea to get unique peaks Dimensionality Exponential increase in size of accumulator array as number of shape parameters goes up HT works best for shapes with 3 or fewer variables

January 20, 2010T Computer Vision14 clear all;clc; I = imread('line1.png'); I =im2bw(I); I = ~I; [y,x]=find(I); [sy,sx]=size(I) figure, imshow(I); totalpix = length(x); maxrho = round(sqrt(sx^2 + sy^2)); HM = zeros(2*maxrho,180); MATLAB Implementation

January 20, 2010T Computer Vision15 for cnt = 1:totalpix cnt2 = 1; for theta = -pi/2:pi/180:pi/2-pi/180 rho = round(x(cnt).*cos(theta) + y(cnt).*sin(theta)); HM(rho+maxrho,cnt2) = HM(rho+maxrho,cnt2) + 1; cnt2 = cnt2 + 1; end theta = rad2deg(-pi/2:pi/180:pi/2-pi/180); rho = -maxrho:maxrho-1; figure, imshow(uint8(HM),[],'xdata',theta,'ydata',rho); xlabel('\theta'),ylabel('\rho') axis on, axis normal; title('Hough Matrix'); MATLAB Implementation

January 20, 2010T Computer Vision16 Examples of Line Detection using HT

January 20, 2010T Computer Vision17 Examples of Line Detection using HT

January 20, 2010T Computer Vision18 Circle Case Similar to line fitting Three unknowns Construct a 3D accumulator array A Dimensions: x 0, y 0, r Fix one of the parameters change the others Increment corresponding entry in A. Find the local maxima in A

January 20, 2010T Computer Vision19 Circle Fitting

January 20, 2010T Computer Vision20 Circle Fitting

January 20, 2010T Computer Vision21 clear all;clc; I = imread('pic21.bmp'); I =im2bw(I); [y,x]=find(I); [sy,sx]=size(I) figure, imshow(I); totalpix = length(x); HM = zeros(sy,sx,50); R = 1:30; R2 = R.^2; sz = sy*sx; MATLAB Implementation

January 20, 2010T Computer Vision22 for cnt = 1:totalpix for cntR = 1:30; b = 1:sy; a = (round(x(cnt) - sqrt(R2(cntR) - (y(cnt) - [1:sy]).^2))); b = b(imag(a)==0 & a>0); a = a(imag(a)==0 & a>0); ind = sub2ind([sy,sx],b,a); HM(sz*(cntR-1)+ind) = HM(sz*(cntR-1)+ind) + 1; end for cnt = 1:30 H(cnt) = max(max(HM(:,:,cnt))); end figure, plot(H,'*-'); MATLAB Implementation

January 20, 2010T Computer Vision23 b = 1:sy; for cnt = 1:totalpix a = (round(x(cnt) - sqrt(R2 - (y(cnt) - [1:sy]).^2))); for cnt2 =1:sy if isreal(a(cnt2)) & a(cnt2)>0 HM(cnt2,a(cnt2)) = HM(cnt2,a(cnt2)) + 1; end figure,imshow(HM,[]); MATLAB Implementation

January 20, 2010T Computer Vision24 [maxval, maxind] = max(H); [B,A] = find(HM(:,:,maxind)==maxval) figure,imshow(I); hold on; plot(mean(A),mean(B),'xr') text(mean(A),mean(B),num2str(maxind),'color','green') MATLAB Implementation

January 20, 2010T Computer Vision25 Examples of Circle Detection using HT