# Salt and Pepper impulse Denoising opencv

I am creating a generic method to work on salt and pepper noise and variants. The example images are as shown below :

I tried few methods, such as

    Median filter from scipy
Selective Adaptive Median Filter by Jayanta Das et al.


The closest result was on Image 3, with Median filter, giving the closest result to the original image with no noise.

These are my following doubts :

1. Can we consider these noises as salt and pepper noise.? Is there something else that I am missing?
2. What could be the better suggested method? Currently, I am planning to implement Switching Median filter by Pei-Eng et al, but I would like to know if this could be the right track.

The originals that I am trying to get closer to:

• the joint "original" doesn't look like an original at all, but like something that already was strongly denoised using a non-selective median filter. Jan 18 '20 at 16:21
• Have you tried using a min filter and then a max filter in two consecutive steps? Jan 18 '20 at 19:06

Can we consider these noises as salt and pepper noise.? Is there something else that I am missing?

several pixels getting erased to either zero or one -> yeah, that fits my definition of salt and pepper noise. However, there might be other definitions around, including assumptions of noise autocorrelation, and whether or not your noise fulfills these is impossible to answer without knowing what definition you want to follow.

Anyway, yeah, let's call this salt and pepper, doesn't hurt anyone, does it?

What could be the better suggested method? Currently, I am planning to implement Switching Median filter by Pei-Eng et al, but I would like to know if this could be the right track.

I'd start by looking for pixels that are either exactly white or exactly black – those are your only candidates for noise pixels. Leave the rest alone.

Among these pixels, I'd look at the 8 neighbor pixels. If 3 or more of them are a similar intensity, keep the pixel. It's probably properly white or black.

For the other pixels, a good estimate is probably an average (instead of a median) of the 8 neighbors plus itself, weighing itself maybe a bit less. Generally, a continuation of the structure of the surroundings.

By the way, be careful not to be too smart – the observer of the denoised picture doesn't know you've denoised it, and wrong diagnoses based on overcorrected imagery are thoroughly possibly. (I've lost a bit of faith in the ability of different physicians to consistently diagnose based on the same MRI, but coming from a machine they don't know, after having done a signal processing project in medical diagnosis.)