PDA

View Full Version : OpenGL for image processing and computer vision



147258
10-17-2012, 07:27 AM
Hello,
I hope I do not make a fatal mistake in my first question.
I want to write an program for image manipulation.
Therefore I want to make the processing of the image on the GPU, and because I want to develop the application for Windows and Linux, I wanted to use OpenGL instead of DirectX.
Because of this I wanted to ask, if there is a simpler way (perhaps with a short note on how to do) than taking the way for 3D (where there are many tutorials) and only rendering 2 polygons full screen and then applying the pixel shader on it?
Also I wanted to ask if there is a simple way to use OpenGL with C# and Java?
Thanks for answering my question.

tonyo_au
10-17-2012, 05:07 PM
Rendering in 2D is quite easy in OpenGL; many basic calls have 2d version like glVertex2f vs glVertex3f or just set the z value to 0. Also google orthogonal projections. If you are planning to do image manipulation shaders will make your life a lot simpler in the long run. You might want to buy "The OpenGL 4.0 Shader Language Cookbook" e-book. I know there is a library for Java and there is OpenTK for c#.

menzel
10-18-2012, 12:30 AM
I wouldn't recommend the immediate mode anymore, setting up rendering to fullscreen quads for image manipulation isn't hard in core and you can port that code to MacOS X or mobile devices with OpenGL ES later on...
An alternative to rendering the images in a FBO would be compute shaders starting with OpenGL 4.3 or using OpenCL instead of OpenGL which also can run on the GPU and is cross plattform.

147258
10-20-2012, 07:22 AM
Sorry that I did not answer earlier, but I had to do a lot.
I have only some further questions.
I want to take a bitmap as input and return a bitmap. Is this possible with FBO? And do I need a swap chain, if I do not want to display the image direct to the screen?
And last, are there any good tutorials about starting with opengl (rendering a 2D image and applying a pixel shader)?