Previous Table of Contents Next


Unsharp Masking

Unsharp masking produces a contrast enhancement by first performing an image smoothing operation. Next it computes the pixel-by-pixel difference between the original image and the smoothed image, creating an image consisting primarily of high frequency components. Finally, it boosts the difference (multiplies by a constant) and adds the result to the original image pixel by pixel, producing the final image. Output varies depending on which image smoothing algorithm is used. The following 5x5 filter produces an unsharp mask image in a single pass:

–4/25 –4/25 –4/25 –4/25 –4/25
–4/25 –4/25 –4/25 –4/25 –4/25
–4/25 –4/25 121/25 –4/25 –4/25
–4/25 –4/25 –4/25 –4/25 –4/25
–4/25 –4/25 –4/25 –4/25 –4/25

Emphasizing Edges and Line Segments

Edge detection filters emphasize edge presence in a desired direction that varies depending on the spatial filter applied. Edge detection discards most image information, leaving only existing edges oriented in the selected direction dramatically highlighted.

Shift and Difference Edge Enhancement

Shift and difference edge enhancements are computationally simple, hence fast. Various 3x3 edge detection filters follow.

To emphasize vertical edges:

  0 –1   0
  0   1   0
  0   0   0

To detect horizontal edges:

  0   0   0
–1   1   0
  0   0   0

To emphasize 135º edges:

–1   0   0
  0   1   0
  0   0   0

To emphasize 45º edges:

  0   0 –1
  0   1   0
  0   0   0

Line Segment Detection

Filters that detect line segments are similar to shift and difference filters. Several examples follow.

To emphasize vertical line segments:

–1   2 –1
–1   2 –1
–1   2 –1

To emphasize horizontal line segments:

–1 –1 –1
  2   2   2
–1 –1 –1

To emphasize 45º line segments:

–1 –1   2
–1   2 –1
  2 –1 –1

To emphasize 135º line segments:

  2 –1 –1
–1   2 –1
–1 –1   2

Edge Detection Using Gradient Filters

Gradient filters provide intensive means to detect image edges with more refinement than shift and difference or line segment filters allow. The taps sum to zero.

North:

  1   1   1
  1 –2   1
–1 –1 –1

Northeast:

  1   1   1
–1 –2   1
–1 –1   1

East:

–1   1   1
–1 –2   1
–1   1   1

Southeast:

–1 –1   1
–1 –2   1
  1   1   1

South:

–1 –1 –1
  1 –2   1
  1   1   1

Southwest:

  1 –1 –1
  1 –2 –1
  1   1   1

West:

  1   1 –1
  1 –2 –1
  1   1 –1

Northwest:

  1   1   1
  1 –2 –1
  1 –1 –1


Previous Table of Contents Next