used for learning and (re-)finding objects More...
#include <FernFilter.h>
Classes | |
struct | Confidences |
struct | Posteriors |
struct | ScanSettings |
Public Member Functions | |
const std::vector< Matrix > | addObjects (const Matrix &image, const std::vector< ObjectBox > &boxes) |
introduces new objects from a list of object boxes and returns negative training examples | |
void | applyPreferences () |
applies changes made by changeInputFormat() changeScanBoxFormat(), changeScanSettings() | |
void | changeInputFormat (const int &width, const int &height) |
changes input image dimensions (has to be applied with applyPreferences()) | |
void | changeScanBoxFormat (const int &width, const int &height) |
changes default size scan box dimensions (has to be applied with applyPreferences()) | |
void | changeScanSettings (const int &scaleMin, const int &scaleMax, const int &bb_min) |
changes sliding window preferences (has to be applied with applyPreferences()) | |
void | changeWarpSettings (const WarpSettings &initSettings, const WarpSettings &updateSettings) |
changes settings for warping | |
FernFilter (const int &width, const int &height, const int &numFerns, const int &featuresPerFern, const int &patchSize=15, const int &scaleMin=-10, const int &scaleMax=11, const int &bbMin=24) | |
public constructor | |
FernFilter (const FernFilter &other) | |
copy constructor | |
const std::vector< Matrix > | learn (const Matrix &image, const std::vector< ObjectBox > &boxes, bool onlyVariance=false) |
updates the fern structure with information about the correct boxes | |
void | saveToStream (std::ofstream &outputStream) const |
writes FernFilter into binary stream (save procedure) | |
const std::vector< FernDetection > | scanPatch (const Matrix &image) const |
scans fern structure for possible object matches using a sliding window approach | |
~FernFilter () | |
destructor | |
Static Public Member Functions | |
static FernFilter | loadFromStream (std::ifstream &inputStream) |
creates a FernFilter from binary stream (load procedure) | |
Private Member Functions | |
void | addObjectToFerns () |
void | addPatch (const int &objId, const int *const featureData, const bool &pos) |
void | addPatch (const Matrix &scaledImage, const int &objId, const bool &pos) |
void | addPatchWithWarps (const Matrix &image, const ObjectBox &box, const WarpSettings &ws, std::vector< Matrix > &op, const bool &pos, const bool ¬OnlyVar=true) |
void | addWarpedPatches (const Matrix &image, const ObjectBox &box, const WarpSettings &ws, std::vector< Matrix > &op, const bool &pos) |
float * | calcConfidences (int *features) const |
float | calcMaxConfidence (int *features) const |
int | calcTableSize () const |
void | clearLastDetections () const |
void | computeOffsets () |
int ** | computeOffsets (int width) |
FernDetection | copyFernDetection (const FernDetection &fd) const |
int *** | createFeatures () |
void | createScaledMatrices (const Matrix &image, Matrix *&scaled, float **&sats, float **&sat2s) const |
void | createScaledMatrix (const Matrix &image, Matrix &scaled, float *&sat, float *&sat2, int scale) const |
void | debugOutput () const |
int * | extractFeatures (const float *const imageOrSAT, int **offsets) const |
void | extractFeatures (FernDetection &det) const |
void | initializeFerns () |
std::vector< Matrix > | retrieveHighVarianceSamples (const Matrix &image, const std::vector< ObjectBox > &boxes) |
void | varianceFilter (float *image, float *sat, float *sat2, int scale, std::vector< FernDetection > &acc) const |
Private Attributes | |
int | ivBBmin |
int *** | ivFeatures |
int | ivFeaturesPerFern |
std::map< int, Confidences > * | ivFernForest |
int | ivHeight |
WarpSettings | ivInitWarpSettings |
std::vector< FernDetection > | ivLastDetections |
std::vector< float > | ivMinVariances |
int | ivNumFerns |
int | ivNumObjects |
int | ivOriginalHeight |
int | ivOriginalWidth |
int | ivPatchSize |
int | ivPatchSizeMinusOne |
int ** | ivPatchSizeOffsets |
int | ivPatchSizeSquared |
int | ivScaleMax |
int | ivScaleMin |
int | ivScanNoZoom |
std::vector< ScanSettings > | ivScans |
WarpSettings | ivUpdateWarpSettings |
float | ivVarianceThreshold |
int | ivWidth |
Static Private Attributes | |
static const WarpSettings | cDefaultInitWarpSettings = {10, 20, 5, 20, 0.2, 0.2} |
static const WarpSettings | cDefaultUpdateWarpSettings = {10, 10, 5, 20, 0.2, 0.2} |
used for learning and (re-)finding objects
Definition at line 94 of file FernFilter.h.
motld::FernFilter::FernFilter | ( | const int & | width, |
const int & | height, | ||
const int & | numFerns, | ||
const int & | featuresPerFern, | ||
const int & | patchSize = 15 , |
||
const int & | scaleMin = -10 , |
||
const int & | scaleMax = 11 , |
||
const int & | bbMin = 24 |
||
) |
public constructor
Definition at line 248 of file FernFilter.h.
motld::FernFilter::FernFilter | ( | const FernFilter & | other | ) |
copy constructor
Definition at line 690 of file FernFilter.h.
destructor
Definition at line 764 of file FernFilter.h.
const std::vector< Matrix > motld::FernFilter::addObjects | ( | const Matrix & | image, |
const std::vector< ObjectBox > & | boxes | ||
) |
introduces new objects from a list of object boxes and returns negative training examples
Definition at line 264 of file FernFilter.h.
void motld::FernFilter::addObjectToFerns | ( | ) | [inline, private] |
Definition at line 995 of file FernFilter.h.
void motld::FernFilter::addPatch | ( | const int & | objId, |
const int *const | featureData, | ||
const bool & | pos | ||
) | [inline, private] |
Definition at line 1232 of file FernFilter.h.
void motld::FernFilter::addPatch | ( | const Matrix & | scaledImage, |
const int & | objId, | ||
const bool & | pos | ||
) | [inline, private] |
Definition at line 1298 of file FernFilter.h.
void motld::FernFilter::addPatchWithWarps | ( | const Matrix & | image, |
const ObjectBox & | box, | ||
const WarpSettings & | ws, | ||
std::vector< Matrix > & | op, | ||
const bool & | pos, | ||
const bool & | notOnlyVar = true |
||
) | [inline, private] |
Definition at line 1311 of file FernFilter.h.
void motld::FernFilter::addWarpedPatches | ( | const Matrix & | image, |
const ObjectBox & | box, | ||
const WarpSettings & | ws, | ||
std::vector< Matrix > & | op, | ||
const bool & | pos | ||
) | [inline, private] |
Definition at line 1355 of file FernFilter.h.
void motld::FernFilter::applyPreferences | ( | ) |
applies changes made by changeInputFormat() changeScanBoxFormat(), changeScanSettings()
Definition at line 826 of file FernFilter.h.
float * motld::FernFilter::calcConfidences | ( | int * | features | ) | const [inline, private] |
Definition at line 1162 of file FernFilter.h.
float motld::FernFilter::calcMaxConfidence | ( | int * | features | ) | const [inline, private] |
Definition at line 1142 of file FernFilter.h.
int motld::FernFilter::calcTableSize | ( | ) | const [inline, private] |
Definition at line 1103 of file FernFilter.h.
void motld::FernFilter::changeInputFormat | ( | const int & | width, |
const int & | height | ||
) |
changes input image dimensions (has to be applied with applyPreferences())
Definition at line 807 of file FernFilter.h.
void motld::FernFilter::changeScanBoxFormat | ( | const int & | width, |
const int & | height | ||
) |
changes default size scan box dimensions (has to be applied with applyPreferences())
Definition at line 813 of file FernFilter.h.
void motld::FernFilter::changeScanSettings | ( | const int & | scaleMin, |
const int & | scaleMax, | ||
const int & | bb_min | ||
) |
changes sliding window preferences (has to be applied with applyPreferences())
Definition at line 819 of file FernFilter.h.
void motld::FernFilter::changeWarpSettings | ( | const WarpSettings & | initSettings, |
const WarpSettings & | updateSettings | ||
) |
changes settings for warping
Definition at line 833 of file FernFilter.h.
void motld::FernFilter::clearLastDetections | ( | ) | const [inline, private] |
Definition at line 1411 of file FernFilter.h.
void motld::FernFilter::computeOffsets | ( | ) | [inline, private] |
Definition at line 1017 of file FernFilter.h.
int ** motld::FernFilter::computeOffsets | ( | int | width | ) | [inline, private] |
Definition at line 1052 of file FernFilter.h.
FernDetection motld::FernFilter::copyFernDetection | ( | const FernDetection & | fd | ) | const [inline, private] |
Definition at line 1420 of file FernFilter.h.
int *** motld::FernFilter::createFeatures | ( | ) | [inline, private] |
Definition at line 960 of file FernFilter.h.
void motld::FernFilter::createScaledMatrices | ( | const Matrix & | image, |
Matrix *& | scaled, | ||
float **& | sats, | ||
float **& | sat2s | ||
) | const [inline, private] |
Definition at line 854 of file FernFilter.h.
void motld::FernFilter::createScaledMatrix | ( | const Matrix & | image, |
Matrix & | scaled, | ||
float *& | sat, | ||
float *& | sat2, | ||
int | scale | ||
) | const [inline, private] |
Definition at line 843 of file FernFilter.h.
void motld::FernFilter::debugOutput | ( | ) | const [inline, private] |
Definition at line 1112 of file FernFilter.h.
int * motld::FernFilter::extractFeatures | ( | const float *const | imageOrSAT, |
int ** | offsets | ||
) | const [inline, private] |
Definition at line 1198 of file FernFilter.h.
void motld::FernFilter::extractFeatures | ( | FernDetection & | det | ) | const [inline, private] |
Definition at line 1193 of file FernFilter.h.
void motld::FernFilter::initializeFerns | ( | ) | [inline, private] |
Definition at line 978 of file FernFilter.h.
const std::vector< Matrix > motld::FernFilter::learn | ( | const Matrix & | image, |
const std::vector< ObjectBox > & | boxes, | ||
bool | onlyVariance = false |
||
) |
updates the fern structure with information about the correct boxes
Definition at line 459 of file FernFilter.h.
FernFilter motld::FernFilter::loadFromStream | ( | std::ifstream & | inputStream | ) | [static] |
creates a FernFilter from binary stream (load procedure)
Definition at line 589 of file FernFilter.h.
std::vector< Matrix > motld::FernFilter::retrieveHighVarianceSamples | ( | const Matrix & | image, |
const std::vector< ObjectBox > & | boxes | ||
) | [inline, private] |
Definition at line 920 of file FernFilter.h.
void motld::FernFilter::saveToStream | ( | std::ofstream & | outputStream | ) | const |
writes FernFilter into binary stream (save procedure)
Definition at line 526 of file FernFilter.h.
const std::vector< FernDetection > motld::FernFilter::scanPatch | ( | const Matrix & | image | ) | const |
scans fern structure for possible object matches using a sliding window approach
Definition at line 297 of file FernFilter.h.
void motld::FernFilter::varianceFilter | ( | float * | image, |
float * | sat, | ||
float * | sat2, | ||
int | scale, | ||
std::vector< FernDetection > & | acc | ||
) | const [inline, private] |
Definition at line 871 of file FernFilter.h.
const WarpSettings motld::FernFilter::cDefaultInitWarpSettings = {10, 20, 5, 20, 0.2, 0.2} [static, private] |
Definition at line 236 of file FernFilter.h.
const WarpSettings motld::FernFilter::cDefaultUpdateWarpSettings = {10, 10, 5, 20, 0.2, 0.2} [static, private] |
Definition at line 237 of file FernFilter.h.
int motld::FernFilter::ivBBmin [private] |
Definition at line 211 of file FernFilter.h.
int*** motld::FernFilter::ivFeatures [private] |
Definition at line 216 of file FernFilter.h.
int motld::FernFilter::ivFeaturesPerFern [private] |
Definition at line 199 of file FernFilter.h.
std::map<int, Confidences>* motld::FernFilter::ivFernForest [private] |
Definition at line 218 of file FernFilter.h.
int motld::FernFilter::ivHeight [private] |
Definition at line 195 of file FernFilter.h.
Definition at line 212 of file FernFilter.h.
std::vector<FernDetection> motld::FernFilter::ivLastDetections [mutable, private] |
Definition at line 233 of file FernFilter.h.
std::vector<float> motld::FernFilter::ivMinVariances [private] |
Definition at line 232 of file FernFilter.h.
int motld::FernFilter::ivNumFerns [private] |
Definition at line 198 of file FernFilter.h.
int motld::FernFilter::ivNumObjects [private] |
Definition at line 227 of file FernFilter.h.
int motld::FernFilter::ivOriginalHeight [private] |
Definition at line 208 of file FernFilter.h.
int motld::FernFilter::ivOriginalWidth [private] |
Definition at line 207 of file FernFilter.h.
int motld::FernFilter::ivPatchSize [private] |
Definition at line 200 of file FernFilter.h.
int motld::FernFilter::ivPatchSizeMinusOne [private] |
Definition at line 203 of file FernFilter.h.
int** motld::FernFilter::ivPatchSizeOffsets [private] |
Definition at line 230 of file FernFilter.h.
int motld::FernFilter::ivPatchSizeSquared [private] |
Definition at line 204 of file FernFilter.h.
int motld::FernFilter::ivScaleMax [private] |
Definition at line 210 of file FernFilter.h.
int motld::FernFilter::ivScaleMin [private] |
Definition at line 209 of file FernFilter.h.
int motld::FernFilter::ivScanNoZoom [private] |
Definition at line 228 of file FernFilter.h.
std::vector<ScanSettings> motld::FernFilter::ivScans [private] |
Definition at line 231 of file FernFilter.h.
Definition at line 213 of file FernFilter.h.
float motld::FernFilter::ivVarianceThreshold [private] |
Definition at line 229 of file FernFilter.h.
int motld::FernFilter::ivWidth [private] |
Definition at line 194 of file FernFilter.h.