AdaptiveThresholding3d
Performs a binarization of a grayscale image based on the mean intensity of a sliding window centered around each voxel.
Access to parameter description
Each voxel value I is compared to the mean intensity μ(I) of its local window.
The corresponding voxel in the binary output depends on a threshold value, an arithmetic mode, and a comparison criterion.
See also
Access to parameter description
Each voxel value I is compared to the mean intensity μ(I) of its local window.
The corresponding voxel in the binary output depends on a threshold value, an arithmetic mode, and a comparison criterion.
- In additive mode, with comparison criterion set to GREATER_OR_EQUAL, the output is set to 1 if I≥threshold+μ(I).
- In multiplicative mode, with comparison criterion set to GREATER_OR_EQUAL, the output is set to 1 if I≥threshold×μ(I).
See also
Function Syntax
This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > adaptiveThresholding3d( std::shared_ptr< iolink::ImageView > inputImage, int32_t kernelRadiusX, int32_t kernelRadiusY, int32_t kernelRadiusZ, double threshold, AdaptiveThresholding3d::ComparisonCriterion comparisonCriterion, AdaptiveThresholding3d::ThresholdMode thresholdMode, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input image. Its type can be integer or float. | Image | Grayscale | nullptr | ||||
![]() |
kernelRadiusX |
The half horizontal size of the kernel size in pixels. A cube structuring element always has an odd side length (3x3x3, 5x5x5, etc.) which is defined by twice the kernel radius + 1. | Int32 | >=1 | 30 | ||||
![]() |
kernelRadiusY |
The half vertical size of the kernel size in pixels. A cube structuring element always has an odd side length (3x3x3, 5x5x5, etc.) which is defined by twice the kernel radius + 1. | Int32 | >=1 | 30 | ||||
![]() |
kernelRadiusZ |
The half depth size of the kernel size in pixels. A cube structuring element always has an odd side length (3x3x3, 5x5x5, etc.) which is defined by twice the kernel radius + 1. | Int32 | >=1 | 30 | ||||
![]() |
threshold |
The fraction or the additive thresholding value, according to the thresholdMode parameter value. | Float64 | Any value | 1 | ||||
![]() |
comparisonCriterion |
The comparison test to perform between image and value.
|
Enumeration | GREATER_OR_EQUAL | |||||
![]() |
thresholdMode |
The local thresholding mode.
|
Enumeration | MULTIPLICATIVE | |||||
![]() |
outputBinaryImage |
The output binary image. Its dimensions are forced to the same values as the input. | Image | nullptr |
Object Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); AdaptiveThresholding3d adaptiveThresholding3dAlgo; adaptiveThresholding3dAlgo.setInputImage( foam ); adaptiveThresholding3dAlgo.setKernelRadiusX( 30 ); adaptiveThresholding3dAlgo.setKernelRadiusY( 30 ); adaptiveThresholding3dAlgo.setKernelRadiusZ( 30 ); adaptiveThresholding3dAlgo.setThreshold( 1.0 ); adaptiveThresholding3dAlgo.setComparisonCriterion( AdaptiveThresholding3d::ComparisonCriterion::GREATER_OR_EQUAL ); adaptiveThresholding3dAlgo.setThresholdMode( AdaptiveThresholding3d::ThresholdMode::MULTIPLICATIVE ); adaptiveThresholding3dAlgo.execute(); std::cout << "outputBinaryImage:" << adaptiveThresholding3dAlgo.outputBinaryImage()->toString();
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = adaptiveThresholding3d( foam, 30, 30, 30, 1.0, AdaptiveThresholding3d::ComparisonCriterion::GREATER_OR_EQUAL, AdaptiveThresholding3d::ThresholdMode::MULTIPLICATIVE ); std::cout << "outputBinaryImage:" << result->toString();