ThresholdingByCriterion
Performs a criterion based thresholding on a grayscale image.
Access to parameter description
For an introduction:
See also
See related examples
Access to parameter description
For an introduction:
- section Image Segmentation
- section Binarization
See also
See related examples
Function Syntax
This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > thresholdingByCriterion( std::shared_ptr< iolink::ImageView > inputGrayImage, ThresholdingByCriterion::ComparisonCriterion comparisonCriterion, double comparisonValue, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
inputGrayImage |
Input gray level image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||||||||||
![]() |
comparisonCriterion |
The criterion of comparison.
|
Enumeration | GREATER_THAN_OR_EQUAL_TO | |||||||||||||
![]() |
comparisonValue |
The threshold level. | Float64 | Any value | 128 | ||||||||||||
![]() |
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" ); ThresholdingByCriterion thresholdingByCriterionAlgo; thresholdingByCriterionAlgo.setInputGrayImage( foam ); thresholdingByCriterionAlgo.setComparisonCriterion( ThresholdingByCriterion::ComparisonCriterion::NOT_EQUAL_TO ); thresholdingByCriterionAlgo.setComparisonValue( 0.0 ); thresholdingByCriterionAlgo.execute(); std::cout << "outputBinaryImage:" << thresholdingByCriterionAlgo.outputBinaryImage()->toString();
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = thresholdingByCriterion( foam, ThresholdingByCriterion::ComparisonCriterion::NOT_EQUAL_TO, 0.0 ); std::cout << "outputBinaryImage:" << result->toString();