Commit 5a7f96707d474aaddb0115357a601293299b4c2a

Authored by bhklein
2 parents fe0eba10 ece1468e

Merge branch 'master' of https://github.com/biometrics/openbr

openbr/core/core.cpp
... ... @@ -520,7 +520,7 @@ private:
520 520  
521 521 QFileInfo dFile(file);
522 522 if (dFile.exists() && !dFile.isDir()) {
523   - qDebug("Loading %s", qPrintable(dFile.fileName()));
  523 + qDebug("Loading %s", qPrintable(dFile.canonicalFilePath()));
524 524 load(file);
525 525 return true;
526 526 }
... ...
openbr/core/eigenutils.cpp
... ... @@ -137,3 +137,11 @@ Eigen::MatrixXf matrixToVector(const Eigen::MatrixXf matrix) {
137 137 return vector;
138 138 }
139 139  
  140 +Eigen::MatrixXf toEigen(const Mat m) {
  141 + if (m.type() != CV_32F)
  142 + qFatal("Mat to Eigen Converstation only supports CV_32F");
  143 +
  144 + Eigen::MatrixXf data(m.rows, m.cols);
  145 + return Eigen::Map<const Eigen::MatrixXf>(m.ptr<float>(), m.rows, m.cols);
  146 +}
  147 +
... ...
openbr/core/eigenutils.h
... ... @@ -21,6 +21,8 @@
21 21 #include <Eigen/Core>
22 22 #include <assert.h>
23 23  
  24 +#include <opencv2/core/core.hpp>
  25 +
24 26 void writeEigen(Eigen::MatrixXf X, QString filename);
25 27 void writeEigen(Eigen::MatrixXd X, QString filename);
26 28 void writeEigen(Eigen::VectorXd X, QString filename);
... ... @@ -40,6 +42,9 @@ Eigen::MatrixXf removeRowCol(const Eigen::MatrixXf X, int row, int col);
40 42 Eigen::MatrixXf pointsToMatrix(const QList<QPointF> points, bool isAffine=false);
41 43 QList<QPointF> matrixToPoints(const Eigen::MatrixXf P);
42 44  
  45 +//Convert cv::Mat to Eigen
  46 +Eigen::MatrixXf toEigen(const cv::Mat m);
  47 +
43 48 template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
44 49 inline QDataStream &operator<<(QDataStream &stream, const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &mat)
45 50 {
... ...
openbr/plugins/meta.cpp
... ... @@ -605,7 +605,7 @@ private:
605 605 const QString file = getFileName();
606 606 if (file.isEmpty()) return false;
607 607  
608   - if (Globals->verbose) qDebug("Loading %s", qPrintable(baseName));
  608 + if (Globals->verbose) qDebug("Loading %s", qPrintable(file));
609 609 QByteArray data;
610 610 QtUtils::readFile(file, data, true);
611 611 QDataStream stream(&data, QFile::ReadOnly);
... ...