How we can measure salt and pepper noise in image

Answers (1)

You can count the number of times you find salt and find pepper, and give an area fraction. See attached.

5 Comments

After apply medfilt3, we remove salt and.pepper noise so how we find out how many salt and pepper are remaining in the image which filter by median filter. Can we find the result in percentage
With my code, it should be zero. There should be no salt or pepper noise left. How could there be? There might be large regions of 0s or 255s left, but since they'd be large, then would be considered part of the scene, not noise.
> I = imread('F:\Gayatri\im1.jpg'); >> imshow(I); >> title('Original Scan document image'); >> b=imnoise(I,'salt & pepper',0.02); >> imshow(b); >> title('Salt & Pepper Noise in Scan document image'); >> c=medfilt2(b); >> imshow(c); >> title('Remove Salt & Pepper noise using median filter From Scan image'); >> cmax=nlfilter(b,[3 3],'max(x(:))'); >> title('Apply max filter after adding Salt & Pepper noise in Document image'); >> cmin=nlfilter(b,[3 3],'min(x(:))'); >> imshow(cmin); >> title('Apply min filter after adding Salt & Pepper noise in Document image'); >> d=wiener2(b); >> imshow(d); >> title('Apply Wiener filter after adding Salt & Pepper noise in Document image');
if we use this code so how we can find salt and pepper noise?
My code showed you how to find salt and pepper noise. A wiener filter cannot find the noise.
A local min or max filter can be done with imregionalmin() or imregionalmax() rather than nlfilter().

Sign in to comment.

Asked:

on 13 Oct 2017

Commented:

on 14 Oct 2017

Community Treasure Hunt

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

Start Hunting!