OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
Class implementing the SLIC (Simple Linear Iterative Clustering) superpixels algorithm described in [Achanta2012]. More...
Public Member Functions | |
void | enforceLabelConnectivity () |
Enforce label connectivity. | |
void | enforceLabelConnectivity (int min_element_size) |
Enforce label connectivity. | |
void | getLabelContourMask (Mat image) |
Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object. | |
void | getLabelContourMask (Mat image, bool thick_line) |
Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object. | |
void | getLabels (Mat labels_out) |
Returns the segmentation labeling of the image. | |
int | getNumberOfSuperpixels () |
Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelSLIC object. | |
void | iterate () |
Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelSLIC object. | |
void | iterate (int num_iterations) |
Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelSLIC object. | |
Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
virtual void | clear () |
Clears the algorithm state. | |
virtual bool | empty () |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. | |
virtual string | getDefaultName () |
IntPtr | getNativeObjAddr () |
void | save (string filename) |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static new SuperpixelSLIC | __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.CoreModule.Algorithm | |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Package Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
Class implementing the SLIC (Simple Linear Iterative Clustering) superpixels algorithm described in [Achanta2012].
SLIC (Simple Linear Iterative Clustering) clusters pixels using pixel channels and image plane space to efficiently generate compact, nearly uniform superpixels. The simplicity of approach makes it extremely easy to use a lone parameter specifies the number of superpixels and the efficiency of the algorithm makes it very practical. Several optimizations are available for SLIC class: SLICO stands for "Zero parameter SLIC" and it is an optimization of baseline SLIC described in [Achanta2012]. MSLIC stands for "Manifold SLIC" and it is an optimization of baseline SLIC described in [Liu_2017_IEEE].
|
static |
|
protectedvirtual |
Reimplemented from OpenCVForUnity.CoreModule.Algorithm.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.enforceLabelConnectivity | ( | ) |
Enforce label connectivity.
min_element_size | The 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.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.enforceLabelConnectivity | ( | int | min_element_size | ) |
Enforce label connectivity.
min_element_size | The 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.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.getLabelContourMask | ( | Mat | image | ) |
Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object.
image | Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise. |
thick_line | If 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.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.getLabelContourMask | ( | Mat | image, |
bool | thick_line ) |
Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object.
image | Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise. |
thick_line | If 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.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.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.
labels_out | Return: 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()].
int OpenCVForUnity.XimgprocModule.SuperpixelSLIC.getNumberOfSuperpixels | ( | ) |
Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelSLIC object.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.iterate | ( | ) |
Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelSLIC object.
This function can be called again without the need of initializing the algorithm with createSuperpixelSLIC(). This save the computational cost of allocating memory for all the structures of the algorithm.
num_iterations | Number of iterations. Higher number improves the result. |
The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelSLIC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.
void OpenCVForUnity.XimgprocModule.SuperpixelSLIC.iterate | ( | int | num_iterations | ) |
Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelSLIC object.
This function can be called again without the need of initializing the algorithm with createSuperpixelSLIC(). This save the computational cost of allocating memory for all the structures of the algorithm.
num_iterations | Number of iterations. Higher number improves the result. |
The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelSLIC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.