Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
SLIC Class Reference

#include <SLIC.h>

Collaboration diagram for SLIC:
Collaboration graph

Public Member Functions

 SLIC ()
 
virtual ~SLIC ()
 
void DoSuperpixelSegmentation_ForGivenSuperpixelSize (const unsigned int *ubuff, const int width, const int height, int *&klabels, int &numlabels, const int &superpixelsize, const double &compactness)
 
void DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels (const unsigned int *ubuff, const int width, const int height, int *&klabels, int &numlabels, const int &K, const double &compactness)
 
void DoSupervoxelSegmentation (unsigned int **&ubuffvec, const int &width, const int &height, const int &depth, int **&klabels, int &numlabels, const int &supervoxelsize, const double &compactness)
 
void SaveSuperpixelLabels (const int *&labels, const int &width, const int &height, const string &filename, const string &path)
 
void SaveSupervoxelLabels (const int **&labels, const int &width, const int &height, const int &depth, const string &filename, const string &path)
 
void DrawContoursAroundSegments (unsigned int *&segmentedImage, int *&labels, const int &width, const int &height, const unsigned int &color)
 

Detailed Description

Definition at line 23 of file SLIC.h.

Constructor & Destructor Documentation

SLIC::SLIC ( )

Definition at line 19 of file SLIC.cpp.

SLIC::~SLIC ( )
virtual

Definition at line 30 of file SLIC.cpp.

Member Function Documentation

void SLIC::DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels ( const unsigned int *  ubuff,
const int  width,
const int  height,
int *&  klabels,
int &  numlabels,
const int &  K,
const double &  compactness 
)

DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels

The input parameter ubuff conains RGB values in a 32-bit unsigned integers as follows:

[1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1]

   Nothing              R                 G                  B

The RGB values are accessed from (and packed into) the unsigned integers using bitwise operators as can be seen in the function DoRGBtoLABConversion().

compactness value depends on the input pixels values. For instance, if the input is greyscale with values ranging from 0-100, then a compactness value of 20.0 would give good results. A greater value will make the superpixels more compact while a smaller value would make them more uneven.

The labels can be saved if needed using SaveSuperpixelLabels()

Definition at line 1186 of file SLIC.cpp.

void SLIC::DoSuperpixelSegmentation_ForGivenSuperpixelSize ( const unsigned int *  ubuff,
const int  width,
const int  height,
int *&  klabels,
int &  numlabels,
const int &  superpixelsize,
const double &  compactness 
)

DoSuperpixelSegmentation_ForGivenSuperpixelSize

The input parameter ubuff conains RGB values in a 32-bit unsigned integers as follows:

[1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1]

   Nothing              R                 G                  B

The RGB values are accessed from (and packed into) the unsigned integers using bitwise operators as can be seen in the function DoRGBtoLABConversion().

compactness value depends on the input pixels values. For instance, if the input is greyscale with values ranging from 0-100, then a compactness value of 20.0 would give good results. A greater value will make the superpixels more compact while a smaller value would make them more uneven.

The labels can be saved if needed using SaveSuperpixelLabels()

Definition at line 1110 of file SLIC.cpp.

void SLIC::DoSupervoxelSegmentation ( unsigned int **&  ubuffvec,
const int &  width,
const int &  height,
const int &  depth,
int **&  klabels,
int &  numlabels,
const int &  supervoxelsize,
const double &  compactness 
)

DoSupervoxelSegmentation

There is option to save the labels if needed.

The input parameter ubuffvec holds all the video frames. It is a 2-dimensional array. The first dimension is depth and the second dimension is pixel location in a frame. For example, to access a pixel in the 3rd frame (i.e. depth index 2), in the 4th row (i.e. height index 3) on the 37th column (i.e. width index 36), you would write:

unsigned int the_pixel_i_want = ubuffvec[2][3*width + 36]

In addition, here is how the RGB values are contained in a 32-bit unsigned integer:

[1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1]

   Nothing              R                 G                  B

The RGB values are accessed from (and packed into) the unsigned integers using bitwise operators as can be seen in the function DoRGBtoLABConversion().

compactness value depends on the input pixels values. For instance, if the input is greyscale with values ranging from 0-100, then a compactness value of 20.0 would give good results. A greater value will make the supervoxels more compact while a smaller value would make them more uneven.

Definition at line 1227 of file SLIC.cpp.

void SLIC::DrawContoursAroundSegments ( unsigned int *&  ubuff,
int *&  labels,
const int &  width,
const int &  height,
const unsigned int &  color 
)

DrawContoursAroundSegments

Internal contour drawing option exists. One only needs to comment the if statement inside the loop that looks at neighbourhood.

Definition at line 180 of file SLIC.cpp.

void SLIC::SaveSuperpixelLabels ( const int *&  labels,
const int &  width,
const int &  height,
const string &  filename,
const string &  path 
)

SaveSuperpixelLabels

Save labels in raster scan order.

Definition at line 778 of file SLIC.cpp.

void SLIC::SaveSupervoxelLabels ( const int **&  labels,
const int &  width,
const int &  height,
const int &  depth,
const string &  filename,
const string &  path 
)

SaveSupervoxelLabels

Save labels in raster scan order.

Definition at line 818 of file SLIC.cpp.


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