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;