Image with uniform histogram

2 次查看(过去 30 天)
I have a grey scale image and I want to change the histogram of the image to uniform histogram. How should I do it?

采纳的回答

Walter Roberson
Walter Roberson 2012-5-30
  6 个评论
Walter Roberson
Walter Roberson 2012-5-30
Oh wait, I should have said "NO". histeq() applied to an image will output the adjusted image, not the histogram of the adjusted image. You would still need something like imhist() applied to the histeq() adjusted image in order to get the new histogram.

请先登录,再进行评论。

更多回答(1 个)

Image Analyst
Image Analyst 2012-5-31
Histogram equalization WILL NOT give you a flat histogram. If someone told you that, then they were wrong. It would only work for the case of infinite number of pixels and infinite number of gray levels, essentially a continuum in both space and intensity. If you want a flat histogram for finite-sized, intensity-quantized actual real world digital images, you'll need to use my histogram shaping program which WILL give you a flat histogram, or any other shape you can possibly think of. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 The screenshot shows the image going to the shape of a girl's silhouette but like the text says, it also can give you a flat histogram - it asks you which you want when it starts up. The histogram will be truly exactly flat, at least to the extent that it can be. The only situation when it won't is when your image doesn't have an integer multiple of 256 pixels because it can't be perfectly flat in that case (think about it). But it will be as flat as mathematically possible. It's an clever and interesting algorithm - it uses noise and sorting to enforce perfect flatness and avoid contours.

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by