eolearn.geometry.superpixel

Module for super-pixel segmentation

class eolearn.geometry.superpixel.SuperpixelSegmentationTask(*args, **kwargs)[source]

Bases: eolearn.core.eotask.EOTask

Super-pixel segmentation task

Given a raster feature it will segment data into super-pixels. Representation of super-pixels will be returned as a mask timeless feature where all pixels with the same value belong to one super-pixel

Parameters
  • feature – Raster feature which will be used in segmentation

  • superpixel_feature – A new mask timeless feature to hold super-pixel mask

  • segmentation_object – A function (object) which performs superpixel segmentation, by default that is skimage.segmentation.felzenszwalb

  • segmentation_params – Additional parameters which will be passed to segmentation_object function

execute(eopatch)[source]

Main execute method

class eolearn.geometry.superpixel.FelzenszwalbSegmentationTask(*args, **kwargs)[source]

Bases: eolearn.geometry.superpixel.SuperpixelSegmentationTask

Super-pixel segmentation which uses Felzenszwalb’s method of segmentation

Uses segmentation function documented at: https://scikit-image.org/docs/dev/api/skimage.segmentation.html#skimage.segmentation.felzenszwalb

Arguments are passed to SuperpixelSegmentationTask task

class eolearn.geometry.superpixel.SlicSegmentationTask(*args, **kwargs)[source]

Bases: eolearn.geometry.superpixel.SuperpixelSegmentationTask

Super-pixel segmentation which uses SLIC method of segmentation

Uses segmentation function documented at: https://scikit-image.org/docs/dev/api/skimage.segmentation.html#skimage.segmentation.slic

Arguments are passed to SuperpixelSegmentationTask task

class eolearn.geometry.superpixel.MarkSegmentationBoundariesTask(*args, **kwargs)[source]

Bases: eolearn.core.eotask.EOTask

Takes super-pixel segmentation mask and creates a new mask where boundaries of super-pixels are marked

The result is a binary mask with values 0 and 1 and dtype numpy.uint8

Uses mark_boundaries function documented at: https://scikit-image.org/docs/dev/api/skimage.segmentation.html#skimage.segmentation.mark_boundaries

Parameters
  • feature ((FeatureType, str)) – Input feature - super-pixel mask

  • new_feature ((FeatureType, str)) – Output feature - a new feature where new mask with boundaries will be put

  • params – Additional parameters which will be passed to mark_boundaries. Supported parameters are mode and background_label

execute(eopatch)[source]

Execute method

class eolearn.geometry.superpixel.SuperpixelSegmentation(*args, **kwargs)[source]

Bases: eolearn.geometry.superpixel.SuperpixelSegmentationTask

A deprecated version of SuperpixelSegmentationTask

Parameters
  • feature – Raster feature which will be used in segmentation

  • superpixel_feature – A new mask timeless feature to hold super-pixel mask

  • segmentation_object – A function (object) which performs superpixel segmentation, by default that is skimage.segmentation.felzenszwalb

  • segmentation_params – Additional parameters which will be passed to segmentation_object function

class eolearn.geometry.superpixel.FelzenszwalbSegmentation(*args, **kwargs)[source]

Bases: eolearn.geometry.superpixel.FelzenszwalbSegmentationTask

A deprecated version of FelzenszwalbSegmentationTask

Arguments are passed to SuperpixelSegmentationTask task

class eolearn.geometry.superpixel.SlicSegmentation(*args, **kwargs)[source]

Bases: eolearn.geometry.superpixel.SlicSegmentationTask

A deprecated version of SlicSegmentationTask

Arguments are passed to SuperpixelSegmentationTask task

class eolearn.geometry.superpixel.MarkSegmentationBoundaries(*args, **kwargs)[source]

Bases: eolearn.geometry.superpixel.MarkSegmentationBoundariesTask

A deprecated version of MarkSegmentationBoundariesTask

Parameters
  • feature ((FeatureType, str)) – Input feature - super-pixel mask

  • new_feature ((FeatureType, str)) – Output feature - a new feature where new mask with boundaries will be put

  • params – Additional parameters which will be passed to mark_boundaries. Supported parameters are mode and background_label