Hello Harash,
Harash Sharma wrote: > > I have been able to incorporate osgPPU into my application. Image filtering > and color space conversions are working fine for a desired resolution that I > set at the beginning of the osgPPU Pipeline. > Nice to hear that the library is also used not only for rendering, but also for some online/offline computations/processing. > > 1. We require to carry out filtering at a higher resolution followed by sub > sampling. Can you suggest a method to sub-sample the image to a lower > resolution. > Huh, I suppose there exists multiple works in the field of image processing which handles about sub-sampling. The straight forward implementation, which is enabled by default in osgPPU uses GL_LINEAR for filtering. Although it is very simple approach and is supported by the hardware, so is very fast, it suffers by not-preventing high frequency details very well. Yeah, it even may create some kind of aliasing artifacts, when subsampling high frequency data. Maybe using gaussian kernel, one can produce smoother subsampled images. If you haven't done it yet, then take a look into the lecture slides about image resampling of princton university here: http://www.cs.princeton.edu/courses/archive/fall99/cs426/lectures/sampling/index.htm > > 2. We need to stretch the contrast of the image. Earlier we were doing this > on CPU. We build a histogram of the image, identify the lower and higher gray > levels, followed by the pixel by pixel transformation of gray levels. > Computing any kind of histogram on a GPU is not efficient, because this operation can not be parallelized. However if you just want to find the minimum and maximum value of your contrast, then I would propose to use custom build mipmaps for that. So you first transform your image into contrast representation, computing contrast for every pixel. Then you do the same thing as in the HDR example of osgPPU, where you build the mipmap of your image upto the 1x1 level. The mipmap will consist of two channels, the minimum and maximum value. At the end you read out the last level and use those both values to transform each pixel of the original image correspondigly. It seem this is almost the same thing as in the HDR example, so take a look there. I hope, I was able to help. regards, art ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17681#17681 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

