diff --git a/openbr/plugins/likely.cpp b/openbr/plugins/likely.cpp index aad2933..f15f4b4 100644 --- a/openbr/plugins/likely.cpp +++ b/openbr/plugins/likely.cpp @@ -1,6 +1,7 @@ #include #include +#include "openbr/core/opencvutils.h" #include "openbr_internal.h" namespace br @@ -85,6 +86,39 @@ class lmatFormat : public Format BR_REGISTER(Format, lmatFormat) +/*! + * \ingroup formats + * \brief Likely matrix format + * + * www.liblikely.org + * \author Josh Klontz \cite jklontz + */ +class lmatGallery : public Gallery +{ + Q_OBJECT + QList mats; + + ~lmatGallery() + { + const likely_const_mat m = likelyFromOpenCVMat(OpenCVUtils::toMatByRow(mats)); + likely_write(m, qPrintable(file.name)); + likely_release_mat(m); + } + + TemplateList readBlock(bool *done) + { + *done = true; + qFatal("Not supported."); + } + + void write(const Template &t) + { + mats.append(t); + } +}; + +BR_REGISTER(Gallery, lmatGallery) + } // namespace br #include "likely.moc"