Click or drag to resize

SuperpixelSEEDS Class

Class implementing the SEEDS (Superpixels Extracted via Energy-Driven Sampling) superpixels algorithm described in @cite VBRV14. The algorithm uses an efficient hill-climbing algorithm to optimize the superpixels' energy function that is based on color histograms and a boundary term, which is optional.The energy function encourages superpixels to be of the same color, and if the boundary term is activated, the superpixels have smooth boundaries and are of similar shape. In practice it starts from a regular grid of superpixels and moves the pixels or blocks of pixels at the boundaries to refine the solution.The algorithm runs in real-time using a single CPU.
Inheritance Hierarchy

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

The SuperpixelSEEDS type exposes the following members.

Constructors
  NameDescription
Protected methodSuperpixelSEEDS
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
Initializes a SuperpixelSEEDS object. The function initializes a SuperpixelSEEDS object for the input image. It stores the parameters of the image: image_width, image_height and image_channels.It also sets the parameters of the SEEDS superpixel algorithm, which are: num_superpixels, num_levels, use_prior, histogram_bins and double_step. The number of levels in num_levels defines the amount of block levels that the algorithm use in the optimization.The initialization is a grid, in which the superpixels are equally distributed through the width and the height of the image.The larger blocks correspond to the superpixel size, and the levels with smaller blocks are formed by dividing the larger blocks into 2 x 2 blocks of pixels, recursively until the smaller block level. An example of initialization of 4 block levels is illustrated in the following figure.
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 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 SuperpixelSEEDS 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 ssthe labels of the superpixel segmentation. The labels are in the range[0, getNumberOfSuperpixels()].
Public methodGetNumberOfSuperpixels
Calculates the superpixel segmentation on a given image stored in SuperpixelSEEDS object. The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelSEEDS().
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIterate
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.
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