From 4af37848c5751fa39f411bc133d207c9c8bde320 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Wed, 15 Jan 2014 16:42:10 -0500 Subject: [PATCH] Scores can be weighted prior to fusion with FuseDistance --- openbr/plugins/distance.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openbr/plugins/distance.cpp b/openbr/plugins/distance.cpp index d68cae1..b2106c8 100644 --- a/openbr/plugins/distance.cpp +++ b/openbr/plugins/distance.cpp @@ -189,6 +189,7 @@ class FuseDistance : public Distance Q_ENUMS(Operation) Q_PROPERTY(QString description READ get_description WRITE set_description RESET reset_description STORED false) Q_PROPERTY(Operation operation READ get_operation WRITE set_operation RESET reset_operation STORED false) + Q_PROPERTY(QList weights READ get_weights WRITE set_weights RESET reset_weights STORED false) QList distances; @@ -199,6 +200,7 @@ public: private: BR_PROPERTY(QString, description, "IdenticalDistance") BR_PROPERTY(Operation, operation, Mean) + BR_PROPERTY(QList, weights, QList()) void train(const TemplateList &src) { @@ -221,8 +223,11 @@ private: if (a.size() != b.size()) qFatal("Comparison size mismatch"); QList scores; - for (int i=0; icompare(Template(a.file, a[i]),Template(b.file, b[i]))); + for (int i=0; icompare(Template(a.file, a[i]),Template(b.file, b[i]))); + } switch (operation) { case Mean: -- libgit2 0.21.4