From 52dc573606f1d84aa06da30583f23680544acfca Mon Sep 17 00:00:00 2001 From: Brendan Klare Date: Tue, 26 Nov 2013 14:59:20 -0500 Subject: [PATCH] New transform to filter gallery based on meta-data --- openbr/plugins/meta.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+), 0 deletions(-) diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index c713c98..bbf6c68 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -717,6 +717,42 @@ public: }; BR_REGISTER(Transform, DistributeTemplateTransform) +/*! + * \ingroup transforms + * \brief Filters a gallery based on the value of a metadata field. + * \author Brendan Klare \cite bklare + */ +class FilterOnMetadataTransform : public UntrainableMetaTransform +{ + Q_OBJECT + Q_PROPERTY(QString attributeName READ get_attributeName WRITE set_attributeName RESET reset_attributeName STORED false) + Q_PROPERTY(float threshold READ get_threshold WRITE set_threshold RESET reset_threshold STORED false) + Q_PROPERTY(bool isGreaterThan READ get_isGreaterThan WRITE set_isGreaterThan RESET reset_isGreaterThan STORED false) + BR_PROPERTY(QString, attributeName, "Confidence") + BR_PROPERTY(float, threshold, 0) + BR_PROPERTY(bool, isGreaterThan, true) + + void project(const TemplateList &src, TemplateList &dst) const + { + QList