This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Pruning

Pruning[image]
removes the outermost branches of thin objects in image by setting their values to black.
Pruning
removes branches that are at most n pixels long.
Pruning
removes n pixels from each branch.
Pruning
treats values above t as foreground.
  • 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.
Prune the outermost branches:
Prune branches that are no longer than 60 pixels:
Prune 60 pixels from branches:
Prune all branches:
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]=
Morphological pruning can be applied to raw data:
Count the legs of a centipede:
Find the loops of a graph:
Iteratively prune an image:
Solve a maze puzzle by thinning all paths and pruning dead ends:
New in 8