Download presentation
Presentation is loading. Please wait.
1
Hough Transform (Section 10.2) CS474/67
2
Edge Linking and Boundary Detection Edge detection does not yield connected boundaries. Edge linking and boundary following must be applied after edge detection. gradient magnitude thresholded gradient magnitude
3
Local Processing Methods At each pixel, a neighborhood (e.g., 3x3) is examined. Pixels which are similar in this neighborhood are linked. How do we define similarity ?
4
Local Processing Methods (cont’d) G x - Sobel G y - Sobel linking results T=25, A=15
5
Global Processing Methods If gaps are very large, local processing methods are not effective. Model-based approaches can be used in this case! Hough TransformHough Transform can be used to determine whether points lie on a curve of a specified shape.
6
Hough Transform – Line Detection Consider the slope-intercept equation of line Rewrite the equation as follows (a, b are constants, x is a variable, y is a function of x) (now, x, y are constants, a is a variable, b is a function of a)
7
Hough Transform – Line Detection (cont’d) x-y spaceslope-intercept space
8
Properties in slope-intercept space Each point (x i, y i ) defines a line in the a − b space (parameter space). 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.
9
Algorithm 1. Quantize parameter space (a,b): P[a min,..., a max ][b min,..., b max ] (accumulator array) a max
10
Algorithm (cont’d) 2. For each edge point (x, y) For(a = a min ; a ≤ a max ; a++) { b = − xa + y; /* round off if needed * (P[a][b])++; /* voting */ } 3. Find local maxima in P[a][b] if P[a j ][b k ]=M, then M points lie on the line y = a j x + b k
11
Effects of Quantization The parameters of a line can be estimated more accurately using a finer quantization of the parameter space. Finer quantization increases space and time requirements. For noise tolerance, however, a coarser quantization is better. a max
12
Effects of Quantization (cont’d)
13
Problems with slope-intercept equation The slope can become very large or even infinity! –e.g., for vertical or close to vertical lines Suppose (x 1,y 1 ) and (x 2,y 2 ) lie on the line: It will be impossible to quantize such a large space! slope:
14
Polar Representation of Lines (no problem with vertical lines, i.e., θ =90) ρ−θ space
15
Properties in ρ−θ space Each point (x i, y i ) defines a sinusoidal curve in the ρ −θ space (parameter space). 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.
16
Properties in ρ−θ space (cont’d) ρ=√2D -ρ=-√2D D: max distance
17
Example long vertical lines
18
Algorithm 1. Quantize the parameter space (ρ,θ) P[ρ min,..., ρ max ][θ min,...,θ max ] (accumulator array)
19
Algorithm (cont’d) 2. For each edge point (x, y) For(θ = θ min ;θ ≤ θ max ;θ ++) { ρ = xcos(θ) + ysin(θ) ; /* round off if needed * (P[ρ][θ])++; /* voting */ } 3. Find local maxima in P[ρ][θ]
20
Example Richard Duda and Peter Hart “Use of the Hough Transformation to Detect Lines and Curves in Pictures” Communications of the ACM Volume 15, Issue 1 (January 1972) Pages: 11 – 15
21
Example (cont’d)
22
Extending Hough Transform Hough transform can also be used for detecting circles, ellipses, etc. For example, the equation of circle is: In this case, there are three parameters: (x 0, y 0 ), r
23
Extending Hough Transform (cont’d) In general, we can use hough transform to detect any curve which can be described analytically by an equation of the form: Detecting arbitrary shapes, with no analytical description, is also possible (i.e., Generalized Hough Transform)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.