Dealing with salt&pepper and speckle noises

1 view (last 30 days)
Hello, I have to add speckle and salt&pepper noises to my image. I know that medfilt2 filter is good when you're dealing with salt&pepper, but what about speckle noise? My grade is based on how low "sse" will be, and it is still pretty high :/
if true
img = imread('liftingbody.png');
img = double(img)/255;
multinoise = imnoise(img, 'speckle', 0.1);
noised = imnoise(multinoise, 'salt & pepper');
result = wiener2(noised,[3,3]);
result = wiener2(result,[3,3]);
result = medfilt2(result, [3,3],'symmetric');
mask = ones(3)/9;
for k=1:50
result = imfilter(result,mask,'replicate');
end
mask1 = [-1 -1 -1 ; -1 9 -1; -1 -1 -1];
for k=1:6
result = imfilter(result, mask1, 'replicate');
end
sse = sqrt(sum(sum((img-result).^2)));
figure;
subplot(131); imshow(img); title('Oryginalny');
subplot(132); imshow(noised); title('Zaszumiony');
subplot(133); imshow(result); title('Przefiltrowany');
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!