Trait SuperpixelLSCTrait

Source
pub trait SuperpixelLSCTrait: AlgorithmTrait + SuperpixelLSCTraitConst {
    // Required method
    fn as_raw_mut_SuperpixelLSC(&mut self) -> *mut c_void;

    // Provided methods
    fn iterate(&mut self, num_iterations: i32) -> Result<()> { ... }
    fn iterate_def(&mut self) -> Result<()> { ... }
    fn enforce_label_connectivity(
        &mut self,
        min_element_size: i32,
    ) -> Result<()> { ... }
    fn enforce_label_connectivity_def(&mut self) -> Result<()> { ... }
}
Expand description

Mutable methods for crate::ximgproc::SuperpixelLSC

Required Methods§

Provided Methods§

Source

fn iterate(&mut self, num_iterations: i32) -> Result<()>

Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object.

This function can be called again without the need of initializing the algorithm with createSuperpixelLSC(). This save the computational cost of allocating memory for all the structures of the algorithm.

§Parameters
  • num_iterations: Number of iterations. Higher number improves the result.

The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelLSC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.

§C++ default parameters
  • num_iterations: 10
Source

fn iterate_def(&mut self) -> Result<()>

Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object.

This function can be called again without the need of initializing the algorithm with createSuperpixelLSC(). This save the computational cost of allocating memory for all the structures of the algorithm.

§Parameters
  • num_iterations: Number of iterations. Higher number improves the result.

The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelLSC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.

§Note

This alternative version of SuperpixelLSCTrait::iterate function uses the following default values for its arguments:

  • num_iterations: 10
Source

fn enforce_label_connectivity(&mut self, min_element_size: i32) -> Result<()>

Enforce label connectivity.

§Parameters
  • min_element_size: The minimum element size in percents that should be absorbed into a bigger superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means that less then a quarter sized superpixel should be absorbed, this is default.

The function merge component that is too small, assigning the previously found adjacent label to this component. Calling this function may change the final number of superpixels.

§C++ default parameters
  • min_element_size: 25
Source

fn enforce_label_connectivity_def(&mut self) -> Result<()>

Enforce label connectivity.

§Parameters
  • min_element_size: The minimum element size in percents that should be absorbed into a bigger superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means that less then a quarter sized superpixel should be absorbed, this is default.

The function merge component that is too small, assigning the previously found adjacent label to this component. Calling this function may change the final number of superpixels.

§Note

This alternative version of SuperpixelLSCTrait::enforce_label_connectivity function uses the following default values for its arguments:

  • min_element_size: 25

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§