OpenCL/OpenGL interop using UMat

asked 2017-03-29 02:47:09 -0500

iko79 gravatar image


I'm currently facing the challenge of transferring images from OpenCV with OpenCL towards a CUDA surface. As it seems like there is no way of OpenCL/CUDA interopability, my idea is to use OpenGL as a detour, as there are severals ways of OpenCL/OpenGL interop as well as CUDA/OpenGL interop.

As my starting point is the image data of a cv::UMat I am a bit stuck since all three ways of OpenCL/OpenGL interop I could find seem to require a preexisting OpenGL texture or buffer, which the OpenCL buffers are created from. Using OpenCV, I've got things actually the other way around. The cv::UMat creates the OpenCL objects for me and I don't seem to have any influence in that. It seems like I cannot even create a cv::UMat as a wrapper for a cv_mem pointer I am managing by myself (similar to using user-managed data in a cv::Mat).

Do you see any reasonable possibility in doing what I try to do (except of touching the OpenCV core code)?

edit retag flag offensive close merge delete