medianfilter: Median filter

silx.math.medianfilter.medfilt(data, kernel_size=3, bool conditional=False, mode='nearest')

Function computing the median filter of the given input. Behavior at boundaries: the algorithm is reducing the size of the window/kernel for pixels at boundaries (there is no mirroring).

Parameters:
  • data (numpy.ndarray) – the array for which we want to apply the median filter. Should be 1d or 2d.
  • kernel_size (For 1D should be an int for 2D should be a tuple or a list of (kernel_height, kernel_width)) – the dimension of the kernel.
  • conditional (bool) – True if we want to apply a conditional median filtering.
  • mode (str) – the algorithm used to determine how values at borders are determined.
Returns:

the array with the median value for each pixel.

silx.math.medianfilter.medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest')

Function computing the median filter of the given input. Behavior at boundaries: the algorithm is reducing the size of the window/kernel for pixels at boundaries (there is no mirroring).

Parameters:
  • data (numpy.ndarray) – the array for which we want to apply the median filter. Should be 1d.
  • kernel_size (int) – the dimension of the kernel.
  • conditional (bool) – True if we want to apply a conditional median filtering.
Returns:

the array with the median value for each pixel.

silx.math.medianfilter.medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest')

Function computing the median filter of the given input. Behavior at boundaries: the algorithm is reducing the size of the window/kernel for pixels at boundaries (there is no mirroring).

Parameters:
  • data (numpy.ndarray) – the array for which we want to apply the median filter. Should be 2d.
  • kernel_size (For 1D should be an int for 2D should be a tuple or a list of (kernel_height, kernel_width)) – the dimension of the kernel.
  • conditional (bool) – True if we want to apply a conditional median filtering.
Returns:

the array with the median value for each pixel.