Talk:Histogram equalization

Latest comment: 7 months ago by 176.4.224.166 in topic Parts of information provided are completely wrong

Example added

edit

I have created an example. But it seems a little awkwardly placed. Feel free to re-arrange it or put it in a different location in the article.--Konstable 05:56, 11 June 2006 (UTC)Reply

Excellent! I love the example. Wilson Harron 21:55, 22 October 2006 (UTC)Reply
Thanks!--Konst.ableTalk 22:45, 22 October 2006 (UTC)Reply
edit

Added a section on back project with a citation and footnote reference, but couldn't figure out how to get the superscript to link properly. kostmo 20:40, 18 August 2006 (UTC)Reply

Philosophy project

edit

Sorry, but I don't understand why is this page into philosophy's project. It seems better suited to optics, computer science or something like this, is not?--Patillotes (talk) 07:47, 31 January 2008 (UTC)Reply

Incorrect image

edit

Isn't the example pictogram of the histograms wrong !? Histogram equalization should transfrom an image such that it's histogram becomes (approximately) uniform, i.e. "flat" -- the shown pictogram looks more like it's just about contrast and brightness change, i.e. linear transformation . -Seb.Haase —Preceding unsigned comment added by Sebhaase (talkcontribs) 08:40, 5 September 2008 (UTC)Reply

That is not the point at all. The point is is that the cumulative histogram is linear:
H.eq. spreads out the histogram which is a form of contrast adjustment. The more "probable" a given intensity is in the original image that intensity has more local contrast. The maximum in the above image (~52) has the largest step to the previous and next intensity.
Flattening the histogram would result in global contrast change and a drastic change in the image. What transformation are you thinking of that would yield a flat histogram? Cburnett (talk) 20:07, 5 September 2008 (UTC)Reply
The histogram would be flat only if histograms were continuous functions. Since they are discrete, it's not possible to guarantee a flat histogram. But you can still make the cumulative histogram quasi-linear. 89.214.104.88 (talk) 11:38, 12 March 2009 (UTC)Reply
For the cumulative histogram to be linear, each step must contribute the same number of occurrences as every other step of the same size, and the histogram must therefore be constant...unless the x-axis is non-linear or not fully populated. —Preceding unsigned comment added by 128.170.116.22 (talk) 21:48, 31 July 2009 (UTC)Reply
I came to the talk page because I was going to make the same observation, but of the image:
Is it possible that this is the image Seb was referring to? It seems to show histogram stretching, not equalization. Actually, as the graph shows a continuous histogram, the equalized version should be a rather boring flat line. I may be missing something here, but I think that a) that image is histogram stretching, not equalization, and b) showing stretching on the equalization page may confuse people, particularly as they are related.
Timbo76 (talk) 00:38, 9 November 2011 (UTC)Reply

Isn't the image of the scaled image also incorrect? If you compare the bitmap against the matrix above it, you can see the lower left corner is 146 and the pixel to the right is 206, yet in the image the left pixel is brighter (whiter) than the right. Same in the upper right corner: corner is 53, pixel to left is 174, yet the left pixel is clearly blacker. What am I missing here?  Preceding unsigned comment added by Bnehring (talkcontribs) 18:39, 19 July 2018 (UTC)Reply

Error in formula

edit

The formula in the example is not correct: it says "cdf(v) = round[cdf(v)..." when it should be something like "vnew(vold) = round[cdf(vold)...", as the formula gives us the new value that a certain gray level in the original image will assume in the equalized image. Gazilion (talk) 12:10, 12 March 2009 (UTC)Reply

Histogram Matching and Histogram Hyperbolization

edit

Maybe it makes sense to mention Histogram Matching (match histogram to a distribution of a 2nd source). Even more important is Histogram Equalization in log-log-domain (Histogram Hyperbolization). Hyperbolization is achieved by using the power function for the cdf. This leads to more "natural" results, since many quantities in nature are roughly linear in log-log domain (including light as perceived by the human visual system). -- 92.225.71.216 (talk) 09:50, 30 November 2009 (UTC)Reply

Overview is bad

edit

The overview is not an overview if it starts giving mathematical jargon and talks about DNA stuff. Applications of this technique shouldn't be discussed in that much detail. There are also a few grammatical mistakes in the overview. The discussion of when the equalization should be used is also simplifying it too much. The section is just bad; the main person to blame is whoever added that stuff about DNA.Owen214 (talk) 04:38, 13 June 2010 (UTC)Reply

Invertible?

edit

This article talks about the equalization being invertible, yet the german wikipedia (and my image processing course notes) say that is is explicitly NOT invertible. Which also makes sense to me, since this process can map multiple (infrequent) grey levels in the source image to the same grey level in the resulting image. --77.176.232.123 (talk) 21:04, 20 December 2010 (UTC)Reply

bad formula?

edit

The formula for histogram equalization icludes CDF values(Commulative Distribution Function) which are probabilities.

So, when the formula

mentions cdf, thats incorrect. I think it should read like


where Nk= the sum of all the appearances of values N1,N2...Nk —Preceding unsigned comment added by 94.67.130.221 (talk) 12:49, 5 February 2011 (UTC)Reply

Example

edit

Examples

edit

Small image

edit

The following is the same 8x8 subimage as used in JPEG. The 8-bit greyscale image shown has the following values:

The histogram for this image is shown in the following table. Pixel values that have a zero count are excluded for the sake of brevity.

ValueCount ValueCount ValueCount ValueCount ValueCount
521 642 721 852 1131
553 653 732 871 1221
582 662 751 881 1261
593 671 761 901 1441
601 685 771 941 1541
614 693 781 1042
621 704 792 1061
632 712 831 1091

The cumulative distribution function (cdf) is shown below. Again, pixel values that do not contribute to an increase in the cdf are excluded for brevity.

Valuecdf Valuecdf Valuecdf Valuecdf Valuecdf
521 6419 7240 8551 11360
554 6522 7342 8752 12261
586 6624 7543 8853 12662
599 6725 7644 9054 14463
6010 6830 7745 9455 15464
6114 6933 7846 10457
6215 7037 7948 10658
6317 7139 8349 10959

This cdf shows that the minimum value in the subimage is 52 and the maximum value is 154. The cdf of 64 for value 154 coincides with the number of pixels in the image. The cdf must be normalized to . The general histogram equalization formula is:

Where cdfmin is the minimum value of the cumulative distribution function (in this case 1), M × N gives the image's number of pixels (for the example above 64, where M is width and N the height) and L is the number of grey levels used (in most cases, like this one, 256). The equalization formula for this particular example is:

For example, the cdf of 78 is 46. (The value of 78 is used in the bottom row of the 7th column.) The normalized value becomes

Once this is done then the values of the equalized image are directly taken from the normalized cdf to yield the equalized values:

Notice that the minimum value (52) is now 0 and the maximum value (154) is now 255.

Code the message “ANDHRA” using arithmetic coding algorithm. — Preceding unsigned comment added by 106.51.243.6 (talk) 14:25, 16 November 2013 (UTC)Reply

Histogram-equalized 8x8 example image has errors (possibly due to JPEG loss?)

edit

The current histogram-equalized version of the 8x8 example image has errors, or at least doesn't match the matrix generated in the example.

For example, this image should be significantly lighter at pixel position [1, 3] (Coordinates counted from 0 starting at top left corner) to match this the final histogram-equalized matrix. I think the problem is with the image, not the matrix because when I was reproducing the 8x8 example, my results matched the matrix rather than the image.

I generated my own image with the correct greyscale values, but Wikipedia isn't accepting my upload.

 Preceding unsigned comment added by Isears (talkcontribs) 14:16, 31 December 2020 (UTC)Reply

Update: was able to upload my corrected image to commons:

https://commons.wikimedia.org/wiki/File:Small_example_hist_equalized.png

Isears (talk) 14:24, 31 December 2020 (UTC)Reply

The notations are wrong

edit

The notation h(v) is incorectly used several times. h(v) would be the new values of the histogram for that specific pixel value, but it is used when calculating the actual new pixel value of the transformed image resulted from the process of histogram equalization. A.Roman2104 (talk) 02:20, 27 January 2023 (UTC)Reply

Advantages and disadvantages section appears to be AI generated

edit

Numbered bullet point list format doesn't pass the AI slop smell test. Warrants removal imo TKanarsky (talk) 23:59, 8 August 2024 (UTC)Reply

Cumulative distribution function

edit

This note is moved from the top of Histogram equalization#Examples. It appears to addressed to editors, not to readers. ~Kvng (talk) 20:53, 9 September 2025 (UTC)Reply

For consistency with statistical usage, "CDF" (i.e. Cumulative distribution function) should be replaced by "cumulative histogram", especially since the article links to cumulative distribution function which is derived by dividing values in the cumulative histogram by the overall amount of pixels. The equalized CDF is defined in terms of rank as .

~Kvng (talk) 20:53, 9 September 2025 (UTC)Reply

Parts of information provided are completely wrong

edit

Example:

"[..." an invertible operation. So, in theory, if the histogram equalization function is known, then the original histogram can be recovered."

Not true.

German Wikipedia has it right, see:

(Note: There is an "a-Umlaut" in the URL (between "#Histogramm" and "qualisation").)

https://de.wikipedia.org/wiki/Punktoperator_(Bildverarbeitung)#Histogrammäqualisation

"Die Histogrammäqualisation ist verlustbehaftet, da größere Bereiche der Skala mit Grauwerten geringer Häufigkeit auf wenige Grauwerte komprimiert werden. Daher ist sie nicht umkehrbar."

Simple example:

If you have an 8-bit grey level image in which actually all 256 of those 256 grey levels are used then you can still use histogram equalization. But if some of the source grey levels (the rare ones) have to be mapped onto a common target grey level for equalization purposes then there is no function to map those back to the original values. 176.4.224.166 (talk) 11:41, 7 October 2025 (UTC)Reply