Module: draw¶
skimage.draw.bresenham | Generate line pixel coordinates. |
skimage.draw.circle | Generate coordinates of pixels within circle. |
skimage.draw.ellipse | Generate coordinates of pixels within ellipse. |
skimage.draw.line | Generate line pixel coordinates. |
skimage.draw.polygon | Generate coordinates of pixels within polygon. |
bresenham¶
- skimage.draw.bresenham()¶
Generate line pixel coordinates.
Parameters : y, x : int
Starting position (row, column).
y2, x2 : int
End position (row, column).
Returns : rr, cc : (N,) ndarray of int
Indices of pixels that belong to the line. May be used to directly index into an array, e.g. img[rr, cc] = 1.
circle¶
- skimage.draw.circle()¶
Generate coordinates of pixels within circle.
Parameters : cy, cx : double
centre coordinate of circle
radius: double :
radius of circle
Returns : rr, cc : ndarray of int
Pixel coordinates of ellipse. May be used to directly index into an array, e.g. img[rr, cc] = 1.
ellipse¶
- skimage.draw.ellipse()¶
Generate coordinates of pixels within ellipse.
Parameters : cy, cx : double
centre coordinate of ellipse
b, a: double :
minor and major semi-axes. (x/a)**2 + (y/b)**2 = 1
Returns : rr, cc : ndarray of int
Pixel coordinates of ellipse. May be used to directly index into an array, e.g. img[rr, cc] = 1.
line¶
- skimage.draw.line()¶
Generate line pixel coordinates.
Parameters : y, x : int
Starting position (row, column).
y2, x2 : int
End position (row, column).
Returns : rr, cc : (N,) ndarray of int
Indices of pixels that belong to the line. May be used to directly index into an array, e.g. img[rr, cc] = 1.
polygon¶
- skimage.draw.polygon()¶
Generate coordinates of pixels within polygon.
Parameters : y : (N,) ndarray
y coordinates of vertices of polygon
x : (N,) ndarray
x coordinates of vertices of polygon
shape : tuple, optional
image shape which is used to determine maximum extents of output pixel coordinates. This is useful for polygons which exceed the image size. By default the full extents of the polygon are used.
Returns : rr, cc : ndarray of int
Pixel coordinates of polygon. May be used to directly index into an array, e.g. img[rr, cc] = 1.