How to Normalise an images histogram?

27 views (last 30 days)
Sean on 26 Feb 2015
Answered: Image Analyst on 26 Feb 2015
Attached is a histogram of an image I'm doing processing work on. The images are Greyscale, as you can see along the x axis the values go from 0-256. Im looking to create a function that will normalise the 3 tonal regions. Since the tonal spread varies across different images it doesn't work well if I run a function which will give all pixels <50 a value of 25 for example. Is there a method or function/s I could use which can recognise that there will always be 3 dominant pixel values in the different regions and normalise them by removing outliers, hence decreasing pixel variation.

Accepted Answer

Image Analyst
Image Analyst on 26 Feb 2015
What are the 3 gray level regions? 0 to 100, 101 to 254, and 255? Then what do you want to do? Do you want to change the histogram so that it's totally flat in each of those regions? I think that would give a strange looking image as most histogram equalized images are. But if you want, I have code that lets you map your image to any histogram shape that you want. It's here in my File Exchange
Or maybe you just want imquantize():
posterizedImage = imquantize(grayImage, numberOfLevels);
If neither of these is what you want, then explain better.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!