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