hough-circle

hough_circle

skimage.transform.hough_circle(image, radius, normalize=True, full_output=False) [source]

Perform a circular Hough transform.

Parameters:

image : (M, N) ndarray

Input image with nonzero values representing edges.

radius : scalar or sequence of scalars

Radii at which to compute the Hough transform. Floats are converted to integers.

normalize : boolean, optional (default True)

Normalize the accumulator with the number of pixels used to draw the radius.

full_output : boolean, optional (default False)

Extend the output size by twice the largest radius in order to detect centers outside the input picture.

Returns:

H : 3D ndarray (radius index, (M + 2R, N + 2R) ndarray)

Hough transform accumulator for each radius. R designates the larger radius if full_output is True. Otherwise, R = 0.

Examples

>>> from skimage.transform import hough_circle
>>> from skimage.draw import circle_perimeter
>>> img = np.zeros((100, 100), dtype=np.bool_)
>>> rr, cc = circle_perimeter(25, 35, 23)
>>> img[rr, cc] = 1
>>> try_radii = np.arange(5, 50)
>>> res = hough_circle(img, try_radii)
>>> ridx, r, c = np.unravel_index(np.argmax(res), res.shape)
>>> r, c, try_radii[ridx]
(25, 35, 23)
doc_scikit_image
2017-01-12 17:21:15
Comments
Leave a Comment

Please login to continue.