All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
motld::MultiObjectTLD Class Reference

The main class. More...

#include <MultiObjectTLD.h>

List of all members.

Public Member Functions

void addObject (ObjectBox b)
 Marks a new object in the previously passed frame.
void addObjects (std::vector< ObjectBox > obs)
 Adds multiple objects in the previously passed frame.
void enableLearning (bool enable=true)
 En/Disables learning (i.e. updating the classifiers) at runtime.
void getDebugImage (unsigned char *src, Matrix &rMat, Matrix &gMat, Matrix &bMat, int mode=255) const
 Writes a colored debug image into the given rgb matrices. Details see writeDebugImage().
ObjectBox getObjectBox () const
 Returns the location of the first object.
std::vector< ObjectBoxgetObjectBoxes () const
 Returns the current object positions.
int getStatus (const int objId=0) const
 Returns current status of object objId.
bool getValid () const
 Returns if the first object is valid (equivalent to getStatus(0) returning STATUS_OK)
 MultiObjectTLD (const int width, const int height, const MOTLDSettings &settings=MOTLDSettings())
 Default constructor.
void processFrame (unsigned char *img)
 Processes the current frame (tracking - detecting - learning)
void saveClassifier (const char *filename) const
 Saves the classifier to a (binary) file.
void writeDebugImage (unsigned char *src, char *filename, int mode=255) const
 Saves an output image to file in PPM format.

Static Public Member Functions

static MultiObjectTLD loadClassifier (const char *filename)
 Returns an instance of MultiObjectTLD while loading the classifier from file.

Private Member Functions

void clusterDetections (float threshold)
 MultiObjectTLD (int width, int height, int colorMode, int patchSize, int bbMin, bool useColor, bool fastRotation, NNClassifier nnc, FernFilter ff, int nObjects, float aspectRatio, bool learningEnabled)

Private Attributes

float ivAspectRatio
int ivBBmin
int ivColorMode
Matrix ivCurImage
unsigned char * ivCurImagePtr
std::vector< ObjectBoxivCurrentBoxes
std::vector< NNPatchivCurrentPatches
std::vector< boolivDefined
bool ivEnableFastRotation
FernFilter ivFernFilter
int ivHeight
std::vector< FernDetectionivLastDetectionClusters
std::vector< FernDetectionivLastDetections
bool ivLearningEnabled
LKTracker ivLKTracker
int ivNLastDetections
NNClassifier ivNNClassifier
int ivNObjects
int ivPatchSize
bool ivUseColor
std::vector< boolivValid
int ivWidth

Detailed Description

The main class.

Definition at line 92 of file MultiObjectTLD.h.


Constructor & Destructor Documentation

motld::MultiObjectTLD::MultiObjectTLD ( const int  width,
const int  height,
const MOTLDSettings settings = MOTLDSettings() 
) [inline]

Default constructor.

Parameters:
widthwidth...
height...and height of the images in the sequence
settingsconfiguration structure (see class MOTLDSettings for more details)

Definition at line 100 of file MultiObjectTLD.h.

motld::MultiObjectTLD::MultiObjectTLD ( int  width,
int  height,
int  colorMode,
int  patchSize,
int  bbMin,
bool  useColor,
bool  fastRotation,
NNClassifier  nnc,
FernFilter  ff,
int  nObjects,
float  aspectRatio,
bool  learningEnabled 
) [private]

Definition at line 756 of file MultiObjectTLD.h.


Member Function Documentation

Marks a new object in the previously passed frame.

Note:
To add multiple objects in a single frame please prefer addObjects().

Definition at line 201 of file MultiObjectTLD.h.

Adds multiple objects in the previously passed frame.

Note:
For efficiency reasons all object boxes need to have the same aspect ratio. All further boxes are automatically reshaped to the aspect ratio of the first object box while preserving the area.

Definition at line 208 of file MultiObjectTLD.h.

void motld::MultiObjectTLD::clusterDetections ( float  threshold) [private]

Definition at line 538 of file MultiObjectTLD.h.

void motld::MultiObjectTLD::enableLearning ( bool  enable = true) [inline]

En/Disables learning (i.e. updating the classifiers) at runtime.

Definition at line 127 of file MultiObjectTLD.h.

void motld::MultiObjectTLD::getDebugImage ( unsigned char *  src,
Matrix rMat,
Matrix gMat,
Matrix bMat,
int  mode = 255 
) const

Writes a colored debug image into the given rgb matrices. Details see writeDebugImage().

Definition at line 660 of file MultiObjectTLD.h.

Returns the location of the first object.

Definition at line 139 of file MultiObjectTLD.h.

Returns the current object positions.

Definition at line 141 of file MultiObjectTLD.h.

int motld::MultiObjectTLD::getStatus ( const int  objId = 0) const

Returns current status of object objId.

Returns:
one of the following states:
  • STATUS_OK: the object is considered to be found correctly in the current frame
  • STATUS_UNSURE: the object may be lost, but is still tracked
  • STATUS_LOST: the object is definitely lost (the corresponding box returned by getObjectBoxes() is invalid)

Definition at line 264 of file MultiObjectTLD.h.

Returns if the first object is valid (equivalent to getStatus(0) returning STATUS_OK)

Definition at line 137 of file MultiObjectTLD.h.

Returns an instance of MultiObjectTLD while loading the classifier from file.

Definition at line 805 of file MultiObjectTLD.h.

void motld::MultiObjectTLD::processFrame ( unsigned char *  img)

Processes the current frame (tracking - detecting - learning)

Parameters:
imgThe image passed as an unsigned char array. The pixels are assumed to be given row by row from top left to bottom right with the image width and height passed to the constructor (see MultiObjectTLD()). In case of COLOR_MODE_RGB the array should have the form [r_0, r_1, ..., r_n, g_0, g_1, ..., g_n, b_0, b_1, ..., b_n].

Definition at line 275 of file MultiObjectTLD.h.

void motld::MultiObjectTLD::saveClassifier ( const char *  filename) const

Saves the classifier to a (binary) file.

Definition at line 777 of file MultiObjectTLD.h.

void motld::MultiObjectTLD::writeDebugImage ( unsigned char *  src,
char *  filename,
int  mode = 255 
) const

Saves an output image to file in PPM format.

Parameters:
srcthe same as passed to processFrame()
filenamethe filename, suggested ending: ".ppm"
modecontrols which components are drawn, bitwise or of DEBUG_DRAW_DETECTIONS, DEBUG_DRAW_PATCHES, DEBUG_DRAW_CROSSES.

The patches on the left side represent negative examples, positive examples are on the right side, starting a new column for each object. The red bars next to the patches sketch the corresponding color histograms. Green boxes represent detections shortlisted by the filtering process (see FernFilter). Blue boxes represent cluster means (if enabled). Blue crosses represent tracking points that are considered as inliers (see LKTracker). A red box stands for STATUS_OK, a yellow box means STATUS_UNSURE (cf. getStatus()).

Definition at line 651 of file MultiObjectTLD.h.


Member Data Documentation

Definition at line 178 of file MultiObjectTLD.h.

Definition at line 170 of file MultiObjectTLD.h.

Definition at line 168 of file MultiObjectTLD.h.

Definition at line 185 of file MultiObjectTLD.h.

unsigned char* motld::MultiObjectTLD::ivCurImagePtr [private]

Definition at line 186 of file MultiObjectTLD.h.

Definition at line 179 of file MultiObjectTLD.h.

Definition at line 182 of file MultiObjectTLD.h.

Definition at line 180 of file MultiObjectTLD.h.

Definition at line 172 of file MultiObjectTLD.h.

Definition at line 175 of file MultiObjectTLD.h.

Definition at line 166 of file MultiObjectTLD.h.

Definition at line 188 of file MultiObjectTLD.h.

Definition at line 187 of file MultiObjectTLD.h.

Definition at line 183 of file MultiObjectTLD.h.

Definition at line 173 of file MultiObjectTLD.h.

Definition at line 189 of file MultiObjectTLD.h.

Definition at line 174 of file MultiObjectTLD.h.

Definition at line 177 of file MultiObjectTLD.h.

Definition at line 169 of file MultiObjectTLD.h.

Definition at line 171 of file MultiObjectTLD.h.

Definition at line 181 of file MultiObjectTLD.h.

Definition at line 165 of file MultiObjectTLD.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


motld
Author(s): Jost Tobias Springenberg, Jan Wuelfing
autogenerated on Wed Dec 26 2012 16:24:49