OOF2: The Manual
Name
OOF.PixelSelection.Elkcepsed — Recursively deselect all pixels with fewer than a minimum number of selected neighbors. This has the effect of removing small islands and peninsulas, and is the opposite of 'Despeckle'.
Synopsis
OOF.PixelSelection.Elkcepsed(microstructure
,neighbors
)
Details
- Parent Menu: OOF.PixelSelection
-
Callback: function
doSelectionMod
in moduleooflib.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. Compare to Despeckle, which fills in small holes in the selection.
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. Values greater than 4 are prohibited because they will
always deselect the entire Microstructure
. For examples, see Figure 6.46.
Figure 6.46. Gnilkcepsed the Pixel Selection

A pixel selection (in red) containing some extra pixels to be trimmed with Elkcepsed.

The result of running Elkcepsed with
neighbors
=1. Only isolated single pixels have
been deselected.

The result of running Elkcepsed with
neighbors
=2. Isolated single pixels and
straight lines one pixel wide have been
deselected.

The result of running Elkcepsed with
neighbors
=3. Isolated single pixels and
curved lines one pixel wide have been
deselected.