Is there any algorithm for identifying the noise in an image I have to identify whether the noise present in a mammogram image is guassian or salt& pepper.


Exploit the fact that salt&pepper noise has only 2 values and median filter does excellent job in getting rid of it.

  • Filter your image with median filter
  • Find pixels where median filter did most of its job
  • Plot histogram of those pixels
  • Compute fraction of 0s and 1s

    threshold = 0.2; % adjust to perform best on your images
    im = imread('../lena.bmp');
    imd = double(im);
    imd = imd./max(max(imd));
    imdg = imnoise(imd,'gaussian');
    imdsp = imnoise(imd,'salt & pepper');
    subplot(2,2,1), imshow(imdg)
    subplot(2,2,2), imshow(imdsp)
    imdgf = medfilt2(imdg);
    imdspf = medfilt2(imdsp);
    g = imdg.-imdgf;
    sp = imdsp.-imdspf;
    gm = abs(g)>threshold;
    spm = abs(sp)>threshold;
    subplot(2,2,3), hist(imdg(gm))
    subplot(2,2,4), hist(imdsp(spm))



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.