Content deleted Content added
←Created page with ''''Randomized Hough trasform''' is a probabilistic variant to the classical Hough transform, which is a commonly used technique for detecting curves (straight l...' |
|||
(23 intermediate revisions by 20 users not shown) | |||
Line 1:
Hough transforms are techniques for [[object detection]], a critical step in many implementations of [[computer vision]], or [[data mining]] from images. Specifically, the '''Randomized Hough
==Motivation==
Although Hough transform (HT) has been widely used in [[Edge detection|curve detection]], it has two major drawbacks:<ref>L. Xu, E. Oja, and P. Kultanan, "A new curve detection method: Randomized Hough transform (RHT)", ''Pattern Recog. Lett.'' 11, 1990, 331-338.</ref>
▲Although Hough transform (HT) has been widely used in curve detection, it has two major drawbacks:<ref>L. Xu, E. Oja, and P. Kultanan, "A new curve detection method: Randomized Hough transform (RHT)", ''Pattern Recog. Lett.'' 11, 1990, 331-338.</ref> (1) For each nonzero pixel in the image, the parameters for the exsiting curve and redundant ones are both accumulated during the voting procudure. (2) The accumulator array (or Hough space) is predefined in a heuristic way. The better accuracy we need, the higher parameter resolution should be defined. These two needs usually result in a large storage requirement and low speed for real applications. Therefore, RHT was brought up to tackle this problem.
==Implementation==
In comparison with HT, RHT takes advantage of the fact that some [[analytic variety|analytical]] curves can be fully determined by a certain number of points on the curve. For example, a
▲In comparison with HT, RHT takes advantage of the fact that some analytical curves can be fully determined by a certain number of points on the curve. For example, a stragit line can be determined by two points, and an ellipse (or a circle) can be determined by three points. To illustrate the basic idea of RHT, let's consider the case of ellipse detection. The whole process generally consists of three steps:
▲1) Fit ellipses with randomly selected points;
▲2) Update the accumulator array and corresponding scores;
▲3) Output the ellipses with scores higher than some predefined threshold.
▲===Ellipse Fitting===
▲One general equation for defining ellipses is:
▲<math>a (x - p)^2+ 2b (x-p) (y-q) + c (y-q)^2 + 1 = 0 </math>
with restriction: <math>ac-b^2>0</math>
However,
RHT starts by randomly selecting three points on the ellipse. Let them be
The next step is to find the intersection points of the tangent lines. This can be easily done by solving the line equations found in the previous step. Then let the intersection points be
Let the coordinates of ellipse center found in previous step be
<math>ax'^2+2bx'y'+cy'^2=1</math>
Now we can solve for the rest of ellipse parameters: <math>a</math>, <math>b</math> and <math>c</math> by substituting the coordinates of
===Accumulating===
With the ellipse parameters determined from previous stage, the [[accumulator (computing)|accumulator]] array can be updated correspondingly. Different from classical Hough transform, RHT does not keep "grid of buckets" as the accumulator array. Rather, it first calculates the similarities between the newly detected ellipse and the ones already stored in accumulator array. Different metrics can be used to calculate the similarity. As long as the similarity exceeds some predefined threshold, replace the one in the accumulator with the average of both ellipses and add 1 to its score. Otherwise, initialize this ellipse to an empty position in the accumulator and assign a score of 1.▼
▲With the ellipse parameters determined from previous stage, the accumulator array can be updated correspondingly. Different from classical Hough transform, RHT does not keep "grid of buckets" as the accumulator array. Rather, it first calculates the similarities between the newly detected ellipse and the ones already stored in accumulator array. Different metrics can be used to calculate the similarity. As long as the similarity exceeds some predefined threshold, replace the one in the accumulator with the average of both ellipses and add 1 to its score. Otherwise, initialize this ellipse to an empty position in the accumulator and assign a score of 1.
===Termination===
Once the score of one candidate ellipse exceeds the threshold, it is determined as existing in the image (in other words, this ellipse is detected), and should be removed from the image and accumulator array so that the algorithm can detect other potential ellipses faster. The algorithm terminates when the number of iterations reaches a maximum limit or all the ellipses have been detected.
Pseudo code for RHT:<ref>S. Inverso, “Ellipse Detection Using Randomized Hough Transform”, www.saminverso.com/res/vision/EllipseDetectionOld.pdf, May 20, 2002</ref>
'''for''' (a fixed number of iterations) {▼
▲while (we find ellipses OR not reached the maximum epoch) {
Find a potential ellipse.▼
▲ for(a fixed number of iterations) {
'''if''' (the ellipse is similar to an ellipse in the accumulator) '''then'''
▲ Find a potential ellipse.
'''else'''▼
Insert the ellipse into an empty position in the accumulator with a score of 1;▼
▲ else
}▼
▲ Insert the ellipse into an empty position in the accumulator with a score of 1;
Select the ellipse with the best score and save it in a best ellipse table;
▲ }
Empty the accumulator;▼
}▼
▲ Empty the accumulator;
▲}
==References==▼
{{reflist}}
[[Category:Image processing]]
[[Category:Computer vision]]
▲==References==
|