OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.XimgprocModule.ScanSegment Class Reference

Class implementing the F-DBSCAN (Accelerated superpixel image segmentation with a parallelized DBSCAN algorithm) superpixels algorithm by Loke SC, et al. [loke2021accelerated] for original paper. More...

Inheritance diagram for OpenCVForUnity.XimgprocModule.ScanSegment:
OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

int getNumberOfSuperpixels ()
 Returns the actual superpixel segmentation from the last image processed using iterate. More...
 
void iterate (Mat img)
 Calculates the superpixel segmentation on a given image with the initialized parameters in the ScanSegment object. More...
 
void getLabels (Mat labels_out)
 Returns the segmentation labeling of the image. More...
 
void getLabelContourMask (Mat image, bool thick_line)
 Returns the mask of the superpixel segmentation stored in the ScanSegment object. More...
 
void getLabelContourMask (Mat image)
 Returns the mask of the superpixel segmentation stored in the ScanSegment object. More...
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
IntPtr getNativeObjAddr ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
virtual bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
void save (string filename)
 
virtual string getDefaultName ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new ScanSegment __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.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

Class implementing the F-DBSCAN (Accelerated superpixel image segmentation with a parallelized DBSCAN algorithm) superpixels algorithm by Loke SC, et al. [loke2021accelerated] for original paper.

The algorithm uses a parallelised DBSCAN cluster search that is resistant to noise, competitive in segmentation quality, and faster than existing superpixel segmentation methods. When tested on the Berkeley Segmentation Dataset, the average processing speed is 175 frames/s with a Boundary Recall of 0.797 and an Achievable Segmentation Accuracy of 0.944. The computational complexity is quadratic O(n2) and more suited to smaller images, but can still process a 2MP colour image faster than the SEEDS algorithm in OpenCV. The output is deterministic when the number of processing threads is fixed, and requires the source image to be in Lab colour format.

Member Function Documentation

◆ __fromPtr__()

static new ScanSegment OpenCVForUnity.XimgprocModule.ScanSegment.__fromPtr__ ( IntPtr  addr)
static

◆ Dispose()

override void OpenCVForUnity.XimgprocModule.ScanSegment.Dispose ( bool  disposing)
protectedvirtual

◆ getLabelContourMask() [1/2]

void OpenCVForUnity.XimgprocModule.ScanSegment.getLabelContourMask ( Mat  image,
bool  thick_line 
)

Returns the mask of the superpixel segmentation stored in the ScanSegment object.

The function return the boundaries of the superpixel segmentation.

Parameters
imageReturn: CV_8UC1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.
thick_lineIf false, the border is only one pixel wide, otherwise all pixels at the border are masked.

◆ getLabelContourMask() [2/2]

void OpenCVForUnity.XimgprocModule.ScanSegment.getLabelContourMask ( Mat  image)

Returns the mask of the superpixel segmentation stored in the ScanSegment object.

The function return the boundaries of the superpixel segmentation.

Parameters
imageReturn: CV_8UC1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.
thick_lineIf false, the border is only one pixel wide, otherwise all pixels at the border are masked.

◆ getLabels()

void OpenCVForUnity.XimgprocModule.ScanSegment.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.

Parameters
labels_outReturn: A CV_32UC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

◆ getNumberOfSuperpixels()

int OpenCVForUnity.XimgprocModule.ScanSegment.getNumberOfSuperpixels ( )

Returns the actual superpixel segmentation from the last image processed using iterate.

Returns zero if no image has been processed.

◆ iterate()

void OpenCVForUnity.XimgprocModule.ScanSegment.iterate ( Mat  img)

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 createScanSegment(). This save the computational cost of allocating memory for all the structures of the algorithm.

Parameters
imgInput image. Supported format: CV_8UC3. Image size must match with the initialized image size with the function createScanSegment(). It MUST be in Lab color space.

The documentation for this class was generated from the following file: