Linear Filtering

Linear Filtering

Applies a linear filter to images. Linear filters can be used to smooth images, enhance edges, reduce noise etc.

Inputs

image
Input image.
filterType
The type of the filter.
filterSize
The size of the filter in pixels, if applicable. If you need to scale the filter according to the world coordinate system, the filter needs to be calculated separately and connected to the filter input.
filter
Filter matrix.
borderHandling
Speficies the way borders are handled.

Outputs

image
Filtered output image. If the input image is an RGB image, the output will also be RGB, and overflows and underflows will be truncated. If the input is 8-bit gray, the output is either 8-bit or 16-bit depending on the filter: if the filter is such that it cannot cause overflows or underflows, the output will be 8-bit. If the input is a signed image type, the output will be the same type. No overflow or underflow prevention will be applied.

Border handling techniques.

Enumerator
Zeros 

Assume zeros outside of image.

Replicate 

Replicate the pixel closest to border.

Reflect 

Assume the image is symmetrical about its edge.

Periodic 

Assume the image repeats itself so that it could be seamlessly tiled.

Supported filter types.

Enumerator
Custom 

User-defined filter.

SobelX 

Sobel edge detector, horizontal component.

SobelY 

Sobel edge detector, vertical component.

PrewittX 

Prewitt edge detector, horizontal component.

PrewittY 

Prewitt edge detector, vertical component.

RobertsX 

Roberts edge detector, horizontal component.

RobertsY 

Roberts edge detector, vertical component.

Uniform 

A block filter filled with a constant value.

Gaussian 

Gaussian smoothing function (2-D bell curve).

LaplacianOfGaussian 

Smoothed 2nd spatial derivative filter for edge detection.