Commit 4d42bac215b24d776f8ed307cf89f2c47857e1f6
1 parent
2a3fcf3d
allow single template comparisons in PP5
Showing
1 changed file
with
8 additions
and
4 deletions
openbr/plugins/pp5.cpp
| @@ -305,10 +305,14 @@ class PP5CompareDistance : public Distance | @@ -305,10 +305,14 @@ class PP5CompareDistance : public Distance | ||
| 305 | 305 | ||
| 306 | float compare(const Template &target, const Template &query) const | 306 | float compare(const Template &target, const Template &query) const |
| 307 | { | 307 | { |
| 308 | - (void) target; | ||
| 309 | - (void) query; | ||
| 310 | - qFatal("Compare single templates should never be called!"); | ||
| 311 | - return 0; | 308 | + TemplateList targetList; |
| 309 | + targetList.append(target); | ||
| 310 | + TemplateList queryList; | ||
| 311 | + queryList.append(query); | ||
| 312 | + MatrixOutput *score = MatrixOutput::make(targetList.files(), queryList.files()); | ||
| 313 | + compare(targetList, queryList, score); | ||
| 314 | + return score->data.at<float>(0); | ||
| 315 | + | ||
| 312 | } | 316 | } |
| 313 | 317 | ||
| 314 | void compare(const TemplateList &target, const TemplateList &query, Output *output) const | 318 | void compare(const TemplateList &target, const TemplateList &query, Output *output) const |