Basic Image AlgorithmS Library
2.8.0
|
linear discriminant analysis on a set of classes of vectors LDA is a approach for dimension-reduction of vector-classes while keeping class-separability More...
#include <MathAlgo/LDA.hh>
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
void | AnalyzeData (const std::vector< std::vector< BIAS::Vector< LDAType > > > &vec) |
Ouput statistical-data of input-data. More... | |
void | ComputeAnonymousReduction (const std::vector< std::vector< BIAS::Vector< LDAType > > > &vec, BIAS::Matrix< LDAType > &matrix, int reductionSize=-1, const std::vector< std::vector< BIAS::Matrix< LDAType > > > *covs=NULL) |
Computes a reduction-matrix for features of n sets (e.g. More... | |
void | ComputeMeans (const std::vector< std::vector< BIAS::Vector< LDAType > > > &vec) |
get mean of input get results with methods down under More... | |
void | ComputeReductionMatrix (const std::vector< std::vector< BIAS::Vector< LDAType > > > &vec, BIAS::Matrix< LDAType > &matrix, int reductionSize=-1, std::vector< BIAS::Matrix< LDAType > > *covs=NULL) |
Computes a reduction-matrix the first dimension of the matrix is taken out of the first vector. More... | |
void | ComputeReductionMatrix (BIAS::Matrix< LDAType > &classCov, BIAS::Matrix< LDAType > &cov, BIAS::Matrix< LDAType > &matrix, int reductionSize) |
computes reduction, given average within class cov and inter-class cov matrix More... | |
void | ComputeWithinAndInterClassCovs (const std::vector< BIAS::Vector< LDAType > > &classmeans, const std::vector< BIAS::Matrix< LDAType > > &covs, BIAS::Matrix< LDAType > &withinClassCov, BIAS::Matrix< LDAType > &interClassCov) |
given mean and scatter of each class, compute scatter between class means and average class shape More... | |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
void | GenerateRandomTestData (int vectorSize, int numberOfClasses, int classSizeMin, int classSizeMax, int vectorEntryMin, int vectorEntryMax, double stdDeviation, double mainDirectionStdDeviation, std::vector< std::vector< BIAS::Vector< LDAType > > > &vec, std::vector< BIAS::Vector< LDAType > > &means, bool Normalize) |
Generates random classes of vectors. More... | |
void | GetClassMeans (std::vector< BIAS::Vector< LDAType > > &means) |
get mean vector for each class ComputeReductionMatrix or ComputeMeans has to be called first More... | |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
void | GetMean (BIAS::Vector< LDAType > &mean) |
get a mean vector of all vectors ComputeReductionMatrix or ComputeMeans has to be called first More... | |
LDA (bool equalClassWeights=true) | |
long int | Name2DebugLevel (const std::string &name) const |
looks up a debuglevel in the internal map, returns 0 if not found More... | |
long int | NewDebugLevel (const std::string &name) |
creates a new debuglevel More... | |
void | PrintDebugLevel (std::ostream &os=std::cout) const |
void | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetReductionSize (int size) |
reduction size can be set here More... | |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
Protected Attributes | |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::map< std::string, long int > | _String2Debuglevel |
int | allCount_ |
std::vector< BIAS::Vector < LDAType > > | classMeans_ |
mean vector for each class More... | |
bool | equalClassWeights_ |
BIAS::Vector< LDAType > | mean_ |
mean of all vectors More... | |
int | reductionSize_ |
reduction size More... | |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
linear discriminant analysis on a set of classes of vectors LDA is a approach for dimension-reduction of vector-classes while keeping class-separability
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
void LDA::AnalyzeData | ( | const std::vector< std::vector< BIAS::Vector< LDAType > > > & | vec | ) |
Ouput statistical-data of input-data.
vec | the input data |
Definition at line 48 of file LDA.cpp.
References TNT::Vector< T >::newsize(), BIAS::Matrix< T >::SetZero(), and TNT::Vector< T >::size().
void LDA::ComputeAnonymousReduction | ( | const std::vector< std::vector< BIAS::Vector< LDAType > > > & | vec, |
BIAS::Matrix< LDAType > & | matrix, | ||
int | reductionSize = -1 , |
||
const std::vector< std::vector< BIAS::Matrix< LDAType > > > * | covs = NULL |
||
) |
Computes a reduction-matrix for features of n sets (e.g.
n images), whose class relations (correspondence) are anonymous
vec | the input: a vector (one entry for each image) of vectors of features |
matrix | the matrix returned |
reductionSize | the second dimension of the matrix |
covs | vector of covs for each feature in vec |
Definition at line 562 of file LDA.cpp.
References BIAS::PCA::ComputeMean(), BIAS::PCA::ComputeScatter(), BIAS::MatrixZero, BIAS::Vector< T >::Size(), and TNT::Vector< T >::size().
void LDA::ComputeMeans | ( | const std::vector< std::vector< BIAS::Vector< LDAType > > > & | vec | ) |
get mean of input get results with methods down under
Definition at line 502 of file LDA.cpp.
References TNT::Vector< T >::size().
void LDA::ComputeReductionMatrix | ( | const std::vector< std::vector< BIAS::Vector< LDAType > > > & | vec, |
BIAS::Matrix< LDAType > & | matrix, | ||
int | reductionSize = -1 , |
||
std::vector< BIAS::Matrix< LDAType > > * | covs = NULL |
||
) |
Computes a reduction-matrix the first dimension of the matrix is taken out of the first vector.
vec | the input: a vector of classes of vectors |
matrix | the matrix returned |
reductionSize | the second dimension of the matrix |
covs | pass vector of correct size to retrieve class covs, leave zero size vector to save memory and destroy covs after usage |
Definition at line 269 of file LDA.cpp.
References BIAS::FileHandling::CurrentDateTimeString(), BIAS::MatrixZero, BIAS::Matrix< T >::SetZero(), and TNT::Vector< T >::size().
void LDA::ComputeReductionMatrix | ( | BIAS::Matrix< LDAType > & | classCov, |
BIAS::Matrix< LDAType > & | cov, | ||
BIAS::Matrix< LDAType > & | matrix, | ||
int | reductionSize | ||
) |
computes reduction, given average within class cov and inter-class cov matrix
Definition at line 379 of file LDA.cpp.
References BIAS::SVD::Compute(), BIAS::FileHandling::CurrentDateTimeString(), BIAS::SVD::GetS(), BIAS::SVD::GetV(), BIAS::SVD::GetVT(), BIAS::SVD::Invert(), TNT::Matrix< T >::newsize(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::Rank(), and BIAS::SVD::SqrtT().
void LDA::ComputeWithinAndInterClassCovs | ( | const std::vector< BIAS::Vector< LDAType > > & | classmeans, |
const std::vector< BIAS::Matrix< LDAType > > & | covs, | ||
BIAS::Matrix< LDAType > & | withinClassCov, | ||
BIAS::Matrix< LDAType > & | interClassCov | ||
) |
given mean and scatter of each class, compute scatter between class means and average class shape
Definition at line 538 of file LDA.cpp.
References BIAS::PCA::ComputeMean(), BIAS::PCA::ComputeScatter(), BIAS::Matrix< T >::NormFrobenius(), TNT::Matrix< T >::num_cols(), and TNT::Matrix< T >::num_rows().
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
void LDA::GenerateRandomTestData | ( | int | vectorSize, |
int | numberOfClasses, | ||
int | classSizeMin, | ||
int | classSizeMax, | ||
int | vectorEntryMin, | ||
int | vectorEntryMax, | ||
double | stdDeviation, | ||
double | mainDirectionStdDeviation, | ||
std::vector< std::vector< BIAS::Vector< LDAType > > > & | vec, | ||
std::vector< BIAS::Vector< LDAType > > & | means, | ||
bool | Normalize | ||
) |
Generates random classes of vectors.
vectorSize | dimensionality |
numberOfClasses | how many classes should be generated (number of mean-vectors) |
classSizeMin | how many vectors should at least be in every class |
classSizeMax | how many vectors should at most be in every class |
vectorEntryMin | the min-value of every vectors component |
vectorEntryMax | the max-value of every vectors component |
stdDeviation | Standard-Deviation of how a vector is distributed around it's class mean |
mainDirectionStdDeviation | Standard-Deviation of the same main-direction of all classes |
vec | returns a vector of classes, every class is a vector of vectors |
means | returns the original mean-vectors used for each class-generation |
Normalize | should descriptors be normalized? |
Definition at line 132 of file LDA.cpp.
References BIAS::SVD::Compute(), BIAS::Random::GetNormalDistributed(), BIAS::Matrix< T >::GetRow(), BIAS::SVD::GetS(), BIAS::SVD::GetU(), BIAS::Random::GetUniformDistributed(), BIAS::Random::GetUniformDistributedInt(), BIAS::SVD::GetVT(), TNT::Matrix< T >::newsize(), BIAS::Matrix< T >::NormL2(), BIAS::Random::Reset(), and BIAS::Matrix< T >::SetZero().
void LDA::GetClassMeans | ( | std::vector< BIAS::Vector< LDAType > > & | means | ) |
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
void LDA::GetMean | ( | BIAS::Vector< LDAType > & | mean | ) |
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
void LDA::SetReductionSize | ( | int | size | ) |
|
inlineinherited |
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
|
staticprotectedinherited |
|
protected |