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.
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.
Create a sample image using the DIST function and display it by entering:
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: