{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / draw / draw / circle_perimeter

function

skimage.draw.draw:circle_perimeter

source: /dev/scikit-image/src/skimage/draw/draw.py :522

Signature

def   circle_perimeter ( r c radius method = bresenham shape = None )

Summary

Generate circle perimeter coordinates.

Parameters

r, c : int

Centre coordinate of circle.

radius : int

Radius of circle.

method : {'bresenham', 'andres'}, optional

bresenhamBresenham method (default) andres : Andres method

shape : tuple, optional

Image shape which is used to determine the maximum extent of output pixel coordinates. This is useful for circles that exceed the image size. If None, the full extent of the circle is used. Must be at least length 2. Only the first two values are used to determine the extent of the input image.

Returns

rr, cc : (N,) ndarray of int

Bresenham and Andres' method: Indices of pixels that belong to the circle perimeter. May be used to directly index into an array, e.g. img[rr, cc] = 1.

Notes

Andres method presents the advantage that concentric circles create a disc whereas Bresenham can make holes. There is also less distortions when Andres circles are rotated. Bresenham method is also known as midpoint circle algorithm. Anti-aliased circle generator is available with circle_perimeter_aa.

Examples

from skimage.draw import circle_perimeter
img = np.zeros((10, 10), dtype=np.uint8)
rr, cc = circle_perimeter(4, 4, 3)
img[rr, cc] = 1
img

Aliases

  • skimage.draw.circle_perimeter

Referenced by