From 11bf404be3c50ec3435994e1f4a4ca4e329b9433 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Wed, 23 Jan 2013 17:32:55 -0500 Subject: [PATCH] added threshold value for #6 --- sdk/plugins/output.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/plugins/output.cpp b/sdk/plugins/output.cpp index 6ea3410..198d75a 100644 --- a/sdk/plugins/output.cpp +++ b/sdk/plugins/output.cpp @@ -156,6 +156,7 @@ class rrOutput : public MatrixOutput const bool index = file.getBool("index"); const bool score = file.getBool("score"); const bool invert = file.getBool("invert"); + const float threshold = file.getFloat("threshold", -std::numeric_limits::max()); QStringList lines; for (int i=0; i Pair; - foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), !invert).mid(0, limit)) + foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), !invert).mid(0, limit)) { + if (pair.second < threshold) break; files.append((index ? QString::number(pair.second) : targetFiles[pair.second].name) + (score ? "=" + QString::number(pair.first) : "")); + } lines.append(files.join(flat ? "\n" : ",")); } -- libgit2 0.21.4