Click or drag to resize

SuperpixelLSC Class

Class implementing the LSC (Linear Spectral Clustering) superpixels algorithm described in @cite LiCVPR2015LSC. LSC(Linear Spectral Clustering) produces compact and uniform superpixels with low computational costs.Basically, a normalized cuts formulation of the superpixel segmentation is adopted based on a similarity metric that measures the color similarity and space proximity between image pixels.LSC is of linear computational complexity and high memory efficiency and is able to preserve global properties of images.
Inheritance Hierarchy

Namespace:  OpenCvSharp.XImgProc
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public class SuperpixelLSC : Algorithm

The SuperpixelLSC type exposes the following members.

Constructors
  NameDescription
Protected methodSuperpixelLSC
Creates instance by raw pointer
Top
Properties
  NameDescription
Protected propertyAllocatedMemory
Gets or sets a memory address allocated by AllocMemory.
(Inherited from DisposableObject.)
Protected propertyAllocatedMemorySize
Gets or sets the byte length of the allocated memory
(Inherited from DisposableObject.)
Public propertyCvPtr
Native pointer of OpenCV structure
(Inherited from DisposableCvObject.)
Protected propertyDataHandle
Gets or sets a handle which allocates using cvSetData.
(Inherited from DisposableObject.)
Public propertyEmpty
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
(Inherited from Algorithm.)
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed.
(Inherited from DisposableObject.)
Public propertyIsEnabledDispose
Gets or sets a value indicating whether you permit disposing this instance.
(Inherited from DisposableObject.)
Top
Methods
  NameDescription
Protected methodAllocGCHandle
Pins the object to be allocated by cvSetData.
(Inherited from DisposableObject.)
Protected methodAllocMemory
Allocates the specified size of memory.
(Inherited from DisposableObject.)
Public methodStatic memberCreate
Class implementing the LSC (Linear Spectral Clustering) superpixels. The function initializes a SuperpixelLSC object for the input image. It sets the parameters of superpixel algorithm, which are: region_size and ruler.It preallocate some buffers for future computing iterations over the given image.An example of LSC is illustrated in the following picture. For enhanced results it is recommended for color images to preprocess image with little gaussian blur with a small 3 x 3 kernel and additional conversion into CieLAB color space.
Public methodDispose
Releases the resources
(Inherited from DisposableObject.)
Protected methodDispose(Boolean)
Releases the resources
(Inherited from DisposableObject.)
Protected methodDisposeManaged
Releases managed resources
(Overrides DisposableObjectDisposeManaged.)
Protected methodDisposeUnmanaged
releases unmanaged resources
(Inherited from DisposableCvObject.)
Public methodEnforceLabelConnectivity
Enforce label connectivity. 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 methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Destructor
(Inherited from DisposableObject.)
Public methodGetDefaultName
Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
(Inherited from Algorithm.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetLabelContourMask
Returns the mask of the superpixel segmentation stored in SuperpixelLSC object. The function return the boundaries of the superpixel segmentation.
Public methodGetLabels
Returns the segmentation labeling of the image. Each label represents a superpixel, and each pixel is assigned to one superpixel label. The function returns an image with the labels of the superpixel segmentation.The labels are in the range [0, getNumberOfSuperpixels()].
Public methodGetNumberOfSuperpixels
Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelLSC object.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIterate
Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object. This function can be called again without the need of initializing the algorithm with createSuperpixelLSC(). This save the computational cost of allocating memory for all the structures of the algorithm. 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.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodNotifyMemoryPressure
Notifies the allocated size of memory.
(Inherited from DisposableObject.)
Public methodRead
Reads algorithm parameters from a file storage
(Inherited from Algorithm.)
Public methodSave
Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage fs).
(Inherited from Algorithm.)
Public methodThrowIfDisposed
If this object is disposed, then ObjectDisposedException is thrown.
(Inherited from DisposableObject.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWrite
Stores algorithm parameters in a file storage
(Inherited from Algorithm.)
Top
Fields
  NameDescription
Protected fieldptr
Data pointer
(Inherited from DisposableCvObject.)
Top
See Also