SoTopHatProcessing image filter More...
#include <ImageViz/Engines/ImageSegmentation/Binarization/SoTopHatProcessing.h>
Public Types | |
enum | ElementShape { ROUGH = 0, SMOOTH = 1 } |
enum | ObjectLightness { BRIGHT_OBJECTS = 0, DARK_OBJECTS = 1 } |
Public Member Functions | |
SoTopHatProcessing () | |
Public Attributes | |
SoSFEnum | computeMode |
SoSFEnum | elementShape |
SoSFImageDataAdapter | inGrayImage |
SoSFInt32 | elementSize |
SoSFEnum | objectLightness |
SoSFVec2f | thresholdLevel |
SoImageVizEngineOutput < SoSFImageDataAdapter, SoImageDataAdapter * > | outBinaryImage |
The SoTopHatProcessing engine performs a Top-Hat algorithm on a gray level image.
The Top-Hat segmentation extracts small elements and details from given images. It detects the dark or the bright area, corresponding to the valleys or the narrow peaks. There exist two types of Top-Hat transform:
Figure 1: Black Top-Hat computation
The Top-Hat module is divided into two phases:
The SoTopHatProcessing engine also includes a rough and a smooth mode. Whereas the rough mode uses a standard structuring element, the smooth mode employs a more sophisticated volumic structuring element, a rhombodecahedron, which usually generates a much more precise Top-Hat.
computeMode | MODE_AUTO |
elementShape | ROUGH |
inGrayImage | NULL |
elementSize | 3 |
objectLightness | BRIGHT_OBJECTS |
thresholdLevel | 128.0f 255.0f |
BRIGHT_OBJECTS |
The engine applies a white Top-Hat and detects small bright area. |
DARK_OBJECTS |
The engine applies a black Top-Hat and detects small dark area. SEE ALSOSoOpeningCubeProcessing, SoClosingCubeProcessing, SoThresholdingProcessing. |
SoTopHatProcessing::SoTopHatProcessing | ( | ) |
Constructor.
Select the compute Mode (2D or 3D or AUTO) Use enum ComputeMode.
Default is MODE_AUTO
Select the type of structuring element shape.
Use enum ElementShape. Default is ROUGH
The half size of the structuring element.
A structuring element always has an odd side length (3x3, 5x5, etc) which is defined by 2 * elementSize + 1. Default value is 3.
Input grey level image.
Default value is NULL. Supported types include: grayscale binary label image.
Select the lightness mode for object to detect.
Use enum ObjectLightness. Default is BRIGHT_OBJECTS
The output binary image.
Default value is NULL. Supported types include: binary image.
The low and high threshold levels.
Default value is SbVec2f(128.0f,255.0f).