Intermittent video after cv:resize() using OCL

asked 2018-04-23 23:04:45 -0600

vicul gravatar image

I test the OpenCV function resize() using OCL module. For it I built the static libs of OpenCV 3.4.1 with the option WITH_OPENCL. For testing I use the following code:

 
cv::Size sizeSrcCV = cv::Size(p->m_sizeSrc.cx, p->m_sizeSrc.cy);
cv::Size sizeDstCV = cv::Size(p->m_sizeDst.cx, p->m_sizeDst.cy);
cv::Mat srcMat(sizeSrcCV, CV_8UC3, p->m_psrcBuf);
cv::UMat dstUMat;
cv::resize(srcMat.getUMat(cv::ACCESS_FAST), dstUMat, sizeDstCV, 0, 0, CV_INTER_NN);
cv::imshow("Test", dstUMat); //Intermittent video?????

I play (via DirectShow graph)a video clip 1920x1020 with fps 30. After OpenCV resize() I get a frame 960x540. Process Explorer shows me GPU loading. But the output video is intermittent, why????

If turn off using OCL (cv::ocl::setUseOpenCL(false);), the output video is well.

My video cart: NVIDIA Geforce GTX 650; OS: MS Windows 10; VS2017.

What about CUDA in the OpenCV build? Perhaps, does this module solve my problem?

edit retag flag offensive close merge delete