DATAMANIP commands


PROGRAM NAME

khistops - Perform Histogram Equalization and Stretching

DESCRIPTION

khistops is used to perform histogram equalization and stretching operations on object. In both cases, the idea is to spread out the histogram values to fully occupy the range of the data type to enhance detail that would be otherwise lost. The grey levels in the data can be optionally inverted after histogram processing (this is often helpful for astronomical data).

Histogram equalization employs a nonlinear mapping of input values to output values. The nonlinear mapping is a scaled integral of the histogram of the input data. Stretching employs a simple linear mapping. Equalization can make the data look visually harsh, but can bring out amazing detail in poor contrast data. Stretching can bring out some detail but preserves the relative brightness of the data. Both of these techniques are described in detail in texts on image processing.

If a mask is present with the input object, data points that are masked off are ignored in the histogramming. The mask is propagated to the output object.

If a map is present with the input object, all data will be pulled through the mask before histogramming. The output object will have no map.

For signed data types, the output will span the whole range of the data type, just as for the unsigned data types. Note that for signed types, this will include the negative part of the range. If this behavior is not desired, the data should be converted to unsigned prior to the application of .I khistops.

The data types that can be handled are currently limited to signed and unsigned byte, and signed and unsigned short integer. The number of bits in a data point is further limited by the internal algorithms to be at most 16, signed or unsigned. If an otherwise acceptable data type is found that exceeds 16 bits (say a 32 bit short) then an error message will be printed. Resolution of this problem is architecture dependent.

The histogram operations can be performed in units of data that can span any of the polymorphic data model dimensions. By default, the unit is composed of 2D planes across width and height (i.e. a normal "image"). It is possible to select processing in volumes, sequences, slices, rows, columns or the whole 5D data set if that is desired. Each unit is histogrammed independently of the others.

khistops supports processing of large data sets via data services. Data access speed is a function of the processing unit dimensions, so significant processing time variance can be observed for varying unit geometries even though the total number of points processed is the same.

REQUIRED ARGUMENTS

-i
type: infile
desc: Input data object
-o
type: outfile
desc: Resulting output data object

Mutually Exclusive Group; you must specify ONE of:

-equalize
type: flag
desc: perform histogram equalization
OR
-stretch
type: flag
desc: perform linear histogram stretch

Mutually Exclusive Group; you must specify ONE of:

-whole
type: flag
desc: process whole data set at one time
OR

AT LEAST ONE OF the Group:

-w
type: flag
desc: include width in processing unit
AND/OR
-h
type: flag
desc: include height in processing unit
AND/OR
-d
type: flag
desc: include depth in processing unit
AND/OR
-t
type: flag
desc: include time in processing unit
AND/OR
-e
type: flag
desc: include elements in processing unit

OPTIONAL ARGUMENTS

-invert
type: flag
desc: invert grey levels after processing

EXAMPLES

% khistops -i image:moon -o moon.heq -equalize -whole
will produce a histogram equalized rendition of the moon image.

SEE ALSO

khisto(1)

RESTRICTIONS

Only KBYTE, KUBYTE, KSHORT, and KUSHORT data is supported, and only then if they are 16 bits or less in length.

REFERENCES

R.C. Gonzalez and P.A. Wintz, "Digital Image Processing", Addison-Wesley, 1987, ISBN 0-201-11026-1.

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.