From eea7e096bd779372b7573fa988db75a60f066feb Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Thu, 14 Aug 2014 12:15:57 -0400 Subject: [PATCH] Some images get to Cascade when not 8UC and fail a cvAssert, CvtUChar before detectMultiScale --- openbr/plugins/cascade.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openbr/plugins/cascade.cpp b/openbr/plugins/cascade.cpp index d91ac89..b74eaf9 100644 --- a/openbr/plugins/cascade.cpp +++ b/openbr/plugins/cascade.cpp @@ -376,16 +376,18 @@ class CascadeTransform : public MetaTransform void project(const TemplateList &src, TemplateList &dst) const { CascadeClassifier *cascade = cascadeResource.acquire(); - foreach (const Template &t, src) { - const bool enrollAll = t.file.getBool("enrollAll"); + foreach (const Template &tmpl, src) { + const bool enrollAll = tmpl.file.getBool("enrollAll"); // Mirror the behavior of ExpandTransform in the special case // of an empty template. - if (t.empty() && !enrollAll) { - dst.append(t); + if (tmpl.empty() && !enrollAll) { + dst.append(tmpl); continue; } + Template t; + OpenCVUtils::cvtUChar(tmpl.m(), t.m()); for (int i=0; i rects; -- libgit2 0.21.4