[][src]Function opencv::ximgproc::create_superpixel_slic

pub fn create_superpixel_slic(
    image: &dyn ToInputArray,
    algorithm: i32,
    region_size: i32,
    ruler: f32
) -> Result<Ptr<dyn SuperpixelSLIC>>

Initialize a SuperpixelSLIC object

Parameters

  • image: Image to segment
  • algorithm: Chooses the algorithm variant to use: SLIC segments image using a desired region_size, and in addition SLICO will optimize using adaptive compactness factor, while MSLIC will optimize using manifold methods resulting in more content-sensitive superpixels.
  • region_size: Chooses an average superpixel size measured in pixels
  • ruler: Chooses the enforcement of superpixel smoothness factor of superpixel

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

image

C++ default parameters

  • algorithm: SLICO
  • region_size: 10
  • ruler: 10.0f