OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.XimgprocModule.SuperpixelLSC Class Reference

Class implementing the LSC (Linear Spectral Clustering) superpixels algorithm described in [LiCVPR2015LSC]. More...

Inheritance diagram for OpenCVForUnity.XimgprocModule.SuperpixelLSC:
OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

int getNumberOfSuperpixels ()
 Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelLSC object. More...
 
void iterate (int num_iterations)
 Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object. More...
 
void iterate ()
 Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object. More...
 
void getLabels (Mat labels_out)
 Returns the segmentation labeling of the image. More...
 
void getLabelContourMask (Mat image, bool thick_line)
 Returns the mask of the superpixel segmentation stored in SuperpixelLSC object. More...
 
void getLabelContourMask (Mat image)
 Returns the mask of the superpixel segmentation stored in SuperpixelLSC object. More...
 
void enforceLabelConnectivity (int min_element_size)
 Enforce label connectivity. More...
 
void enforceLabelConnectivity ()
 Enforce label connectivity. More...
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
IntPtr getNativeObjAddr ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
virtual bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
void save (string filename)
 
virtual string getDefaultName ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new SuperpixelLSC __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

Class implementing the LSC (Linear Spectral Clustering) superpixels algorithm described in [LiCVPR2015LSC].

LSC (Linear Spectral Clustering) produces compact and uniform superpixels with low computational costs. Basically, a normalized cuts formulation of the superpixel segmentation is adopted based on a similarity metric that measures the color similarity and space proximity between image pixels. LSC is of linear computational complexity and high memory efficiency and is able to preserve global properties of images

Member Function Documentation

◆ __fromPtr__()

static new SuperpixelLSC OpenCVForUnity.XimgprocModule.SuperpixelLSC.__fromPtr__ ( IntPtr  addr)
static

◆ Dispose()

override void OpenCVForUnity.XimgprocModule.SuperpixelLSC.Dispose ( bool  disposing)
protectedvirtual

◆ enforceLabelConnectivity() [1/2]

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.enforceLabelConnectivity ( int  min_element_size)

Enforce label connectivity.

Parameters
min_element_sizeThe 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.

◆ enforceLabelConnectivity() [2/2]

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.enforceLabelConnectivity ( )

Enforce label connectivity.

Parameters
min_element_sizeThe 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.

◆ getLabelContourMask() [1/2]

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.getLabelContourMask ( Mat  image,
bool  thick_line 
)

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Parameters
imageReturn: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.
thick_lineIf false, the border is only one pixel wide, otherwise all pixels at the border are masked.

The function return the boundaries of the superpixel segmentation.

◆ getLabelContourMask() [2/2]

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.getLabelContourMask ( Mat  image)

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Parameters
imageReturn: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.
thick_lineIf false, the border is only one pixel wide, otherwise all pixels at the border are masked.

The function return the boundaries of the superpixel segmentation.

◆ getLabels()

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.getLabels ( Mat  labels_out)

Returns the segmentation labeling of the image.

Each label represents a superpixel, and each pixel is assigned to one superpixel label.

Parameters
labels_outReturn: A CV_32SC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

The function returns an image with the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

◆ getNumberOfSuperpixels()

int OpenCVForUnity.XimgprocModule.SuperpixelLSC.getNumberOfSuperpixels ( )

Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelLSC object.

◆ iterate() [1/2]

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.iterate ( int  num_iterations)

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_iterationsNumber 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.

◆ iterate() [2/2]

void OpenCVForUnity.XimgprocModule.SuperpixelLSC.iterate ( )

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_iterationsNumber 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.

The documentation for this class was generated from the following file: