I just implemented the histogram equalization technique using intel ipp functions. Since Histogram equalization equalizes within the two extreem values, I was thinking of implementing other methods for auto contrast.
Is there any way that I can perform auto contrast and not histogram equlaiztion?
I'm also interested in discussing automatic contrast algorithms.
Histogram Equalization, Histogram Stretching, Gamma Correction etc.
The problem is, you start with a bad grayscale image, and how do you present it perfectly, automatically?
The bad image is full of problems: under/over exposed, artifacts etc.
I learnt that "Center of Gravity" of a histogram is the mean of the histogram values. I am not knowing if "mean" would be a good factor in performing the auto contrast. Any thoughts on this?
Thanks Sergey for that quick response. It totally makes sense to take the center of gravity now. I will try it out and let you know about it.
I was also curious to know if there are any IPP functions to calcualte the "Center of Gravity". If yes, kindly let me know.
Sergey, Thanks for posting the code snippet with your test cases. Since I am fairly new to image processing, It took me sometime to understand your code. It would be more helpful if you had comments to walk me through. Nevertheless It is very helpful.
Sergey, I have lots of grayscale images that just cannot be displayed "perfectly" automatically,
The problem is always that the histogram of the grayscale image has large parts that must be avoided before doing automatic this-and-that.
I call those part artifacts. One artifact can be a wide tall peak in the white part, or a narrow high peak in the medium gray part. Those must be removed before applying autmatic algorithms. One way of "removing" is to mask the image before the histogra is computed, another way is to patch the histogram, supressing an easy to detect artifact.
I already use "stretching", wherein I move zero or very low black point and zero or very low white point, using percentiles to determine when to stop. To find the grayscale of greatest interest, I use what I described above, sliding a wide band over the histogram, choosing the location having the higest percentile.
Suggestions are welcome.
Contrast is not a property of the image but is a controlling parameter of an image manipulation algorithm. For instance, you can increase the contrast of an image by adjusting a pixel values such that the difference between light and dark is bigger.
In the real world there are images which need adjustment before being displayed perfectly, and I'm looking for automatic methods for this problem.
I uploaded some test images.
My sample images all have lightness problems since we discussed that. Applying filtering (and with that I understand structure/sharpness filtering) will not "fix" the lightning problem, unless you can tell me a nice idea of how.
Further, my images are reduced for presentation here. I could upload real 16 or 12 bpp grayscale originals, if you want.
I do not know about Wallis Statistical Filters, but I googled it, and it seems to also have use in my field, and indeed can possible help with simultanious dark and bright areas.
Can IPP perform Wallis?
I also spotted noise reduction using Wavelets, do you have an IPP code sample that demonstrates this?
Yes, my sample images have original and manually adjusted lightning versions. No filtering is done (structure/sharpening), only contrast/brightness/gamma.
I'm very curious for a Wallis implementation, to test with... can be outside IPP...