alx119 said:
What I really wanted to do, was for game development purposes. I was thinking to use opengl to attach an image to an model, and to make somehow to modify the image in real time with opencv. For example, I have a cube and attach the blank texture to it. If I modify the texture with opencv (let's say I draw the image as a brick) this will update immediately on the model, without to re-run the application.
The usual way of doing this would be to modify the image with CPU and update the texture every frame for display. The update is no problem if the data is not huge.
I don't know about OpenCV. But it is possible to have interop from OpenCL with OpenGL (likely the same applies to CUDA). So you could avoid a need to download an image from GPU only to upload it again, if the image generation already happens on GPU.
Alternatively, nothing would stop you from implementing any image processing algorithms in OpenGL compute.
Edit: Sorry, i thought you have stated to use OpenGL but you did not. The same applies to DirectX, but you might want to be more specific if this matters.