Commit 5bd7cd9a98c265ff739e2db9fa9d79949e09b11e
1 parent
1e94e909
first draft of lmat gallery
Showing
1 changed file
with
34 additions
and
0 deletions
openbr/plugins/likely.cpp
| 1 | #include <likely.h> | 1 | #include <likely.h> |
| 2 | #include <likely/opencv.hpp> | 2 | #include <likely/opencv.hpp> |
| 3 | 3 | ||
| 4 | +#include "openbr/core/opencvutils.h" | ||
| 4 | #include "openbr_internal.h" | 5 | #include "openbr_internal.h" |
| 5 | 6 | ||
| 6 | namespace br | 7 | namespace br |
| @@ -85,6 +86,39 @@ class lmatFormat : public Format | @@ -85,6 +86,39 @@ class lmatFormat : public Format | ||
| 85 | 86 | ||
| 86 | BR_REGISTER(Format, lmatFormat) | 87 | BR_REGISTER(Format, lmatFormat) |
| 87 | 88 | ||
| 89 | +/*! | ||
| 90 | + * \ingroup formats | ||
| 91 | + * \brief Likely matrix format | ||
| 92 | + * | ||
| 93 | + * www.liblikely.org | ||
| 94 | + * \author Josh Klontz \cite jklontz | ||
| 95 | + */ | ||
| 96 | +class lmatGallery : public Gallery | ||
| 97 | +{ | ||
| 98 | + Q_OBJECT | ||
| 99 | + QList<cv::Mat> mats; | ||
| 100 | + | ||
| 101 | + ~lmatGallery() | ||
| 102 | + { | ||
| 103 | + const likely_const_mat m = likelyFromOpenCVMat(OpenCVUtils::toMatByRow(mats)); | ||
| 104 | + likely_write(m, qPrintable(file.name)); | ||
| 105 | + likely_release_mat(m); | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + TemplateList readBlock(bool *done) | ||
| 109 | + { | ||
| 110 | + *done = true; | ||
| 111 | + qFatal("Not supported."); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + void write(const Template &t) | ||
| 115 | + { | ||
| 116 | + mats.append(t); | ||
| 117 | + } | ||
| 118 | +}; | ||
| 119 | + | ||
| 120 | +BR_REGISTER(Gallery, lmatGallery) | ||
| 121 | + | ||
| 88 | } // namespace br | 122 | } // namespace br |
| 89 | 123 | ||
| 90 | #include "likely.moc" | 124 | #include "likely.moc" |