AnsweredAssumed Answered

OpenCL - OpenGL trouble to display image

Question asked by Wheedle on Jul 19, 2012

Hi Everybody,


I've developed a small application of the Harris corner detection on a video. At first I was displaying the result using OpenCV (as I use it also to read my video).

Now I want to boost the performance and I want to make the display with OpenGL.

I've read the chapter 15 in "OpenCL in Action" ed. Manning, and I've decided to make first a small application to test my new knowledge. Unfortunately I didn't manage.

So here is what I need:

It's only a test, I mean it doesn't make much sense :

I read one frame at a time with OpenCV, I send it to the GPU to simply transfer its pixels and 2D coordinates to 2 OpenGL buffers. After that I want to use these two buffers to display them with OpenGL. I took the source code from OpenCL in Action available here (called Ch15_sphere). And I transformed it to attempt to make what i describe above (attached with this post).

Everything runs, but nothing is displayed. I'm almost sure that is due to my lake of knowledge in shader programming but it could be also that it is not the way to do it at all, since the example given in the book is about to render something and that i only want to display an already existing image.

So I have 2 questions:

  • What did I do wrong in the code posted here?
  • Is it even possible to make it work with this approach and does it exist a better way to reach my goal?

Also another thing that bothers me is that I read BGR 24 bits video, and that it  seems that i can't have the corresponding OpenGL type. Any though on that would be welcomed too.


I use Win 7 x64 pro and i develop with Visual Studio 2010. I don't thing that info on my system could help but if think so, just ask.

If I am unclear or that I miss to provide useful info, let me know too.


Thank you guys,