Problem with HE

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Posts: 22
Joined: 2016-02-19T00:31:25-07:00
Authentication code: 1151

Problem with HE

Post by life24 »

Why in pure 'HE' isn't good for images with cumulative in black or white region in histogram? Thanks
For example:

User avatar
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with HE

Post by fmw42 »

It tries to populate each possible graylevel 0 to 255 equally in the image. The input image has very weak dark values that are near black. But black and white are the predominant values. So HE causes many of the dark but not black values to be more populated and so show up where they used to be similar to black. Thus they turn gray. It is sort of like spreading the dark values out to the same number of counts, so decreasing the pure black count while increasing the near black counts so that the the counts are more even in the histogram. This causes a very noisy image, when you start with basically two predominant colors (white and black). See

Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problem with HE

Post by snibgo »

As Fred says. Put it another way:

When a region of an image contains a narrow range of values, and the image as a whole doesn't contain an adjacent range of values, many of the values in the region will be shifted to fill in the missing portion of the histogram. This will increase the contrast within that region. Increasing contrast exagerates small differences between pixels. When small differences are irrelevant noise, this noise becomes visible.

In this example, a large region is mostly black, and the image as a whole is missing mid-gray values. So many near-black pixels become mid-gray. This massively increases the contrast in that region.

Techniques are available to limit the increase im contrast. See my "[Adaptive] Contrast-limited equalisation" page.
snibgo's IM pages: