How to Normalise an images histogram?
조회 수: 3 (최근 30일)
이전 댓글 표시
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147329/image.png)
>>
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.
댓글 수: 0
채택된 답변
Image Analyst
2015년 2월 26일
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 http://www.mathworks.com/matlabcentral/fileexchange/28972-custom-shaped-histogram
Or maybe you just want imquantize():
posterizedImage = imquantize(grayImage, numberOfLevels);
If neither of these is what you want, then explain better.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!