[][src]Function opencv::ximgproc::create_superpixel_lsc

pub fn create_superpixel_lsc(
    image: &dyn ToInputArray,
    region_size: i32,
    ratio: f32
) -> Result<Ptr<dyn SuperpixelLSC>>

Class implementing the LSC (Linear Spectral Clustering) superpixels

Parameters

  • image: Image to segment
  • region_size: Chooses an average superpixel size measured in pixels
  • ratio: Chooses the enforcement of superpixel compactness factor of superpixel

The function initializes a SuperpixelLSC object for the input image. It sets the parameters of superpixel algorithm, which are: region_size and ruler. It preallocate some buffers for future computing iterations over the given image. An example of LSC is ilustrated in the following picture. For enanched results it is recommended for color images to preprocess image with little gaussian blur with a small 3 x 3 kernel and additional conversion into CieLAB color space.

image

C++ default parameters

  • region_size: 10
  • ratio: 0.075f