Commit eda981f99964d401e58afecd3a72a25ab95a820d
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
1 changed file
with
6 additions
and
4 deletions
openbr/plugins/cascade.cpp
| @@ -376,16 +376,18 @@ class CascadeTransform : public MetaTransform | @@ -376,16 +376,18 @@ class CascadeTransform : public MetaTransform | ||
| 376 | void project(const TemplateList &src, TemplateList &dst) const | 376 | void project(const TemplateList &src, TemplateList &dst) const |
| 377 | { | 377 | { |
| 378 | CascadeClassifier *cascade = cascadeResource.acquire(); | 378 | CascadeClassifier *cascade = cascadeResource.acquire(); |
| 379 | - foreach (const Template &t, src) { | ||
| 380 | - const bool enrollAll = t.file.getBool("enrollAll"); | 379 | + foreach (const Template &tmpl, src) { |
| 380 | + const bool enrollAll = tmpl.file.getBool("enrollAll"); | ||
| 381 | 381 | ||
| 382 | // Mirror the behavior of ExpandTransform in the special case | 382 | // Mirror the behavior of ExpandTransform in the special case |
| 383 | // of an empty template. | 383 | // of an empty template. |
| 384 | - if (t.empty() && !enrollAll) { | ||
| 385 | - dst.append(t); | 384 | + if (tmpl.empty() && !enrollAll) { |
| 385 | + dst.append(tmpl); | ||
| 386 | continue; | 386 | continue; |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | + Template t; | ||
| 390 | + OpenCVUtils::cvtUChar(tmpl.m(), t.m()); | ||
| 389 | for (int i=0; i<t.size(); i++) { | 391 | for (int i=0; i<t.size(); i++) { |
| 390 | const Mat &m = t[i]; | 392 | const Mat &m = t[i]; |
| 391 | std::vector<Rect> rects; | 393 | std::vector<Rect> rects; |