From 185059959bf43251638f7e8cdb14c5bd7753d450 Mon Sep 17 00:00:00 2001 From: perping Date: Wed, 13 Nov 2013 10:19:09 +0800 Subject: [PATCH] fix haar --- modules/ocl/src/haar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/ocl/src/haar.cpp b/modules/ocl/src/haar.cpp index ac8a64e738..deff8671ef 100644 --- a/modules/ocl/src/haar.cpp +++ b/modules/ocl/src/haar.cpp @@ -1013,7 +1013,10 @@ CvSeq *cv::ocl::OclCascadeClassifier::oclHaarDetectObjects( oclMat &gimg, CvMemS oclMat gsqsum; oclMat gsqsum_t; cv::ocl::integral(gimg, gsum, gsqsum_t); - gsqsum_t.convertTo(gsqsum, CV_32FC1); + if(gsqsum_t.depth() == CV_64F) + gsqsum_t.convertTo(gsqsum, CV_32FC1); + else + gsqsum = gsqsum_t; CvSize sz; vector sizev; vector scalev;