mpl_interactions.image_segmenter

class image_segmenter(img, nclasses=1, mask=None, mask_colors=None, mask_alpha=0.75, figsize=10, 10, cmap='viridis')[source]

Bases: object

Manually segment an image with the lasso selector.

__init__(img, nclasses=1, mask=None, mask_colors=None, mask_alpha=0.75, figsize=10, 10, cmap='viridis')[source]
Parameters
  • img (array_like) – A valid argument to imshow

  • nclasses (int, default 1)

  • mask (arraylike, optional) – If you want to pre-seed the mask

  • mask_colors (None, color, or array of colors, optional) – the colors to use for each class. Unselected regions will always be totally transparent

  • mask_alpha (float, default .75) – The alpha values to use for selected regions. This will always override the alpha values in mask_colors if any were passed

  • figsize ((float, float), optional) – passed to plt.figure

  • cmap (‘string’) – the colormap to use if img has shape (X,Y)

Methods

__init__(img[, nclasses, mask, mask_colors, …])

Parameters
  • img (array_like) – A valid argument to imshow