VAT  3.0
Video Analysis Tool
Public Member Functions | List of all members
SLIC Class Reference

Public Member Functions

void DoSuperpixelSegmentation_ForGivenSuperpixelSize (const unsigned char *ubuff, const int width, const int height, int *&klabels, int &numlabels, const int &superpixelsize, const double &compactness)
 
void DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels (const unsigned char *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 DrawContoursAroundSegments (unsigned char *&ubuff, int *&labels, const int &width, const int &height)
 

Member Function Documentation

void SLIC::DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels ( const unsigned char *  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()

void SLIC::DoSuperpixelSegmentation_ForGivenSuperpixelSize ( const unsigned char *  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() Modified by M. Zuniga to get a BGRA vector from QT Image.

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.


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