Circle Hough Transform
|Affine invariant feature detection|
The circle Hough Transform (CHT) is a basic technique used in Digital Image Processing, for detecting circular objects in a digital image.
The circle Hough Transform (CHT) is a feature extraction technique for detecting circles. It is a specialization of Hough Transform. The purpose of the technique is to find circles in imperfect image inputs. The circle candidates are produced by “voting” in the Hough parameter space and then select the local maxima in a so-called accumulator matrix.
- 1 Theory
- 2 Examples
- 3 Limitations
- 4 Extensions
- 5 Application
- 6 Implementation code
- 7 See also
- 8 References
In a two-dimensional space, a circle can be described by:
where (a,b) is the center of the circle, and r is the radius. If a 2D point (x,y) is fixed, then the parameters can be found according to (1). The parameter space would be three dimensional, (a, b, r). And all the parameters that satisfy (x, y) would lie on the surface of an inverted right-angled cone whose apex is at (x, y, 0). In the 3D space, the circle parameters can be identified by the intersection of many conic surfaces that are defined by points on the 2D circle. This process can be divided into two stages. The first stage is fixing radius then find the optimal center of circles in a 2D parameter space. The second stage is to find the optimal radius in a one dimensional parameter space.
Find parameters with known radius R
If the radius is fixed, then the parameter space would be reduced to 2D (the position of the circle center). For each point (x, y) on the original circle, it can define a circle centered at (x, y) with radius R according to (1). The intersection point of all such circles in the parameter space would be corresponding to the center point of the original circle.
Consider 4 points on a circle in the original image (left). The circle Hough transform is shown in the right. Note that the radius is assumed to be known. For each (x,y) of the four points (white points) in the original image, it can define a circle in the Hough parameter space centered at (x, y) with radius r. An accumulator matrix is used for tracking the intersection point. In the parameter space, the voting number of points through which the circle passing would be increased by one. Then the local maxima point (the red point in the center in the right figure) can be found. The position (a, b) of the maxima would be the center of the original circle.
Multiple circles with known radius R
Note that, in the accumulator matrix (right fig), there would be at least 3 local maxima points.
Accumulator matrix and voting
In practice, an accumulator matrix is introduced to find the intersection point in the parameter space. First, we need to divide the parameter space into “buckets” using a grid and produce an accumulator matrix according to the grid. The element in the accumulator matrix denotes the number of “circles” in the parameter space that passing through the corresponding grid cell in the parameter space. The number is also called “voting number”. Initially, every element in the matrix is zeros. Then for each “edge” point in the original space, we can formulate a circle in the parameter space and increase the voting number of the grid cell which the circle passing through. This process is called “voting”.
After voting, we can find local maxima in the accumulator matrix. The positions of the local maxima are corresponding to the circle centers in the original space.
Find circle parameter with unknown radius
Since the parameter space is 3D, the accumulator matrix would be 3D, too. We can iterate through possible radii; for each radius, we use the previous technique. Finally, find the local maxima in the 3D accumulator matrix. Accumulator array should be A[x,y,r] in the 3D space. Voting should be for each pixels, radius and theta A[x,y,r] += 1
The algorithm :
- For each A[a,b,r] = 0;
- Process the filtering algorithm on image Gaussian Blurring, convert the image to grayscale ( grayScaling), make Canny operator, The Canny operator gives the edges on image.
- Vote the all possible circles in accumulator.
- The local maximum voted circles of Accumulator A gives the circle Hough space.
- The maximum voted circle of Accumulator gives the circle.
The Voting :
For each pixel(x,y) For each radius r = 10 to r = 60 // the possible radius For each theta t = 0 to 360 // the possible theta 0 to 360 a = x – r * cos(t * PI / 180); //polar coordinate for center b = y – r * sin(t * PI / 180); //polar coordinate for center A[a,b,r] +=1; //voting end end end
Find circles in chappal
The original picture (right) is first turned into a binary image (left) using a threshold and Gaussian filter. Then edges (mid) are found from it using canny edge detection. After this, all the edge points are used by the Circle Hough Transform to find underlying circle structure.
Since the parameter space of the CHT is three dimensional, it may require lots of storage and computation. Choosing a bigger grid size can ameliorate this problem.
However, choosing an appropriate grid size is difficult. Since too coarse a grid can lead to large values of the vote being obtained falsely because many quite different structures correspond to a single bucket. Too fine a grid can lead to structures not being found because votes resulting from tokens that are not exactly aligned end up in different buckets, and no bucket has a large vote.
Also, the CHT is not very robust to noise.
Adaptive Hough Transform
J. Illingworth and J. Kittler  introduced this method for implementing Hough Transform efficiently. The AHT uses a small accumulator array and the idea of a flexible iterative "coarse to fine" accumulation and search strategy to identify significant peaks in the Hough parameter spaces. This method is substantially superior to the standard Hough Transform implementation in both storage and computational requirements.
Since the head would be similar to a circle in an image, CHT can be used for detecting heads in a picture, so as to count the number of persons in the image.
Brain Aneurysm Detection
Modified Hough Circle Transform (MHCT) is used on the image extracted from Digital Subtraction Angiogram (DSA) to detect and classify aneurysms type.
- Hough transform
- Generalised Hough transform
- Randomized Hough transform
- J. Illingworth and J. Kittler, “The Adaptive Hough Transform,” PAMI-9 , Issue: 5, 1987, pp 690-698
- Hong Liu, Yueliang Qian and Shouxun Lin , “DETECTING PERSONS USING HOUGH CIRCLE TRANSFORM IN SURVEILLANCE VIDEO”
- Mitra, Jubin et. el. "Peak trekking of hierarchy mountain for the detection of cerebral aneurysm using modified Hough circle transform." ELCVIA Electronic Letters on Computer Vision and Image Analysis 12.1 (2013). http://elcvia.cvc.uab.es/article/view/v12-n1-mitra-chandra-halder