diff --git a/openbr/plugins/output/rr.cpp b/openbr/plugins/output/rr.cpp deleted file mode 100644 index 7e0bed3..0000000 --- a/openbr/plugins/output/rr.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright 2012 The MITRE Corporation * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include -#include - -namespace br -{ - -/*! - * \ingroup outputs - * \brief Rank retrieval output. - * \author Josh Klontz \cite jklontz - * \author Scott Klum \cite sklum - */ -class rrOutput : public MatrixOutput -{ - Q_OBJECT - - ~rrOutput() - { - if (file.isNull() || targetFiles.isEmpty() || queryFiles.isEmpty()) return; - const int limit = file.get("limit", 20); - const bool byLine = file.getBool("byLine"); - const bool simple = file.getBool("simple"); - const float threshold = file.get("threshold", -std::numeric_limits::max()); - - QStringList lines; - - for (int i=0; i Pair; - foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), true, limit)) { - // Check if target files are marked as allParitions, and make sure target and query files are in the same partition - if (Globals->crossValidate > 0 ? (targetFiles[pair.second].get("Partition",-1) == -1 || targetFiles[pair.second].get("Partition",-1) == queryFiles[i].get("Partition",-1)) : true) { - if (pair.first < threshold) break; - File target = targetFiles[pair.second]; - target.set("Score", QString::number(pair.first)); - if (simple) files.append(target.fileName() + " " + QString::number(pair.first)); - else files.append(target.flat()); - } - } - lines.append(files.join(byLine ? "\n" : ",")); - } - - QtUtils::writeFile(file, lines); - } -}; - -BR_REGISTER(Output, rrOutput) - -} // namespace br - -#include "output/rr.moc"