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