diff --git a/sdk/plugins/format.cpp b/sdk/plugins/format.cpp index 5ae57d4..d3d4075 100644 --- a/sdk/plugins/format.cpp +++ b/sdk/plugins/format.cpp @@ -24,6 +24,8 @@ #include #include "core/bee.h" +#include "core/opencvutils.h" +#include "core/qtutils.h" using namespace br; using namespace cv; @@ -68,8 +70,19 @@ class csvFormat : public Format void write(const Template &t) const { - (void) t; - qFatal("csvFormat::write not supported."); + const Mat &m = t.m(); + if (t.size() != 1) qFatal("csvFormat::write only supports single matrix templates."); + if (m.channels() != 1) qFatal("csvFormat::write only supports single channel matrices."); + + QStringList lines; lines.reserve(m.rows); + for (int r=0; r