hough_ellipse
-
skimage.transform.hough_ellipse(img, threshold=4, accuracy=1, min_size=4, max_size=None)
[source] -
Perform an elliptical Hough transform.
Parameters: img : (M, N) ndarray
Input image with nonzero values representing edges.
threshold: int, optional (default 4)
Accumulator threshold value.
accuracy : double, optional (default 1)
Bin size on the minor axis used in the accumulator.
min_size : int, optional (default 4)
Minimal major axis length.
max_size : int, optional
Maximal minor axis length. (default None) If None, the value is set to the half of the smaller image dimension.
Returns: result : ndarray with fields [(accumulator, y0, x0, a, b, orientation)]
Where
(yc, xc)
is the center,(a, b)
the major and minor axes, respectively. Theorientation
value followsskimage.draw.ellipse_perimeter
convention.Notes
The accuracy must be chosen to produce a peak in the accumulator distribution. In other words, a flat accumulator distribution with low values may be caused by a too low bin size.
References
[R367] Xie, Yonghong, and Qiang Ji. “A new efficient ellipse detection method.” Pattern Recognition, 2002. Proceedings. 16th International Conference on. Vol. 2. IEEE, 2002 Examples
>>> from skimage.transform import hough_ellipse >>> from skimage.draw import ellipse_perimeter >>> img = np.zeros((25, 25), dtype=np.uint8) >>> rr, cc = ellipse_perimeter(10, 10, 6, 8) >>> img[cc, rr] = 1 >>> result = hough_ellipse(img, threshold=8) >>> result.tolist() [(10, 10.0, 10.0, 8.0, 6.0, 0.0)]
Please login to continue.