From ef0d1dae2de0046682e847e56b6fa05e0fb6e565 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 9 Jun 2015 11:09:16 -0400 Subject: [PATCH] dropped RowWisePCATransform --- openbr/plugins/classification/lda.cpp | 44 -------------------------------------------- 1 file changed, 0 insertions(+), 44 deletions(-) diff --git a/openbr/plugins/classification/lda.cpp b/openbr/plugins/classification/lda.cpp index 86907ca..4fc9ff5 100644 --- a/openbr/plugins/classification/lda.cpp +++ b/openbr/plugins/classification/lda.cpp @@ -224,50 +224,6 @@ BR_REGISTER(Transform, PCATransform) /*! * \ingroup transforms - * \brief PCA on each row. - * \author Josh Klontz \cite jklontz - */ -class RowWisePCATransform : public PCATransform -{ - Q_OBJECT - - void train(const TemplateList &trainingSet) - { - if (trainingSet.first().m().type() != CV_32FC1) - qFatal("Requires single channel 32-bit floating point matrices."); - - originalRows = trainingSet.first().m().rows; - const int dimsIn = trainingSet.first().m().cols; - int instances = 0; - foreach (const Template &t, trainingSet) - instances += t.m().rows; - - // Map into 64-bit Eigen matrix - Eigen::MatrixXd data(dimsIn, instances); - int index = 0; - foreach (const Template &t, trainingSet) - for (int i=0; i(t.m().ptr(i), dimsIn, 1).cast(); - - PCATransform::trainCore(data); - } - - void project(const Template &src, Template &dst) const - { - dst = cv::Mat(src.m().rows, keep, CV_32FC1); - - for (int i=0; i inMap(src.m().ptr(i), src.m().cols, 1); - Eigen::Map outMap(dst.m().ptr(i), keep, 1); - outMap = eVecs.transpose() * (inMap - mean); - } - } -}; - -BR_REGISTER(Transform, RowWisePCATransform) - -/*! - * \ingroup transforms * \brief Computes Distance From Feature Space (DFFS) * \br_paper Moghaddam, Baback, and Alex Pentland. * "Probabilistic visual learning for object representation." -- libgit2 0.21.4