From 433f672737a98696a15699a32973f2e0824c1ac1 Mon Sep 17 00:00:00 2001 From: Rushuai Date: Tue, 23 Jan 2018 11:34:30 +0800 Subject: [PATCH] fix gray image issue, the dx/dy channels shoule be same as image channels --- src/fhog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fhog.cpp b/src/fhog.cpp index 28898e8..cdcd042 100644 --- a/src/fhog.cpp +++ b/src/fhog.cpp @@ -110,9 +110,9 @@ int getFeatureMaps(const IplImage* image, const int k, CvLSVMFeatureMapCaskade * numChannels = image->nChannels; dx = cvCreateImage(cvSize(image->width, image->height), - IPL_DEPTH_32F, 3); + IPL_DEPTH_32F, numChannels); dy = cvCreateImage(cvSize(image->width, image->height), - IPL_DEPTH_32F, 3); + IPL_DEPTH_32F, numChannels); sizeX = width / k; sizeY = height / k;