hough transform (section 10.2) cs474/67. edge linking and boundary detection edge detection does not...
Post on 22-Dec-2015
221 views
TRANSCRIPT
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
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 ?
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.
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)
Properties in slope-intercept space
• Each point (xi , yi) 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.
Algorithm
1. Quantize parameter space (a,b):
P[amin, . . . , amax][bmin, . . . , bmax] (accumulator array)
amax
Algorithm (cont’d)
2. For each edge point (x, y)
For(a = amin; a ≤ amax; a++) { b = − xa + y; /* round off if needed * (P[a][b])++; /* voting */ }
3. Find local maxima in P[a][b]
if if PP[[aa j j][][bbkk]=M, then ]=M, then M M points lie on the line points lie on the line y y = = a a jj x x + + bbkk
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.
amax
Problems with slope-intercept equation
• The slope can become very large or even infinity!– e.g., for vertical or close to vertical lines
• Suppose (x1,y1) and (x2,y2) lie on the line:
• It will be impossible to quantize such a large space!
2 1
2 1
y ya
x x
slope:
Properties in ρ−θ space
• Each point (xi , yi) 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.
Algorithm
1. Quantize the parameter space (ρ,θ)
P[ρmin, . . . , ρmax][θmin, . . . ,θmax] (accumulator array)
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[ρ][θ]
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
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: (x0, y0), r