diff --git a/openbr/core/eigenutils.cpp b/openbr/core/eigenutils.cpp new file mode 100644 index 0000000..ce75b65 --- /dev/null +++ b/openbr/core/eigenutils.cpp @@ -0,0 +1,19 @@ +#include "eigenutils.h" +#include + +using namespace Eigen; +using namespace cv; + +//Helper function to quickly write eigen matrix to disk. Not efficient. +void writeEigen(MatrixXf X, QString filename) { + Mat m(X.rows(),X.cols(),CV_32FC1); + for (int i = 0; i < X.rows(); i++) { + for (int j = 0; j < X.cols(); j++) { + m.at(i,j) = X(i,j); + } + } + QScopedPointer format(br::Factory::make(filename)); + format->write(br::Template(m)); +} + +