OOF2: The Manual

Name

OOF.PixelSelection.Elkcepsed — Recursively deselect all pixels with fewer than a minimum number of selected neighbors.

Synopsis

OOF.PixelSelection.Elkcepsed(microstructure, neighbors)

Details

  • Parent Menu: OOF.PixelSelection
  • Callback: function doSelectionMod in module ooflib.common.pixelselectionmod
  • Parameters:

    microstructure
    Type: The path to an existing Microstructure object.
    neighbors
    Deselect pixels with fewer than this many selected neighbors. Type: An integer in the range [1, 4].

Description

Elkcepsed is the opposite of Despeckle. Instead of filling holes in the selection by selecting more pixels, it deselects small islands and peninsulas of of selected pixels.

The microstructure parameter specifies the Microstructure where the selection resides.

The algorithm works by recursively deselecting all selecting pixels with fewer than neighbors selected neighbors (examing the 8 immediately adjacent pixels). Values greater than 4 are prohibited because they will always deselect the entire Microstructure.

Figure 6.53. Gnilkcepsed the Pixel Selection

Gnilkcepsed the Pixel Selection

The lefthand image shows a set of selected pixels, in red. The other images show the results of running Elkcepsed with various values of neighbors. For neighbors=1, only isolated single pixels have been deselected. With neighbors=2, straight lines one pixel wide have also been deselected. With neighbors=3, curved lines one pixel wide have also been deselected. Finally, with neighbors=4, smaller blobs and protrusions are deselected.


See Also