Table of Contents

Class ScanSegment

Namespace
OpenCvSharp.XImgProc
Assembly
OpenCvSharp.dll

Class implementing the F-DBSCAN (Accelerated superpixel image segmentation with a parallelized DBSCAN algorithm) superpixels algorithm.

The algorithm uses a parallelised DBSCAN cluster search that is resistant to noise, competitive in segmentation quality, and faster than existing superpixel segmentation methods. The output is deterministic when the number of processing threads is fixed, and requires the source image to be in Lab colour format.

public class ScanSegment : Algorithm, IDisposable
Inheritance
ScanSegment
Implements
Inherited Members

Methods

Create(int, int, int, int, bool)

Initializes a ScanSegment object.

The function initializes a ScanSegment object for the input image. It stores the parameters of the image: image_width and image_height. It also sets the parameters of the F-DBSCAN superpixel algorithm, which are: num_superpixels, threads, and merge_small.

GetLabelContourMask(OutputArray, bool)

Returns the mask of the superpixel segmentation stored in the ScanSegment object. The function returns the boundaries of the superpixel segmentation.

GetLabels(OutputArray)

Returns the segmentation labeling of the image. Each label represents a superpixel, and each pixel is assigned to one superpixel label.

GetNumberOfSuperpixels()

Returns the actual superpixel segmentation from the last image processed using Iterate. Returns zero if no image has been processed.

Iterate(InputArray)

Calculates the superpixel segmentation on a given image with the initialized parameters in the ScanSegment object.

This function can be called again for other images without the need of initializing the algorithm with Create(). This saves the computational cost of allocating memory for all the structures of the algorithm.