pub trait SuperpixelLSCConst: AlgorithmTraitConst {
    fn as_raw_SuperpixelLSC(&self) -> *const c_void;

    fn get_number_of_superpixels(&self) -> Result<i32> { ... }
    fn get_labels(&self, labels_out: &mut dyn ToOutputArray) -> Result<()> { ... }
    fn get_label_contour_mask(
        &self,
        image: &mut dyn ToOutputArray,
        thick_line: bool
    ) -> Result<()> { ... } }
Expand description

Class implementing the LSC (Linear Spectral Clustering) superpixels algorithm described in LiCVPR2015LSC.

LSC (Linear Spectral Clustering) produces compact and uniform superpixels with low computational costs. Basically, a normalized cuts formulation of the superpixel segmentation is adopted based on a similarity metric that measures the color similarity and space proximity between image pixels. LSC is of linear computational complexity and high memory efficiency and is able to preserve global properties of images

Required Methods

Provided Methods

Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelLSC object.

Returns the segmentation labeling of the image.

Each label represents a superpixel, and each pixel is assigned to one superpixel label.

Parameters
  • labels_out: Return: A CV_32SC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

The function returns an image with the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Parameters
  • image: Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.

  • thick_line: If false, the border is only one pixel wide, otherwise all pixels at the border are masked.

The function return the boundaries of the superpixel segmentation.

C++ default parameters
  • thick_line: true

Implementors