public class SuperpixelLSC extends Algorithm
Modifier | Constructor and Description |
---|---|
protected |
SuperpixelLSC(long addr) |
Modifier and Type | Method and Description |
---|---|
static SuperpixelLSC |
__fromPtr__(long addr) |
void |
enforceLabelConnectivity()
Enforce label connectivity.
|
void |
enforceLabelConnectivity(int min_element_size)
Enforce label connectivity.
|
protected void |
finalize() |
void |
getLabelContourMask(Mat image)
Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.
|
void |
getLabelContourMask(Mat image,
boolean thick_line)
Returns the mask of the superpixel segmentation stored in SuperpixelLSC 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 SuperpixelLSC object.
|
void |
iterate()
Calculates the superpixel segmentation on a given image with the initialized
parameters in the SuperpixelLSC object.
|
void |
iterate(int num_iterations)
Calculates the superpixel segmentation on a given image with the initialized
parameters in the SuperpixelLSC object.
|
clear, empty, getDefaultName, getNativeObjAddr, save
public static SuperpixelLSC __fromPtr__(long addr)
public int getNumberOfSuperpixels()
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()
public void getLabelContourMask(Mat image, 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(Mat image)
image
- Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border,
and 0 otherwise.
are masked.
The function return the boundaries of the superpixel segmentation.public void getLabels(Mat labels_out)
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 iterate(int num_iterations)
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 createSuperpixelLSC(). The algorithms starts from a grid of superpixels and
then refines the boundaries by proposing updates of edges boundaries.public void iterate()
Generated on Wed Oct 9 2019 23:24:43 UTC / OpenCV 4.1.2