From 6594914818c2a08bdbe6cd6bd55c01f57d076306 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 31 Aug 2021 14:41:13 -0600 Subject: [PATCH] removed scores format --- openbr/plugins/format/scores.cpp | 79 ------------------------------------------------------------------------------- 1 file changed, 0 insertions(+), 79 deletions(-) delete mode 100644 openbr/plugins/format/scores.cpp diff --git a/openbr/plugins/format/scores.cpp b/openbr/plugins/format/scores.cpp deleted file mode 100644 index 3516a73..0000000 --- a/openbr/plugins/format/scores.cpp +++ /dev/null @@ -1,79 +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 - -using namespace cv; - -namespace br -{ - -/*! - * \ingroup formats - * \brief Reads in scores or ground truth from a text table. - * \author Josh Klontz \cite jklontz - * \br_format Example of the format: - * - * 2.2531514 FALSE 99990377 99990164 - * 2.2549822 TRUE 99990101 99990101 - */ -class scoresFormat : public Format -{ - Q_OBJECT - Q_PROPERTY(int column READ get_column WRITE set_column RESET reset_column STORED false) - Q_PROPERTY(bool groundTruth READ get_groundTruth WRITE set_groundTruth RESET reset_groundTruth STORED false) - Q_PROPERTY(QString delimiter READ get_delimiter WRITE set_delimiter RESET reset_delimiter STORED false) - BR_PROPERTY(int, column, 0) - BR_PROPERTY(bool, groundTruth, false) - BR_PROPERTY(QString, delimiter, "\t") - - Template read() const - { - QFile f(file.name); - if (!f.open(QFile::ReadOnly | QFile::Text)) - qFatal("Failed to open %s for reading.", qPrintable(f.fileName())); - QList values; - while (!f.atEnd()) { - const QStringList words = QString(f.readLine()).split(delimiter); - if (words.size() <= column) qFatal("Expected file to have at least %d columns.", column+1); - const QString &word = words[column]; - bool ok; - float value = word.toFloat(&ok); - if (!ok) value = (QtUtils::toBool(word) ? BEE::Match : BEE::NonMatch); - values.append(value); - } - if (values.size() == 1) - qWarning("Only one value read, double check file line endings."); - Mat result = OpenCVUtils::toMat(values); - if (groundTruth) result.convertTo(result, CV_8U); - return result; - } - - void write(const Template &t) const - { - (void) t; - qFatal("Not implemented."); - } -}; - -BR_REGISTER(Format, scoresFormat) - -} // namespace br - -#include "format/scores.moc" -- libgit2 0.21.4