Grayscale image processing

Hi, all

I’m trying to immigrate our application system from Sun Solaris to Linux. The project plan is using OpenGL to replace Sun’s XIL lib and using OpenGL to manipulate the window/level(brightness/contrast) of 12 or 16 bit grayscale images.I am really new to OpenGL. It’s really hard to find some OpenGL grayscale image processing information and sample code. Could anybody give me some suggestions? Thank you in advance.


Sorry, I think you cannot help you much but I just want to tell you some problems with your approach.

1st: make sure your target machine’s hardware really support OpenGL acceleration for 12 and 16bit integer textures - I believe most do not. Floating point 16 and 32bpp processing are rather common however. Support for non-power-of-two texture size seems also to be a definite need. By the way, another problem you might have is related to alignemnt (or maybe strange dimensions, let’s see), check out a recent topic on advanced forum

It’s really hard to find some OpenGL grayscale image processing information and sample code.
2nd: what do you really need? I’ve seen incredible things being done with just blending and fragment programs / shaders. Check out the glslang, you will find the documentation on the home page, under “documentation” tab.
I believe you could do it all with this but I’m obviously not used with your issues.

For simple luminance/contrast adjustment this is overkill by sure means but who knows what you really need to do.
If you can think your adjustment in the form of “for each pixel do …” or “for each pixel, according to its neightbours do…” you could possibly do it all thuru glslang.
If there’s sequentiality in your processing, this is usually harder to port to GPU programming models, but sometimes you may cut it anyway.

I hope this can help!

Thank you for your reply, Obli,
We planed to ask the hardware vendor to do the 12/16 bits hardware acceleration. The project plan is uring OpenGL. I am just want to learn OpenGL first and figure out how to display our 12 bits medical(CT/MRI) image and do window/level adjustment. Since OpenGL is more like a library for graphics. That’s why I feel some difficulties when I search online for some examples. I think I’ll read glslang spec and see if it can be used to resolve my problem. Thank you.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.