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

The nearest neighbor classifier is invoked at the top level to evaluate detections. More...

#include <NNClassifier.h>

List of all members.

Public Member Functions

void addObject (const NNPatch &patch)
 Initializes a new object class with the given patch.
double getConf (const NNPatch &patch, int objId=0, bool conservative=false) const
 Returns the confidence of a given patch with respect to a certain class.
double getConf (NNPatch &patch, int objId, bool conservative, const ObjectBox &bbox, const unsigned char *rgb, int w, int h) const
 Returns the confidence of a given patch while subsequently computing and saving the color histogram if needed.
const std::vector< NNPatch > * getNegPatches () const
 Returns a pointer to negative patches (intended for drawing).
const std::vector< std::vector
< NNPatch > > * 
getPosPatches () const
 Returns a pointer to positive patches (intended for drawing).
 NNClassifier (int width, int height, int patchSize, bool useColor=true, bool allowFastChange=false)
 Constructor.
 NNClassifier (std::ifstream &inputStream)
 Constructor for loading from file.
void removeWarps ()
 Removes previously added warps (rotated patches) from positive list.
void saveToStream (std::ofstream &outputStream) const
 Saves the classifier (i.e. the patches) to file.
bool trainNN (const NNPatch &patch, int objId=0, bool positive=true, bool tmp=false)
 Trains a new patch to the classifier if it is considered "new" enough.

Private Member Functions

double cmpHistograms (const float *h1, const float *h2) const
double crossCorr (const float *patchA, const float *patchB, float denom=1) const
double getConf (const float *patch, float norm2=1.0f, int objId=0, bool conservative=false) const

Private Attributes

bool ivAllowFastChange
int ivHeight
std::vector< NNPatchivNegPatches
int ivPatchSize
std::vector< std::vector
< NNPatch > > 
ivPosPatches
bool ivUseColor
std::vector< char > ivWarpIndices
int ivWidth

Static Private Attributes

static HistogramivHistogram = Histogram::getInstance()

Detailed Description

The nearest neighbor classifier is invoked at the top level to evaluate detections.

Definition at line 65 of file NNClassifier.h.


Constructor & Destructor Documentation

motld::NNClassifier::NNClassifier ( int  width,
int  height,
int  patchSize,
bool  useColor = true,
bool  allowFastChange = false 
)

Constructor.

Definition at line 216 of file NNClassifier.h.

motld::NNClassifier::NNClassifier ( std::ifstream &  inputStream)

Constructor for loading from file.

Definition at line 220 of file NNClassifier.h.


Member Function Documentation

Initializes a new object class with the given patch.

Definition at line 260 of file NNClassifier.h.

double motld::NNClassifier::cmpHistograms ( const float h1,
const float h2 
) const [private]

Definition at line 404 of file NNClassifier.h.

double motld::NNClassifier::crossCorr ( const float patchA,
const float patchB,
float  denom = 1 
) const [private]

Definition at line 393 of file NNClassifier.h.

double motld::NNClassifier::getConf ( const NNPatch patch,
int  objId = 0,
bool  conservative = false 
) const

Returns the confidence of a given patch with respect to a certain class.

Parameters:
patchthe patch that shall be evaluated
objIdId of the class to compare or -1 for comparison to negative (background) patches
conservativeIf true earlier positive patches are weighted more.

Definition at line 308 of file NNClassifier.h.

double motld::NNClassifier::getConf ( NNPatch patch,
int  objId,
bool  conservative,
const ObjectBox bbox,
const unsigned char *  rgb,
int  w,
int  h 
) const

Returns the confidence of a given patch while subsequently computing and saving the color histogram if needed.

See also:
getConf(const NNPatch& patch, int objId, bool conservative)

Definition at line 326 of file NNClassifier.h.

double motld::NNClassifier::getConf ( const float patch,
float  norm2 = 1.0f,
int  objId = 0,
bool  conservative = false 
) const [private]

Definition at line 352 of file NNClassifier.h.

Returns a pointer to negative patches (intended for drawing).

Definition at line 245 of file NNClassifier.h.

Returns a pointer to positive patches (intended for drawing).

Definition at line 241 of file NNClassifier.h.

Removes previously added warps (rotated patches) from positive list.

Definition at line 250 of file NNClassifier.h.

void motld::NNClassifier::saveToStream ( std::ofstream &  outputStream) const

Saves the classifier (i.e. the patches) to file.

Definition at line 418 of file NNClassifier.h.

bool motld::NNClassifier::trainNN ( const NNPatch patch,
int  objId = 0,
bool  positive = true,
bool  tmp = false 
)

Trains a new patch to the classifier if it is considered "new" enough.

Parameters:
patchthe patch that shall be learned
objIdid of the object class to which the patch should be added
positivetrue if element of this class, false if not (background patch)
tmptrue if this is a temporary (warped) patch
Returns:
true if the patch was added.

Definition at line 284 of file NNClassifier.h.


Member Data Documentation

Definition at line 98 of file NNClassifier.h.

Definition at line 92 of file NNClassifier.h.

Definition at line 94 of file NNClassifier.h.

Definition at line 96 of file NNClassifier.h.

Definition at line 93 of file NNClassifier.h.

Definition at line 95 of file NNClassifier.h.

Definition at line 98 of file NNClassifier.h.

Definition at line 97 of file NNClassifier.h.

Definition at line 91 of file NNClassifier.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