From 52cf180afbcfacf18dff412a59db6d29d44c81ab Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Fri, 25 Jul 2014 14:17:10 -0400 Subject: [PATCH] Slight re-organization of some code in core/cluster.cpp --- openbr/core/cluster.cpp | 7 +++---- openbr/core/core.cpp | 5 +++++ openbr/openbr_plugin.h | 11 ++++++++--- openbr/plugins/cluster.cpp | 38 ++++++++++++++++++++++++++++++++++++++ openbr/plugins/openbr_internal.h | 9 ++++++--- 5 files changed, 60 insertions(+), 10 deletions(-) diff --git a/openbr/core/cluster.cpp b/openbr/core/cluster.cpp index 9e87b44..44f196a 100644 --- a/openbr/core/cluster.cpp +++ b/openbr/core/cluster.cpp @@ -25,13 +25,12 @@ #include "openbr/core/bee.h" #include "openbr/core/cluster.h" +#include "openbr/plugins/openbr_internal.h" -typedef QPair Neighbor; // QPair -typedef QList Neighbors; -typedef QVector Neighborhood; +using namespace br; // Compare function used to order neighbors from highest to lowest similarity -static bool compareNeighbors(const Neighbor &a, const Neighbor &b) +bool br::compareNeighbors(const Neighbor &a, const Neighbor &b) { if (a.second == b.second) return a.first < b.first; diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index ce4e3bd..7926b68 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -715,6 +715,11 @@ void br::Deduplicate(const File &inputGallery, const File &outputGallery, const else qFatal("Unable to convert deduplication threshold to float."); } +QSharedPointer br::Transform::fromComparison(const QString &algorithm) +{ + return AlgorithmManager::getAlgorithm(algorithm)->comparison; +} + QSharedPointer br::Transform::fromAlgorithm(const QString &algorithm, bool preprocess) { if (!preprocess) diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index a4bde4c..76566ba 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -461,9 +461,9 @@ struct TemplateList : public QList