{ } Raw JSON

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

function

skimage.draw.draw:circle_perimeter_aa

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

Signature

def   circle_perimeter_aa ( r c radius shape = None )

Summary

Generate anti-aliased circle perimeter coordinates.

Parameters

r, c : int

Centre coordinate of circle.

radius : int

Radius of circle.

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, val : (N,) ndarray (int, int, float)

Indices of pixels (rr, cc) and intensity values (val). img[rr, cc] = val.

Notes

Wu's method draws anti-aliased circle. This implementation doesn't use lookup table optimization.

Use the function draw.set_color to apply circle_perimeter_aa results to color images.

Examples

from skimage.draw import circle_perimeter_aa
img = np.zeros((10, 10), dtype=np.uint8)
rr, cc, val = circle_perimeter_aa(4, 4, 3)
img[rr, cc] = val * 255
img
from skimage import data, draw
image = data.chelsea()
rr, cc, val = draw.circle_perimeter_aa(r=100, c=100, radius=75)
draw.set_color(image, (rr, cc), [1, 0, 0], alpha=val)

Aliases

  • skimage.draw.circle_perimeter_aa