Commit 86b72c69b4d43239d8c178894482436bd8d76a4a

Authored by Josh Klontz
1 parent 896d264e

remove melt

Showing 1 changed file with 0 additions and 71 deletions
openbr/plugins/output/melt.cpp deleted
1 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
2 - * Copyright 2012 The MITRE Corporation *  
3 - * *  
4 - * Licensed under the Apache License, Version 2.0 (the "License"); *  
5 - * you may not use this file except in compliance with the License. *  
6 - * You may obtain a copy of the License at *  
7 - * *  
8 - * http://www.apache.org/licenses/LICENSE-2.0 *  
9 - * *  
10 - * Unless required by applicable law or agreed to in writing, software *  
11 - * distributed under the License is distributed on an "AS IS" BASIS, *  
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *  
13 - * See the License for the specific language governing permissions and *  
14 - * limitations under the License. *  
15 - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */  
16 -  
17 -#include <openbr/plugins/openbr_internal.h>  
18 -#include <openbr/core/qtutils.h>  
19 -  
20 -namespace br  
21 -{  
22 -  
23 -/*!  
24 - * \ingroup outputs  
25 - * \brief One score per row.  
26 - * \author Josh Klontz \cite jklontz  
27 - */  
28 -class meltOutput : public MatrixOutput  
29 -{  
30 - Q_OBJECT  
31 -  
32 - ~meltOutput()  
33 - {  
34 - if (file.isNull() || targetFiles.isEmpty() || queryFiles.isEmpty()) return;  
35 - const bool genuineOnly = file.contains("Genuine") && !file.contains("Impostor");  
36 - const bool impostorOnly = file.contains("Impostor") && !file.contains("Genuine");  
37 -  
38 - QMap<QString,QVariant> args = file.localMetadata();  
39 - args.remove("Genuine");  
40 - args.remove("Impostor");  
41 -  
42 - QString keys; foreach (const QString &key, args.keys()) keys += "," + key;  
43 - QString values; foreach (const QVariant &value, args.values()) values += "," + value.toString();  
44 -  
45 - QStringList lines;  
46 - if (file.baseName() != "terminal") lines.append(QString("Query,Target,Mask,Similarity%1").arg(keys));  
47 -  
48 - QList<QString> queryLabels = File::get<QString>(queryFiles, "Label");  
49 - QList<QString> targetLabels = File::get<QString>(targetFiles, "Label");  
50 -  
51 - for (int i=0; i<queryFiles.size(); i++) {  
52 - for (int j=(selfSimilar ? i+1 : 0); j<targetFiles.size(); j++) {  
53 - const bool genuine = queryLabels[i] == targetLabels[j];  
54 - if ((genuineOnly && !genuine) || (impostorOnly && genuine)) continue;  
55 - lines.append(QString("%1,%2,%3,%4%5").arg(queryFiles[i],  
56 - targetFiles[j],  
57 - QString::number(genuine),  
58 - QString::number(data.at<float>(i,j)),  
59 - values));  
60 - }  
61 - }  
62 -  
63 - QtUtils::writeFile(file, lines);  
64 - }  
65 -};  
66 -  
67 -BR_REGISTER(Output, meltOutput)  
68 -  
69 -} // namespace br  
70 -  
71 -#include "output/melt.moc"