Commit 5796d708fbdbabcc0a060a3ac7996b4180b67d25
1 parent
6f2af056
added sanity check to matrix format for br -eval
Showing
1 changed file
with
6 additions
and
0 deletions
openbr/core/eval.cpp
| ... | ... | @@ -130,6 +130,12 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv) |
| 130 | 130 | qFatal("Similarity matrix (%ix%i) differs in size from mask matrix (%ix%i).", |
| 131 | 131 | simmat.rows, simmat.cols, mask.rows, mask.cols); |
| 132 | 132 | |
| 133 | + if (simmat.type() != CV_32FC1) | |
| 134 | + qFatal("Invalid simmat format"); | |
| 135 | + | |
| 136 | + if (mask.type() != CV_8UC1) | |
| 137 | + qFatal("Invalid mask format"); | |
| 138 | + | |
| 133 | 139 | float result = -1; |
| 134 | 140 | |
| 135 | 141 | // Make comparisons | ... | ... |