Image Processing Toolbox User's Guide Previous page   Next Page
imcontrast

Adjust contrast tool

Syntax

Description

imcontrast creates an Adjust Contrast tool associated with the intensity image in the current figure, called the target image. If the figure contains multiple images, the target image is the first intensity image in the figure (last created). imcontrast creates the tool in a separate figure window.

The Adjust Contrast tool is an interactive contrast and brightness adjustment tool. When an image contains more gray values than can be displayed at one time, you can use this tool to choose which values to display. For images with limited contrast, you can use this tool to stretch the image histogram to fill the dynamic range.

imcontrast(h) creates the Adjust Contrast tool associated with the image specified by the handle h. h can be a handle to a figure, axes, uipanel, or image object. If h is a handle to a figure or axes, imcontrast associates the tool with the first image found in the first figure or axes.

h=imcontrast(...) returns a handle to the Adjust Contrast tool figure.

When there are more possible gray values in the image than can be displayed at one time, this tool helps you interactively pick which values to display. For images with limited contrast this tool also helps you stretch the image histogram to fill the dynamic range.

Remarks

The Adjust Contrast tool presents a scaled histogram of pixel values (overly represented pixel values are truncated for clarity). Dragging on the left red bar in the histogram display changes the minimum value. The minimum value (and any value less than the minimum) displays as black. Dragging on the right red bar in the histogram changes the maximum value. The maximum value (and any value greater than the maximum) displays as white. Values in between the red bars display as intermediate shades of gray.

Together the minimum and maximum values create a "window". Stretching the window reduces contrast. Shrinking the window increases contrast. Changing the center of the window changes the brightness of the image. It is possible to manually enter the minimum, maximum, width, and center values for the window. Changing one value automatically updates the other values and the image.

Window/Level Interactivity

Clicking and dragging the mouse within the target image interactively changes the image's window values. Dragging the mouse horizontally from left to right changes the window width (i.e., contrast). Dragging the mouse vertically up and down changes the window center (i.e., brightness). Holding down the CTRL key when clicking accelerates changes. Holding down the SHIFT key slows the rate of change. Keys must be pressed before clicking and dragging.

Example

See Also

imadjust, imtool, stretchlim


Previous page  imcontour imcrop Next page

© 1994-2005 The MathWorks, Inc.