Sorry, this content is no longer available

Ask Your Question
0

minMaxLoc crashed using opencl when location is needed

asked Jul 15 '15

LBerger gravatar image

updated Jul 16 '15

My program works well when setUseOpenCL is false. When setuseOpencl is true I have got problem when I want locatation of min and max. How can I solve it?

int main(int argc, char **argv)
{
cv::ocl::setUseOpenCL(true);
UMat m;

imread("f:lib/opencv/samples/data/lena.jpg", CV_LOAD_IMAGE_GRAYSCALE).copyTo(m);
vector<double> minIm(m.channels());         
vector<double> maxIm(m.channels());         
vector<Point> locMin(m.channels());         
vector<Point> locMax(m.channels());         
minMaxLoc(m,&minIm[0],&maxIm[0]); // that's OK with or without openCL
cout << "size =" << m.size()<<endl;
cout << "Max =" << maxIm[0] <<endl;
cout << "Min =" << minIm[0] <<endl;
minMaxLoc(m,&minIm[0],&maxIm[0],&locMin[0],&locMax[0]); // that's OK  without openCL but crashed with opencl
cout << "size =" << m.size()<<endl;
cout << "Max =" << maxIm[0] << " Location " << locMax[0]<<endl;
cout << "Min =" << minIm[0] << " Location " << locMin[0]<<endl;
return 0;
}

assertion is

size =[512 x 512] Max =248 Min =18 OpenCV Error: Assertion failed (clFinish_pfn(qq) == 0) in cv::ocl::Kernel::run, file ......\modules\core\src\ocl.cpp, line 3472

device is + "GeForce GTX 970" with windows 8.1 64 bits opencv 3.0 gold

there is a bug but it seems differents

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Jul 16 '15

LBerger gravatar image

updated Jul 16 '15

So I have test my program with device Quadro FX 380 LP (windows 7 32 bits) and quadro 600 (linux 3.2.02 amd64-x86 opencv 3.0.0-dev) there is no problem. I think if there is a bug it's not opencv bug but a bug in GeForce GTX 970.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Jul 15 '15

Seen: 698 times

Last updated: Jul 16 '15