W3cubDocs

/scikit-image

Module: future

Functionality with an experimental API. Although you can count on the functions in this package being around in the future, the API may change with any version update and will not follow the skimage two-version deprecation path. Therefore, use the functions herein with care, and do not use them in production code that will depend on updated skimage versions.

skimage.future.manual_lasso_segmentation(image) Return a label image based on freeform selections made with the mouse.
skimage.future.manual_polygon_segmentation(image) Return a label image based on polygon selections made with the mouse.
skimage.future.graph

manual_lasso_segmentation

skimage.future.manual_lasso_segmentation(image, alpha=0.4, return_all=False) [source]

Return a label image based on freeform selections made with the mouse.

Parameters:
image : (M, N[, 3]) array

Grayscale or RGB image.

alpha : float, optional

Transparency value for polygons drawn over the image.

return_all : bool, optional

If True, an array containing each separate polygon drawn is returned. (The polygons may overlap.) If False (default), latter polygons “overwrite” earlier ones where they overlap.

Returns:
labels : array of int, shape ([Q, ]M, N)

The segmented regions. If mode is ‘separate’, the leading dimension of the array corresponds to the number of regions that the user drew.

Notes

Press and hold the left mouse button to draw around each object.

Examples

>>> from skimage import data, future, io
>>> camera = data.camera()
>>> mask = future.manual_lasso_segmentation(camera)  # doctest: +SKIP
>>> io.imshow(mask)  # doctest: +SKIP
>>> io.show()  # doctest: +SKIP

manual_polygon_segmentation

skimage.future.manual_polygon_segmentation(image, alpha=0.4, return_all=False) [source]

Return a label image based on polygon selections made with the mouse.

Parameters:
image : (M, N[, 3]) array

Grayscale or RGB image.

alpha : float, optional

Transparency value for polygons drawn over the image.

return_all : bool, optional

If True, an array containing each separate polygon drawn is returned. (The polygons may overlap.) If False (default), latter polygons “overwrite” earlier ones where they overlap.

Returns:
labels : array of int, shape ([Q, ]M, N)

The segmented regions. If mode is ‘separate’, the leading dimension of the array corresponds to the number of regions that the user drew.

Notes

Use left click to select the vertices of the polygon and right click to confirm the selection once all vertices are selected.

Examples

>>> from skimage import data, future, io
>>> camera = data.camera()
>>> mask = future.manual_polygon_segmentation(camera)  # doctest: +SKIP
>>> io.imshow(mask)  # doctest: +SKIP
>>> io.show()  # doctest: +SKIP

© 2011 the scikit-image team
Licensed under the BSD 3-clause License.
http://scikit-image.org/docs/0.14.x/api/skimage.future.html