STIRA  0.1
Public Member Functions | List of all members
stira::imageanalysis::SLIC Class Reference

Public Member Functions

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)
 

Member Function Documentation

void stira::imageanalysis::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()

References DoSuperpixelSegmentation_ForGivenSuperpixelSize().

void stira::imageanalysis::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()

Referenced by DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels().

void stira::imageanalysis::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.

void stira::imageanalysis::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.

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

SaveSuperpixelLabels

Save labels in raster scan order.

void stira::imageanalysis::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.


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