PSNR CALCULATING MEDIAN FILTER GAUSSIAN FİLTER
Show older comments
I am adding salt and pepper noise to original image.
and then I am filtering this noise with median filter and gaussian filter.
I want to get psnr values of median filter and gaussian filter effect on this salt and pepper noise and then compare this two filter which one have high ratio.
But I don't know which code is true for calculating.
My code is below.
img=imread('image.jpg');
if(size(img,3)>1)
img=rgb2gray(img);
end
SP=imnoise(img,'salt & pepper',0.1);
MDO = medfilt2(img);
MDSP = medfilt2(SP);
GO = imgaussfilt(img);
GSP = imgaussfilt(SP);
% 1) psnrMDSP = psnr(SP,MDO);
% 1) psnrGSP = psnr(SP,GO);
% 2) psnrMDSP = psnr(SP,MDSP);
% 2) psnrGSP = psnr(SP,GSP);
% Which number calculating is true 1 or 2 ?
% my aim is to get which filter is successful psnr values on this salt and pepper noise.
Accepted Answer
More Answers (0)
Categories
Find more on Image Category Classification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!