linearPolar problem with UMat

asked 2016-04-08 04:55:51 -0600

Josky gravatar image

I have some problems with cv::linearPolar using UMat in openCV 3.0.

The destination UMat is correct but I can't use it anymore in any other cv function (e.g. when I try to resize it I get a full-black image)

Here's the code:

UMat u1, u2, u3;
u1 = imread("path", CV_LOAD_IMAGE_GRAYSCALE).GetUMat(ACCESS_RW);
linearPolar(u1, u2, Point(u1.cols / 2, u1.rows / 2), u1.rows / 2,  CV_WARP_FILL_OUTLIERS + CV_INTER_LINEAR);
//correct image
resize(u2, u3, Size(u2.cols * 2, u2.rows * 2));
//completely black image

Another issue: linearPolar seems different from the old cvLinearPolar: with linearPolar I can't set the destination Mat to a precise Size as I did with cvLinearPolar.

Thanks in advance.

edit retag flag offensive close merge delete

Comments

Sorry I have delete your comment. There is a bug in opencv using opencl

cv::ocl::setUseOpenCL(true);
UMat u1,u2,u3;
imread("f:/lib/opencv/samples/data/lena.jpg", CV_LOAD_IMAGE_GRAYSCALE).copyTo(u1);
imread("f:/lib/opencv/samples/data/chicky_512.png", CV_LOAD_IMAGE_GRAYSCALE).copyTo(u2);
linearPolar(u1, u2, Point(u1.cols / 2, u1.rows / 2), 61,  CV_WARP_FILL_OUTLIERS + CV_INTER_LINEAR);
//correct image
resize(u2, u3, Size(u2.cols * 2, u2.rows * 2));

imshow("src",u1);
imshow("u2",u2);
imshow("u3",u3);

waitKey();

you can make an issue if you want

LBerger gravatar imageLBerger ( 2016-04-08 09:49:40 -0600 )edit