Pruning

Pruning[image]
removes the outermost branches of thin objects in image by setting their values to black.

Pruning[image, n]
removes branches that are at most n pixels long.

Pruning[image, {n}]
removes n pixels from each branch.

Pruning[image, n, t]
treats values above t as foreground.

Details and OptionsDetails and Options

  • Morphological pruning is typically applied after morphological thinning.
  • Pruning works with binary, grayscale, and multichannel images, as well as real matrices.
  • Pruning takes a Padding option that specifies the values to assume for pixels outside the image. The default setting is Padding->0.

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Prune the outermost branches:

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

Prune branches that are no longer than 60 pixels:

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

Prune 60 pixels from branches:

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

Prune all branches:

In[1]:=
Click for copyable input
Out[1]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »