Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

:EQUALIZE-HISTOGRAM

source files: xheq.[ch]

SYNTAX

(require "xg.3d.imageops-xheq")
(send <grl> :EQUALIZE-HISTOGRAM [ :ADD-NOISE ] )

DESCRIPTION

As usual, <grl> should have two-dimensional CLASS-UNIT-FLOAT-ARRAY arrays :PIXEL-RED, :PIXEL-GREEN and :PIXEL-BLUE, holding an image.

This call enhances the human-visible contrast in am image by trying attempting to make all brightness values equally common in the image.

The call functions by internally constructing a histogram giving the number of times each of the 256 possible brightness values appears in the image, constructing a lookup table mapping each old brightness value to a new brightness value in such a way as to make the new brightness histogram as flat as possible, and then remapping all pixels in the image.

If the :ADD-NOISE keyword is specified, a small random offset is added to output pixel brightnesses to reduce colorbanding. Another, perhaps better, way of reducing colorbanding is to use :RESIZE-IMAGE to blur the image resulting from :EQUALIZE-HISTOGRAM.


Go to the first, previous, next, last section, table of contents.