From 6afe15b5f94d284298157c9fc95137047aa57759 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Wed, 3 Apr 2013 11:42:57 -0400 Subject: [PATCH] added lffs format --- openbr/plugins/format.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+), 0 deletions(-) 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 */ -- libgit2 0.21.4