RemoveSmallSpots
Removes the smallest objects of a binary image.
Access to parameter description
This algorithm removes spots smaller than a user-defined size in a binary image.
The objectSize parameter indicates the maximum size, in pixels, of the spots to be removed.
In order to remove the small spots, this algorithm amounts to filtering the image with:
Access to parameter description
This algorithm removes spots smaller than a user-defined size in a binary image.
The objectSize parameter indicates the maximum size, in pixels, of the spots to be removed.
In order to remove the small spots, this algorithm amounts to filtering the image with:
- The Area measurement for 2D images
- The Volume3d measurement for 3D images
Function Syntax
This function returns outputObjectImage.
// Function prototype
std::shared_ptr< iolink::ImageView > removeSmallSpots( std::shared_ptr< iolink::ImageView > inputObjectImage, double objectSize, std::shared_ptr< iolink::ImageView > outputObjectImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputObjectImage |
The input binary or label image. | Image | Binary or Label | nullptr |
![]() |
objectSize |
The maximum size, in pixels, of objects to remove. | Float64 | >0 | 10 |
![]() |
outputObjectImage |
The output binary or label image. Its dimensions and type are forced to the same values as the input. | Image | nullptr |
Object Examples
auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" ); RemoveSmallSpots removeSmallSpotsAlgo; removeSmallSpotsAlgo.setInputObjectImage( foam_sep ); removeSmallSpotsAlgo.setObjectSize( 10.0 ); removeSmallSpotsAlgo.execute(); std::cout << "outputObjectImage:" << removeSmallSpotsAlgo.outputObjectImage()->toString();
Function Examples
auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" ); auto result = removeSmallSpots( foam_sep, 10.0 ); std::cout << "outputObjectImage:" << result->toString();