FloodFillSegmentation This example demonstrates how to use the
SoFloodFillThresholdProcessing to create a binary image.
DESCRIPTION:
This example shows how to create a binary image from an input grayscale image performing a region growing from a seed point. The center of the image, that belongs to the dark shape to detect, is taken as the seed point. The input image is shown with the boundaries of the resulting thresholded image as overlay.
-
The input grayscale image is loaded in an SoImageDataAdapter object.
-
A binary image is generated as output of the SoFloodFillThresholdProcessing engine.
-
The boundaries of the binary image are extracted with the SoObjectBoundariesProcessing engine for a display without hiding inside the object.
-
A scene graph is built to display the raw image in a viewer with the binary boundary image as overlay.
NOTE:
-
Contrary to the classic thresholding the small artefacts are not retained here in the output image. Only the pixels connected to the seed point are kept.
-
This engine can be used to make a magic wand tool. For this it would be useful to catch a seed pointed by the user as explained in the marker picking example.
SEE ALSO
SoFloodFillThresholdProcessing, SoObjectBoundariesProcessing
SCREENSHOT:
FILES:
-
ImageViz/GettingStarted/02.2.FloodFillSegmentation.cxx