The HIST_EQUAL function returns a histogram-equalized byte array. The HISTOGRAM function is used to obtain the density distribution of the input array. The histogram is integrated to obtain the cumulative density-probability function and finally the lookup function is used to transform to the output image.

The resulting array is always of byte type and is scaled from 0 to the value set by the TOP keyword.

Note: Floating-point arrays should not have small ranges, (e.g., less than around 255) unless a binsize is specified.

This routine is written in the IDL language. Its source code can be found in the file hist_equal.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

Result = HIST_EQUAL( A )



The array to be histogram-equalized.



The minimum value to consider. If this keyword is omitted, zero is used. Input elements less than or equal to MINV are output as zero. MINV should be greater than or equal to 0.


The maximum value to consider. If this keyword is omitted, the maximum element is used. Input elements greater than or equal to MAXV are output as 255.


Size of bin to use. If this keyword is omitted, the value 1 is used. This parameter is ignored for byte type data.


The maximum value to scale the output array. If this keyword is omitted, 255 is used.


Create a sample image using the DIST function and display it by entering:

image = DIST(100)

TV, image

Create a histogram-equalized version of the byte array, image , and display the new version. Use a minimum input value of 10, a maximum input value of 200, and limit the top value of the output array to 220. Enter:

new = HIST_EQUAL(image, MINV = 10, MAXV = 200, TOP = 220)

TV, new

See Also