pub fn create_superpixel_lsc_def(
image: &impl ToInputArray,
) -> Result<Ptr<SuperpixelLSC>>
Expand description
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.
§Note
This alternative version of create_superpixel_lsc function uses the following default values for its arguments:
- region_size: 10
- ratio: 0.075f