diff --git a/openbr/plugins/format.cpp b/openbr/plugins/format.cpp index 348683b..7fd947d 100644 --- a/openbr/plugins/format.cpp +++ b/openbr/plugins/format.cpp @@ -245,6 +245,31 @@ BR_REGISTER(Format, DefaultFormat) /*! * \ingroup formats + * \brief Reads a NIST LFFS file. + * \author Josh Klontz \cite jklontz + */ +class lffsFormat : public Format +{ + Q_OBJECT + + Template read() const + { + QByteArray byteArray; + QtUtils::readFile(file.name, byteArray); + return Mat(1, byteArray.size(), CV_8UC1, byteArray.data()).clone(); + } + + void write(const Template &t) const + { + QByteArray byteArray((const char*)t.m().data, t.m().total()*t.m().elemSize()); + QtUtils::writeFile(file.name, byteArray); + } +}; + +BR_REGISTER(Format, lffsFormat) + +/*! + * \ingroup formats * \brief Reads a NIST BEE similarity matrix. * \author Josh Klontz \cite jklontz */