A filtro de mediana is a popular non-linear filtering technique often utilizada en procesamiento de imágenes and procesamiento de señales to reduce noise while preserving edges. The basic idea behind a median filter is to replace each pixel’s value in an image with the valor mediano of the pixel’s neighborhood. This makes it particularly effective for removing ‘salt and pepper’ noise, which consists of random occurrences of bright and dark pixels.
Al aplicar un filtro de mediana, un ventana deslizante or kernel moves across the image. For each position of the window, the algorithm collects the pixel values within that window and calculates their median. The median is the middle value when the numbers are sorted in order; for an even number of values, the median is the average of the two middle values. The center pixel of the window is then replaced with this median value.
One of the key advantages of median filtering over linear filters, such as Gaussian filters, is its ability to preserve edges in the image. Linear filters can blur edges, while median filters maintain them, making it valuable in applications where edge retention is important. However, median filters can be computationally more intensive, especially for large kernels, as sorting is required to find the median.
Median filters can operate in one or two dimensions and are widely implemented in various bibliotecas de software and image processing tools. They are commonly used in medical imaging, remote sensing, and any scenario where noise reduction is essential without significant loss of detail.