Well, here is my understanding, maybe not 100% correct, and apologize for my non-mater-lingual-English.
GpuMat uses global memory . However, OpenGL textures are located in Texture memory , which is specifically designed for the texture equipment of the GPU (and not for CUDA cores). Texture memory is organized like regular linear 2D / 3D arrays, it can use a specific Space Filling Curve to organize its content to optimize the texture caching speed, so you cannot get a device pointer to Texture. You can only access Texture Mem directly in CUDA using the Texture Fetch (read-only) function or Surface R / W.
The current OpenCV implementation does not seem to use the cuda texture / surface function. You must copy from textures to global memory in order to link them as GpuMat s. Well, not really "binding."
This thread describes a CUDA approach that records OpenGL textures.
Either wait for OpenCV to implement the new feature, or wait for NVIDIA to have a new GPU architecture combining Texture Mem and Global Mem, or wait for someone to invent a special EMP device to crack these memories ... XD
Kh40tiK
source share