From 20807d62846ddd13ec89db68d8feed67b9f6238c Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 30 Aug 2015 00:59:16 -0700 Subject: [PATCH] Only run equalizeHist() if an BGR matrix was provided Grayscale matrices are used unmodified. --- src/CascadeClassifierWrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CascadeClassifierWrap.cc b/src/CascadeClassifierWrap.cc index 3950c04..6dbf68d 100755 --- a/src/CascadeClassifierWrap.cc +++ b/src/CascadeClassifierWrap.cc @@ -61,10 +61,10 @@ class AsyncDetectMultiScale : public NanAsyncWorker { if(this->im->mat.channels() != 1) { cvtColor(this->im->mat, gray, CV_BGR2GRAY); + equalizeHist( gray, gray); } 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)); res = objects; }