eolearn.geometry.superpixel

Module for super-pixel segmentation

class eolearn.geometry.superpixel.SuperpixelSegmentationTask(feature, superpixel_feature, *, segmentation_object=<function felzenszwalb>, **segmentation_params)[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(feature, superpixel_feature, **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(feature, superpixel_feature, **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(feature, new_feature, **params)[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