From dece21619fce0f49a26aab1386397ed94149db73 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 21 Aug 2015 13:34:04 -0700 Subject: [PATCH] AsyncDetectMultiScale: use input matrix if color conversion was not required. --- src/CascadeClassifierWrap.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CascadeClassifierWrap.cc b/src/CascadeClassifierWrap.cc index 0032c8f..3950c04 100755 --- a/src/CascadeClassifierWrap.cc +++ b/src/CascadeClassifierWrap.cc @@ -61,6 +61,8 @@ class AsyncDetectMultiScale : public NanAsyncWorker { if(this->im->mat.channels() != 1) { cvtColor(this->im->mat, gray, CV_BGR2GRAY); + } else { + gray = this->im->mat; } equalizeHist( gray, gray); this->cc->cc.detectMultiScale(gray, objects, this->scale, this->neighbors, 0 | CV_HAAR_SCALE_IMAGE, cv::Size(this->minw, this->minh));