Commit 91680703f943363d9f265c133c7392700c2ab067
1 parent
2d62c94d
Returning -max if templates have different number of matrices in fusedistance
Showing
1 changed file
with
3 additions
and
1 deletions
openbr/plugins/distance/fuse.cpp
| @@ -70,7 +70,9 @@ private: | @@ -70,7 +70,9 @@ private: | ||
| 70 | 70 | ||
| 71 | float compare(const Template &a, const Template &b) const | 71 | float compare(const Template &a, const Template &b) const |
| 72 | { | 72 | { |
| 73 | - if (a.size() != b.size()) qFatal("Comparison size mismatch"); | 73 | + if (a.size() != distances.size() || |
| 74 | + b.size() != distances.size()) | ||
| 75 | + return -std::numeric_limits<float>::max(); | ||
| 74 | 76 | ||
| 75 | QList<float> scores; | 77 | QList<float> scores; |
| 76 | for (int i=0; i<distances.size(); i++) { | 78 | for (int i=0; i<distances.size(); i++) { |