TopHatTransform

TopHatTransform[image,ker]
gives the morphological top-hat transform of image with respect to structuring element ker.

TopHatTransform[image,r]
gives the top-hat transform with respect to a range-r square.

TopHatTransform[data,]
applies top-hat transform to an array of data.

DetailsDetails

  • TopHatTransform works with binary, grayscale, and other images.
  • TopHatTransform works with 3D as well as 2D images, and also with data arrays of any rank.
  • The structuring element ker is a matrix containing s and s.
  • TopHatTransform automatically pads structuring elements to have odd dimensions.
  • TopHatTransform[image,r] is equivalent to TopHatTransform[image,BoxMatrix[r]].
  • If multiple image channels are present, TopHatTransform operates on each of them separately.
  • TopHatTransform preserves regions smaller than the structuring element whose channel values are larger than their surroundings.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Extract thin lines from a multichannel image:

In[1]:=
Click for copyable input
Out[1]=

Remove disks larger than the structuring element:

In[1]:=
Click for copyable input
Out[1]=

Correct uneven illumination and remove the large feature:

In[1]:=
Click for copyable input
Out[1]=

Extract small, bright regions from a color image:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2008
(7.0)
| Updated in 2012
(9.0)