Need help or advice ? Come to the Icy club ! - Every other Thursday morning from 9h30 to 12h30 - Francois Jacob Building - Main hall - Pasteur

User reviews

5 star
4 star
3 star
2 star
1 star
average rating: 4

Please log-in to post a review
Yoann Le Montagner
06 Mar 2013 17:27

Filter Toolbox

by Alexandre Dufour

Provides a selection of spatial, separable and customizable filters in 1D and 2D, with OpenCL implementation if supported.

Publication Id
See technical details
View complete changelog


Filtering is one of the most classical operation in image processing, and consists in adjusting (or replacing) pixel values depending on other pixel values in their local neighborhood. This can be used for instance to reduce image noise or enhance specific structures of interest.

This toolbox lets you apply a large range of filters on your image or sequence. The calculations run in multiple threads to maximize computation speed, and will also run on GPU on supported workstations and laptops via the OpenCL library. The filters are split in the following 3 categories:

Classic 2D filters

These filters are applied by classical 2D convolution operation, i.e., for each pixel, a 2D neighborhood is computed and convolved with the chosen 2D filter via point-wise multiplication, followed by a final sum (and normalization if applicable) to compute the resulting pixel value. This process may be slow for large kernels, however computations are greatly accelerated thanks to the built-in OpenCL (GPU) capabilities. Here is a list of available filters:

  • Laplace
  • Prewitt (along X and Y)
  • Sobel (along X and Y)
  • Kirsch (along the 8 common directions)
  • Gabor
  • Custom (values can be manually set)
  • From a template sequence (useful for filters imported from e.g. other software)

Separable and 1D filters

1D filters are a particular case of the previous 2D filters, in the sense that they are defined by a single line of values and therefore can be convolved along one specific direction of space (X, Y or Z). Separable filters are a special optimized construction of 2D (actually nD) filters which can be applied by convolving the input with a 1D filter along each image dimension sequentially. The outcome is a much higher computational efficiency, since 1D convolution is faster to compute. Note however that not all 1D filters have the separability property, and not all nD filters can be split into a separable convolution. Here is a list of available filters:

  • Gradient (this is not a separable operation, i.e. a different result is created for each selected direction)
  • Gaussian (this is a separable operation)
  • Custom (with user defined values, and an option to indicate if the filter is a separable one)

Selection filters

These filters are particular in the sense that they generally cannot be applied via a mathematical convolution. Their goal is to replace the current pixel value by computing various statistics from the local neighborhood. Here is a list of available filters:

  • Maximum: replaces each pixel by the maximum value in its neighborhood
  • Local maxima: replaces each pixel by 1 if it is a maximum value in its neighborhood, and 0 otherwise (the output is binary)
  • Mean: replaces each pixel by the average value in its neighborhood
  • Median: replaces each pixel by the median value in its neighborhood
  • Remove outliers: if a pixel is more than 2 standard deviations away from the neighborhood's mean, it is replaced by the mean of the neighborhood without the current value, considered as an outlier according to Chauvenet's rule.
  • Standard deviation: replaces each pixel by the standard deviation of its neighborhood
  • Variance: replaces each pixel by the variance of its neighborhood