Histogram Equalization technique.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mongoose54

Histogram Equalization technique.

Post by mongoose54 »

Hi!

I wish to ask you if anyone knows how the histogram equalization scheme (equalize() function) in ImageMagick ) works. What I mean is on what theory this equalization is based on. Is it the straight and familiar one? Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Histogram Equalization technique.

Post by fmw42 »

There are several approaches.

One shifts data in bins. I think this is what IM does, but do not know for sure.

I have another one in my redist script that does histogram equalization as one option and another does redistribution to a gaussian shape. see http://www.fmwconcepts.com/imagemagick/index.html

In my script, I do the processing to keep the channels in sync; whereas in IM the processing is done separately on each channel.

In my script, the algorithm sets the intensity mapping transformation to the shape of the cumulative histogram distribution for histogram equalization.
mongoose54

Re: Histogram Equalization technique.

Post by mongoose54 »

So, you are basically saying that ImageMagick uses the simple familiar histogram equalization?

And how could I install your scripts in ImageMagick Library? I am using ImageMagick C++ .
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Histogram Equalization technique.

Post by fmw42 »

I am not saying I know what algorithm IM uses. I just guess this is so. You can look at the c code in the IM source code distribution if you want to find out exactly what is implemented. Look in ImageMagick-6.4.1-1source/magick/enhance.c for E q u a l i z e I m a g e. I don't read the code too well. I do see that they compute the cumulative histogram. But I am not sure how they use it.

Also what do you mean by the "straight and familiar one"? As I said before there are several typical approaches. What difference does it make which approach is used? The real issue is if you want the channels equalized separately or in concert.

My scripts are in bash Unix for command line IM. You would have to convert them for use by the C++ API.
Post Reply