Ask Your Question

Revision history [back]

minMaxLoc crashed using opencl when location is needed

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;
}

there is a bug but it seems differents

minMaxLoc crashed using opencl when location is needed

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

there is a bug but it seems differents

minMaxLoc crashed using opencl when location is needed

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"

there is a bug but it seems differents

minMaxLoc crashed using opencl when location is needed

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"970" with windows 8.1 64 bits opencv 3.0 gold

there is a bug but it seems differents