LocalDensityMap2d
Measures the local density of a two-dimensional binary image within a binary mask.
Access to parameter description
This algorithm computes the density using a region formed by the intersection of a mask image and a user-defined kernel.
Access to parameter description
This algorithm computes the density using a region formed by the intersection of a mask image and a user-defined kernel.
- Pixels are assigned the percentage of pixels with a value of 1 inside this region. These values are expressed in the interval [0, 100].
- Pixels outside of the mask are assigned the value -1.
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > localDensityMap2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > inputMaskImage, iolink::Vector2i32 kernelSize, std::shared_ptr< iolink::ImageView > outputImage = NULL );
Class Syntax
Parameters
Class Name | LocalDensityMap2d |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputBinaryImage |
The input binary image. | Image | Binary | nullptr |
![]() |
inputMaskImage |
The binary mask image. This image must have same dimensions and type as the main input image. | Image | Binary | nullptr |
![]() |
kernelSize |
The side size in pixels of the square kernel. | Vector2i32 | >0 | {3, 3} |
![]() |
outputImage |
The output image. Its dimensions are forced to the same values as the input. Its data type is forced to floating point. | Image | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); LocalDensityMap2d localDensityMap2dAlgo; localDensityMap2dAlgo.setInputBinaryImage( polystyrene_sep ); localDensityMap2dAlgo.setInputMaskImage( polystyrene_sep ); localDensityMap2dAlgo.setKernelSize( {3, 3} ); localDensityMap2dAlgo.execute(); std::cout << "outputImage:" << localDensityMap2dAlgo.outputImage()->toString();
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = localDensityMap2d( polystyrene_sep, polystyrene_sep, {3, 3} ); std::cout << "outputImage:" << result->toString();