Commit b89cf44866a59fcccdaafa34d24286e2291711a1
1 parent
8b0ed18e
Fixed rankOutput to work with non-self identity masks
Showing
1 changed file
with
4 additions
and
2 deletions
sdk/plugins/output.cpp
| ... | ... | @@ -271,7 +271,8 @@ class rankOutput : public MatrixOutput |
| 271 | 271 | if (targetFiles.isEmpty() || queryFiles.isEmpty()) return; |
| 272 | 272 | |
| 273 | 273 | QList<int> ranks; |
| 274 | - QList<double> scores; | |
| 274 | + QList<int> positions; | |
| 275 | + QList<float> scores; | |
| 275 | 276 | QStringList lines; |
| 276 | 277 | |
| 277 | 278 | for (int i=0; i<queryFiles.size(); i++) { |
| ... | ... | @@ -280,6 +281,7 @@ class rankOutput : public MatrixOutput |
| 280 | 281 | foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), true)) { |
| 281 | 282 | if(targetFiles[pair.second].label() == queryFiles[i].label()) { |
| 282 | 283 | ranks.append(rank); |
| 284 | + positions.append(pair.second); | |
| 283 | 285 | scores.append(pair.first); |
| 284 | 286 | break; |
| 285 | 287 | } |
| ... | ... | @@ -289,7 +291,7 @@ class rankOutput : public MatrixOutput |
| 289 | 291 | |
| 290 | 292 | typedef QPair<int,int> RankPair; |
| 291 | 293 | foreach (const RankPair &pair, Common::Sort(ranks, false)) |
| 292 | - lines.append(queryFiles[pair.second].name + " " + QString::number(pair.first) + " " + QString::number(scores[pair.second]) + " " + targetFiles[pair.second].name); | |
| 294 | + lines.append(queryFiles[pair.second].name + " " + QString::number(pair.first) + " " + QString::number(scores[pair.second]) + " " + targetFiles[positions[pair.second]].name); | |
| 293 | 295 | |
| 294 | 296 | QtUtils::writeFile(file, lines); |
| 295 | 297 | } | ... | ... |