Commit b9c9e19b60b740fdee7db3a50d923b86ad4e7d76

Authored by Josh Klontz
2 parents 4ca036ef 74df4a7f

Merge branch 'master' of https://github.com/biometrics/openbr

sdk/core/core.cpp
... ... @@ -116,7 +116,7 @@ struct AlgorithmCore
116 116 return fileList; // Already enrolled
117 117  
118 118 const TemplateList i(TemplateList::fromInput(input));
119   - if (i.isEmpty()) return FileList(); // Nothing to enroll
  119 + if (i.isEmpty()) return fileList; // Nothing to enroll
120 120  
121 121 if (transform.isNull()) qFatal("AlgorithmCore::enroll null transform.");
122 122 const int blocks = Globals->blocks(i.size());
... ...
sdk/plugins/output.cpp
... ... @@ -150,6 +150,7 @@ class rrOutput : public MatrixOutput
150 150 const bool index = file.getBool("index");
151 151 const bool score = file.getBool("score");
152 152 const bool invert = file.getBool("invert");
  153 + const bool metadata = file.getBool("metadata");
153 154 const float threshold = file.getFloat("threshold", -std::numeric_limits<float>::max());
154 155  
155 156 QStringList lines;
... ... @@ -159,9 +160,17 @@ class rrOutput : public MatrixOutput
159 160  
160 161 typedef QPair<float,int> Pair;
161 162 foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), !invert).mid(0, limit)) {
162   - if (pair.second < threshold) break;
163   - files.append((index ? QString::number(pair.second) : targetFiles[pair.second].name) +
164   - (score ? "=" + QString::number(pair.first) : ""));
  163 + if (pair.first < threshold) break;
  164 + QString output;
  165 + output.append((index ? QString::number(pair.second) : targetFiles[pair.second].name) +
  166 + (score ? "=" + QString::number(pair.first) : ""));
  167 + if (metadata) {
  168 + foreach (const QString &key, targetFiles[pair.second].localKeys()) {
  169 + const QString value = targetFiles[pair.second].getString(key, "");
  170 + output.append("," + key + "=" + value);
  171 + }
  172 + }
  173 + files.append(output);
165 174 }
166 175 lines.append(files.join(flat ? "\n" : ","));
167 176 }
... ...
1   -Subproject commit d446cb37c75632fb50af0c5c43bee55584b08107
  1 +Subproject commit 504960df12db25e09c39ab098fb8614c1db51617
... ...
1   -Subproject commit 5bfe0988716f6e7b926910d74f9696f002cdbfb6
  1 +Subproject commit a7a133b98757d6affadd834b0d96d16e6d8ca04f
... ...