public class SuperpixelSEEDS extends Algorithm
Modifier | Constructor and Description |
---|---|
protected |
SuperpixelSEEDS(long addr) |
Modifier and Type | Method and Description |
---|---|
static SuperpixelSEEDS |
__fromPtr__(long addr) |
protected void |
finalize() |
void |
getLabelContourMask(Mat image)
Returns the mask of the superpixel segmentation stored in SuperpixelSEEDS object.
|
void |
getLabelContourMask(Mat image,
boolean thick_line)
Returns the mask of the superpixel segmentation stored in SuperpixelSEEDS object.
|
void |
getLabels(Mat labels_out)
Returns the segmentation labeling of the image.
|
int |
getNumberOfSuperpixels()
Calculates the superpixel segmentation on a given image stored in SuperpixelSEEDS object.
|
void |
iterate(Mat img)
Calculates the superpixel segmentation on a given image with the initialized
parameters in the SuperpixelSEEDS object.
|
void |
iterate(Mat img,
int num_iterations)
Calculates the superpixel segmentation on a given image with the initialized
parameters in the SuperpixelSEEDS object.
|
clear, empty, getDefaultName, getNativeObjAddr, save
public static SuperpixelSEEDS __fromPtr__(long addr)
public int getNumberOfSuperpixels()
public void getLabelContourMask(Mat image, boolean thick_line)
image
- Return: CV_8UC1 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.
Note:
public void getLabelContourMask(Mat image)
image
- Return: CV_8UC1 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.
Note:
public void getLabels(Mat labels_out)
labels_out
- Return: A CV_32UC1 integer array containing the labels of the superpixel
segmentation. The labels are in the range [0, getNumberOfSuperpixels()].
The function returns an image with ssthe labels of the superpixel segmentation. The labels are in
the range [0, getNumberOfSuperpixels()].public void iterate(Mat img, int num_iterations)
img
- Input image. Supported formats: CV_8U, CV_16U, CV_32F. Image size & number of
channels must match with the initialized image size & channels with the function
createSuperpixelSEEDS(). It should be in HSV or Lab color space. Lab is a bit better, but also
slower.num_iterations
- Number of pixel level iterations. Higher number improves the result.
The function computes the superpixels segmentation of an image with the parameters initialized
with the function createSuperpixelSEEDS(). The algorithms starts from a grid of superpixels and
then refines the boundaries by proposing updates of blocks of pixels that lie at the boundaries
from large to smaller size, finalizing with proposing pixel updates. An illustrative example
can be seen below.
![image](pics/superpixels_blocks2.png)public void iterate(Mat img)
img
- Input image. Supported formats: CV_8U, CV_16U, CV_32F. Image size & number of
channels must match with the initialized image size & channels with the function
createSuperpixelSEEDS(). It should be in HSV or Lab color space. Lab is a bit better, but also
slower.
The function computes the superpixels segmentation of an image with the parameters initialized
with the function createSuperpixelSEEDS(). The algorithms starts from a grid of superpixels and
then refines the boundaries by proposing updates of blocks of pixels that lie at the boundaries
from large to smaller size, finalizing with proposing pixel updates. An illustrative example
can be seen below.
![image](pics/superpixels_blocks2.png)Generated on Wed Oct 9 2019 23:24:43 UTC / OpenCV 4.1.2