ExponentialFilter2d
Smooths an image using a kernel based on an exponential distribution.
Access to parameter description
This algorithm performs a 2D smoothing filter whose impulse response is an exponential function. f(x,y)=e−αx2e−αy2 Where:
The filtered image can be normalized by dividing the output gray levels by the sum of absolute values of the kernel coefficients. If not, overflows might occur.
See also
Access to parameter description
This algorithm performs a 2D smoothing filter whose impulse response is an exponential function. f(x,y)=e−αx2e−αy2 Where:
- x and y represent the offsets from the pixel to process.
- α is a sharpness factor. Low values produce high level of smoothing.
The filtered image can be normalized by dividing the output gray levels by the sum of absolute values of the kernel coefficients. If not, overflows might occur.
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > exponentialFilter2d( std::shared_ptr< iolink::ImageView > inputImage, double alphaFactor, iolink::Vector2i32 kernelSize, ExponentialFilter2d::AutoScale autoScale, std::shared_ptr< iolink::ImageView > outputImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||
![]() |
alphaFactor |
The alpha factor. The lower this value, the smoother the result. This value must be greater than 0. Practically, this filter response is a mostly visible in the [0.3, 5.3] range. | Float64 | >0 | 0.125 | ||||
![]() |
kernelSize |
The size of the kernel. | Vector2i32 | >0 | {9, 9} | ||||
![]() |
autoScale |
The automatic intensity scaling mode.
|
Enumeration | YES | |||||
![]() |
outputImage |
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted to avoid overflows in the non-normalized mode. | Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); ExponentialFilter2d exponentialFilter2dAlgo; exponentialFilter2dAlgo.setInputImage( polystyrene ); exponentialFilter2dAlgo.setAlphaFactor( 0.125 ); exponentialFilter2dAlgo.setKernelSize( {9, 9} ); exponentialFilter2dAlgo.setAutoScale( ExponentialFilter2d::AutoScale::YES ); exponentialFilter2dAlgo.execute(); std::cout << "outputImage:" << exponentialFilter2dAlgo.outputImage()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = exponentialFilter2d( polystyrene, 0.125, {9, 9}, ExponentialFilter2d::AutoScale::YES ); std::cout << "outputImage:" << result->toString();