Shaders for analysis

Aug 18, 2009 at 4:17pm

Shaders for analysis

Hey,

Are there any OpenGl-shaders that output video-analysis data similar to i.e. jit.3m?

In my case I’d like to build an auto-contrast-effect to put at the end of a long chain of shaders with jit.gl.slab. It currently seems like I have to render to a matrix before I can analyse the processed video… Stupid.

Thanks for helping

#45146
Aug 18, 2009 at 4:41pm

shaders can only work with knowledge of a single pixel. averaging requires knowledge of all the pixels. so i don’t think so.

#162666
Aug 19, 2009 at 8:03am

Thanks for answering!

Doesn’t for instance cf.edgedetect.jxs or cf.emboss.jxs need knowledge of more then just one pixel?

#162667
Aug 19, 2009 at 4:14pm

right, these shaders work by sampling the nearest neighbors of a pixel. that is still not enough for a jit.3m type shader.

maybe something could be achieved with multiple passes, but i don’t think it would be very efficient.

i would search around for shaders that to the specific task you’re trying to achieve, rather than general analysis functionality. you might find something that gets the end result differently.

#162668
Aug 22, 2009 at 5:14pm

It’s possible to take a histogram of an image on the GPU, but it requires more than just writing a shader. You also have to draw geometry to screen in a very specific way in order to make the computation efficient and tractable. Here’s a paper from ATI/AMD describing how to do it:

http://developer.amd.com/gpu_assets/GPUHistogramGeneration_I3D07.pdf

wes

#162669

You must be logged in to reply to this topic.