Table of Contents

Method Create

Namespace
OpenCvSharp.XImgProc
Assembly
OpenCvSharp.dll

Create(InputArray, SLICType, int, float)

Initialize a SuperpixelSLIC object.

The function initializes a SuperpixelSLIC object for the input image. It sets the parameters of chosen 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.

public static SuperpixelSLIC Create(InputArray image, SLICType algorithm = SLICType.SLICO, int regionSize = 10, float ruler = 10)

Parameters

image InputArray

Image to segment

algorithm SLICType

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.

regionSize int

Chooses an average superpixel size measured in pixels

ruler float

Chooses the enforcement of superpixel smoothness factor of superpixel

Returns

SuperpixelSLIC