stand_mapping.models package

Submodules

stand_mapping.models.segmentation module

stand_mapping.models.segmentation.seg2labels(img, seg_func, with_boundaries=False, **kwargs)[source]

Wrapper function that applies a segmentation routine to an image and optionally returns segment boundaries.

Parameters:
  • img (array) – image to be segmented
  • seg_func (str or function) – name of a segmentation function (currently supports ‘slic’, ‘quickshift’, ‘felzenszwalb’, and ‘watershed’) or a callable that accepts an image as its first argument and returns an integer-labeled array.
  • with_boundaries (bool) – whether or not to return an image with boundaries between segments superimposed on the original image in addition to the
  • **kwargs – keyword arguments that will be passed to the segmentation function.
Returns:

  • labels (array) – Integer mask indicating segment labels.
  • marked (array) – An image in which the boundaries between labels are superimposed on the original image.

stand_mapping.models.segmentation.seg2meancolor(img, seg_func, **kwargs)[source]

Wrapper function that applies a segmentation routine to an image and returns segmented image with the mean values of all pixels in a segment assigned to all pixels in that segment.

Parameters:
  • img (array) – image to be segmented
  • seg_func (str or function) – name of a segmentation function (currently supports ‘slic’, ‘quickshift’, ‘felzenszwalb’, and ‘watershed’) or a callable that accepts an image as its first argument and returns an integer-labeled array.
  • **kwargs – keyword arguments that will be passed to the segmentation function.
Returns:

out – segmented image with meancolor assigned to segments

Return type:

array

Module contents