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

Perform bottom-hat filtering

Syntax

Description

IM2 = imbothat(IM,SE) performs morphological bottom-hat filtering on the grayscale or binary input image, IM, returning the filtered image, IM2. The argument SE is a structuring element returned by the strel function. SE must be a single structuring element object, not an array containing multiple structuring element objects.

IM2 = imbothat(IM,NHOOD) performs morphological bottom-hat filtering where NHOOD is an array of 0's and 1's that specifies the size and shape of the structuring element. This is equivalent to imbothat(IM,strel(NHOOD)).

Class Support

IM can be numeric or logical and must be nonsparse. The output image has the same class as the input image. If the input is binary (logical), then the structuring element must be flat.

Example

Top-hat filtering and bottom-hat filtering can be used together to enhance contrast in an image.

  1. Read the image into the MATLAB workspace.
  2. Create disk-shaped structuring element, needed for morphological processing.
  3. Add the original image I to the top-hat filtered image, and then subtract the bottom-hat filtered image.

See Also

imtophat, strel


Previous page  imattributes imclearborder Next page

© 1994-2005 The MathWorks, Inc.