gives the hit-and-miss transform of image with respect to the composite structuring element ker.


gives the union of the hit-and-miss transforms for all the structuring elements keri.


treats values above t as foreground.

Details and Options

  • HitMissTransform works with arbitrary 2D and 3D images.
  • The composite structuring element ker is a matrix containing (foreground), (background), and (don't care) elements.
  • The structuring element is automatically padded with zeros to have odd dimensions.
  • HitMissTransform takes a Padding option. The default setting is Padding->1.


Basic Examples  (4)

Find all foreground pixels that are below a background pixel:

Find bottom-right corners:

Find all corners by specifying four structuring elements:

Find the larger disks:

Find the larger balls:

Introduced in 2008
Updated in 2012