HIST_EQUAL_CT Procedure

Standard Library procedure that uses an input image parameter, or the region of the display you mark, to obtain a pixel distribution histogram. The cumulative integral is taken and scaled, and the result is applied to the current color table.

Usage

    HIST_EQUAL_CT[, image]

Input Parameters

image—(optional) The image whose histogram is to be used in determining the new color tables:

  • If image is supplied, it is assumed to be the image that was last loaded to the display.

  • If image is omitted, you are prompted to mark the diagonal corners of a region of the display with the mouse. The image must be a byte image, scaled the same way as the image loaded to the display.

Keywords

None.

Example

This is an example of how to obtain a pixel distribution histogram of a displayed image. It uses the aerial view of Boulder, Colorado in:

    (UNIX) <wavedir>/demo/gallery3/data

    (WIN) <wavedir>\demo\gallery3\data

Where <wavedir> is the main PV‑WAVE directory.

The result is applied to the current color table using the image parameter. Note that this example will only work if the original image contains values in the range of 0 to 255.

; Create a 512-by-512 byte array, get next free logical
; unit number (LUN), and open the file.
aerial_view = BYTARR(512,512)
GET_LUN, unit
OPENR, unit, 'aerial_demo.img'
; Read the data into the array aerial_view, close the file,
; and free the LUN.
READU, unit, aerial_view
CLOSE, unit
FREE_LUN, unit
; Open the window and display the image.
WINDOW, 1, XSize=512, YSize=512,  $
   title='Aerial View of Boulder, CO'
TVSCL, aerial_view
; Load the color table with a histogram-equalized distribution.
HIST_EQUAL_CT, aerial_view

See Also

HIST_EQUAL,  HISTOGRAM

For more information, see PV‑WAVE User Guide.