Page 1 of 1
Histogram Equalization technique.
Posted: 2008-05-24T11:49:42-07:00
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!
Re: Histogram Equalization technique.
Posted: 2008-05-24T13:34:33-07:00
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.
Re: Histogram Equalization technique.
Posted: 2008-05-24T14:14:34-07:00
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++ .
Re: Histogram Equalization technique.
Posted: 2008-05-24T23:10:44-07:00
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.