oclMat gsum(totalheight + 4, gimg.cols + 1, CV_32SC1);
oclMat gsqsum(totalheight + 4, gimg.cols + 1, CV_32FC1);
+ int sdepth = 0;
+ if(Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))
+ sdepth = CV_64FC1;
+ else
+ sdepth = CV_32FC1;
+ sdepth = CV_MAT_DEPTH(sdepth);
+ int type = CV_MAKE_TYPE(sdepth, 1);
+ oclMat gsqsum_t(totalheight + 4, gimg.cols + 1, type);
+
cl_mem stagebuffer;
cl_mem nodebuffer;
cl_mem candidatebuffer;
cv::Rect roi, roi2;
cv::Mat imgroi, imgroisq;
cv::ocl::oclMat resizeroi, gimgroi, gimgroisq;
- int sdepth = 0;
- if(gsqsum.clCxt->supportsFeature(ocl::FEATURE_CL_DOUBLE))
- sdepth = CV_64FC1;
- else
- sdepth = CV_32FC1;
- sdepth = CV_MAT_DEPTH(sdepth);
- int type = CV_MAKE_TYPE(sdepth, 1);
- cv::ocl::oclMat gsqsum_t(gsqsum.size(), type);
int grp_per_CU = 12;
size_t blocksize = 8;
indexy += sz.height;
}
- gsqsum_t.convertTo(gsqsum, CV_32FC1);
+ if(Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))
+ gsqsum_t.convertTo(gsqsum, CV_32FC1);
+ else
+ gsqsum = gsqsum_t;
gcascade = (GpuHidHaarClassifierCascade *)cascade->hid_cascade;
stage = (GpuHidHaarStageClassifier *)(gcascade + 1);
int n_factors = 0;
oclMat gsum;
oclMat gsqsum;
- cv::ocl::oclMat gsqsum_t;
+ oclMat gsqsum_t;
cv::ocl::integral(gimg, gsum, gsqsum_t);
gsqsum_t.convertTo(gsqsum, CV_32FC1);
CvSize sz;
cv::Rect roi, roi2;
cv::ocl::oclMat resizeroi, gimgroi, gimgroisq;
- if(gsqsum.clCxt->supportsFeature(ocl::FEATURE_CL_DOUBLE))
- sdepth = CV_64FC1;
- else
- sdepth = CV_32FC1;
- sdepth = CV_MAT_DEPTH(sdepth);
- int type = CV_MAKE_TYPE(sdepth, 1);
-
- cv::ocl::oclMat gsqsum_t(gsqsum.size(), type);
for( int i = 0; i < m_loopcount; i++ )
{
cv::ocl::integral(resizeroi, gimgroi, gimgroisq);
indexy += sz.height;
}
- gsqsum_t.convertTo(gsqsum, CV_32FC1);
+ if(Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))
+ gsqsum_t.convertTo(gsqsum, CV_32FC1);
+ else
+ gsqsum = gsqsum_t;
+
gcascade = (GpuHidHaarClassifierCascade *)(cascade->hid_cascade);
stage = (GpuHidHaarStageClassifier *)(gcascade + 1);
}
else
{
- cv::ocl::oclMat gsqsum_t;
cv::ocl::integral(gimg, gsum, gsqsum_t);
- gsqsum_t.convertTo(gsqsum, CV_32FC1);
+ if(Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))
+ gsqsum_t.convertTo(gsqsum, CV_32FC1);
+ else
+ gsqsum = gsqsum_t;
gcascade = (GpuHidHaarClassifierCascade *)cascade->hid_cascade;
gimg1.release();
gsum.release();
gsqsum.release();
+ gsqsum_t.release();
}
else if (!(m_flags & CV_HAAR_SCALE_IMAGE) && (flags & CV_HAAR_SCALE_IMAGE))
{
gsum.create(totalheight + 4, cols + 1, CV_32SC1);
gsqsum.create(totalheight + 4, cols + 1, CV_32FC1);
+ int sdepth = 0;
+ if(Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))
+ sdepth = CV_64FC1;
+ else
+ sdepth = CV_32FC1;
+ sdepth = CV_MAT_DEPTH(sdepth);
+ int type = CV_MAKE_TYPE(sdepth, 1);
+
+ gsqsum_t.create(totalheight + 4, cols + 1, type);
+
scaleinfo = (detect_piramid_info *)malloc(sizeof(detect_piramid_info) * loopcount);
for( int i = 0; i < loopcount; i++ )
{