Previous Image Processing in IDL: Contrasting and Filtering Next

Overview of Contrasting and Filtering

Contrast within an image is based on the brightness or darkness of a pixel in relation to other pixels. Modifying the contrast among neighboring pixels can enhance the ability to extract information from the image. Operations such as noise removal and smoothing decrease contrast and make neighboring pixel values more similar. Other operations such as scaling pixel values, edge detection and sharpening increase contrast to highlight specific image features.

A simple way to modify contrast is to scale the pixel values within an image. Within IDL, the pixel values of displayed images typically range from 0 to 255. Byte-scaling changes the range of values within an image to a linear progression from a minimum of 0 to a maximum of 255. For images with pixel values exceeding 255, byte-scaling produces a more linear display with the minimum value as the darkest pixel and the maximum value as the brightest pixel. For images with a smaller range in pixel values, byte-scaling increases the contrast and brightens dark areas. See Byte-Scaling for more information on byte-scaling.

Contrast can also be increased to show more variations within uniform areas of the image using histogram equalization operations. These operations modify the distribution of pixel values within an image. See Working with Histograms for more information on using histograms to modify contrast.

Filters provide another means of changing contrast within an image. A filter is represented by a kernel, which is an array that is multiplied and added to each pixel (and its surrounding values) within an image. Examples of such filters include low pass, high pass, directional, and Laplacian filters. See Filtering an Image for more information on these filters. The following list introduces some of the specific operations covered in this section:

The following list introduces the image contrasting and filtering tasks and associated IDL image routines covered in this chapter.


Table 8-1: Image Contrasting and Filtering Tasks and Related Routines 

Table 8-1: Image Contrasting and Filtering Tasks and Related Routines 
Type of Contrasts or Filters
Byte-scale the data values of an image to produce a more continuous display or to increase its contrast.
Use histogram equalization to show minor variations in uniform areas.
Enhance contrast by applying some basic filters (low pass, high pass, directional, and Laplacian) to images.
Smooth high variations within an image.
Sharpen an image by decreasing too bright pixels and increasing too dark pixels.
Use the contrast within an image to detect the possible edges of shapes.
Remove noise from an image by either windowing or using an adaptive filter.

This chapter uses data files from the IDL examples/data directory. Two files, data.txt and index.txt, contain descriptions of the files, including array sizes.

  IDL Online Help (June 16, 2005)