@Namespace(value="cv::ximgproc") @Properties(inherit=opencv_ximgproc.class) public class SuperpixelSLIC extends Algorithm
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 \cite Achanta2012. MSLIC stands for "Manifold SLIC" and it is an optimization of baseline SLIC described in \cite Liu_2017_IEEE.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
SuperpixelSLIC(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
enforceLabelConnectivity() |
void |
enforceLabelConnectivity(int min_element_size)
\brief Enforce label connectivity.
|
void |
getLabelContourMask(GpuMat image) |
void |
getLabelContourMask(GpuMat image,
boolean thick_line) |
void |
getLabelContourMask(Mat image) |
void |
getLabelContourMask(Mat image,
boolean thick_line)
\brief Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object.
|
void |
getLabelContourMask(UMat image) |
void |
getLabelContourMask(UMat image,
boolean thick_line) |
void |
getLabels(GpuMat labels_out) |
void |
getLabels(Mat labels_out)
\brief Returns the segmentation labeling of the image.
|
void |
getLabels(UMat labels_out) |
int |
getNumberOfSuperpixels()
\brief Calculates the actual amount of superpixels on a given segmentation computed
and stored in SuperpixelSLIC object.
|
void |
iterate() |
void |
iterate(int num_iterations)
\brief Calculates the superpixel segmentation on a given image with the initialized
parameters in the SuperpixelSLIC object.
|
clear, empty, getDefaultName, position, read, save, save, write, write, write
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public SuperpixelSLIC(Pointer p)
Pointer.Pointer(Pointer)
.public int getNumberOfSuperpixels()
public void iterate(int num_iterations)
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.
public void iterate()
public void getLabels(@ByVal Mat labels_out)
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()].
public void getLabelContourMask(@ByVal Mat image, @Cast(value="bool") boolean thick_line)
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.
public void getLabelContourMask(@ByVal UMat image, @Cast(value="bool") boolean thick_line)
public void getLabelContourMask(@ByVal GpuMat image, @Cast(value="bool") boolean thick_line)
public void enforceLabelConnectivity(int min_element_size)
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.
public void enforceLabelConnectivity()
Copyright © 2020. All rights reserved.