Salt and pepper noise removal

6 visualizzazioni (ultimi 30 giorni)
Luca Pecoriello
Luca Pecoriello il 11 Dic 2019
Risposto: Gayathri il 3 Gen 2025
Hi
I have a set of thermographic data in the form of pixel-pixel-time (third order tensor). At some point, I want to remove the salt and pepper noise from the data. So I am planning to a median filter, in particular I want to use the command
medfilt2
J = medfilt2(I,[m n]) performs median filtering, where each output pixel contains the median value in the m-by-n neighborhood around the corresponding pixel in the input image.
What could be standard criteria to define the size m and n?
I am working with black and white (grayscale) images (which are my thermal images).
From other analysis I know the size (in pixels) of an area where I could expect a possible defect. Maybe this sizes could become my m and n?
Greetings
Luca

Risposte (1)

Gayathri
Gayathri il 3 Gen 2025
I understand that you need to know how to select the values of hyperparameters, "m" and "n", while performing median filtering. These values are typically chosen through a process of trial and error. Some points to keep in mind while deciding the values would be
  • Consider the level of detail in your images. Larger filter sizes can smooth out noise but may also blur important features. Balancing noise reduction and detail preservation is key.
  • Ideally, the filter size should be smaller than the features you want to preserve to avoid altering them.
  • Start with a small filter size, such as '3x3' or '5x5' and gradually increase until you achieve a satisfactory balance between noise reduction and detail preservation.
Hope this helps!

Prodotti


Release

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by