Standard Library function that returns ahistogram-equalized image or vector.
Maxv The maximum value to be used. If not specified, the largest value of the elements in image is used. Input elements greater than max are output as 255.
Minv The minimum value to be used. Should be greater than 0. All input elements in image less than or equal to min will be output as 0. If not specified, 0 is used.
Top If specified, scales the result from 0 to Top before it is returned.
To equalize the histogram of display values, the count-intensity histogram of the image is required. This is a vector in which the ith element contains the number of pixels with an intensity equal to the minimum pixel value of the image plus i. The vector is of long integer type and has one more element than the difference between the maximum and minimum values in the image. (This assumes a Binsize of 1 and an image that is not of byte type.) The sum of all the elements in the vector is equal to the number of pixels in the image.
HIST_EQUAL uses the HISTOGRAM function to obtain the density distribution of the image. This distribution is integrated to obtain the cumulative density probability function. Finally, the distribution is normalized so that its maximum element has a value of 255.
If image is of floating-point data type, its range of values should be at least 255, unless the Binsize keyword is used. If image is of byte data type, any Binsize keyword is ignored.
Unfortunately, it is this very effect that can sometimes cause unsatisfactory resultshistogram equalization chooses a display map-ping based on the area covered by the various features in the image, rather than their importance. This can cause the contrast enhancement of reconstruction artifacts in the large background area, while small features of medical interest are sacrificed.
wavedir/data
wavedir:[DATA]
wavedir\data
wavedir
is the main PV-WAVE directory.The commands shown in this example produce the image on the right in Figure 2-41:
Figure 2-41 The HIST_EQUAL function has been used to make the visual elements of this 512-by-512 galaxy image more pronounced.
Figure 2-42 The HIST_EQUAL function has been used to make the visual elements of this 512-by-512 galaxy image more pronounced.
whirlpool = BYTARR(512,512) GET_LUN, unit filename = 'whirlpool.img' OPENR, unit, filename READU, unit, whirlpool CLOSE, unit FREE_LUN, unit
!Order = 1
WINDOW, 2, XSize=500, YSize=500 TVSCL, whirlpool
WINDOW, 0, XSize=500, YSize=500 image = HIST_EQUAL(whirlpool) TVSCL, HIST_EQUAL(image)
For more information, see Histogram Equalization in Chapter 6 of the PV-WAVE User's Guide.