-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalgo.asv
More file actions
36 lines (29 loc) · 1018 Bytes
/
algo.asv
File metadata and controls
36 lines (29 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function x=algo(a)
I=imread(a);
I2=rgb2gray(I);
I3=imnoise(I2,'salt & pepper',0.01);
imshow(I3,[])
disp 'SNR with noisy image and original image'
peaksnr = psnr(I3,I2)
imwrite(I3,'noisyimage.jpg');
I4= nlfilter(I3,[5 5],@roughset);
imshow(I4,[])
imwrite(I4,'roughset_denoise.jpg');
disp 'SNR with denoised image and original image'
peaksnr = psnr(I4,I2)
I5=colfilt(I3,[5 5],'sliding',@mean);
disp 'SNR with denoised image using mean and original image'
I5=uint8(I5);
peaksnr = psnr(I5,I2)
imwrite(I5,'mean_denoise.jpg');
I6=colfilt(I3,[5 5],'sliding',@median);
disp 'SNR with denoised image using median and original image'
I6=uint8(I6);
peaksnr = psnr(I6,I2)
imwrite(I6,'median_denoise.jpg');
I7=colfilt(I3,[5 5],'sliding',@mode);
disp 'SNR with denoised image using mode and original image'
I7=uint8(I7);
peaksnr = psnr(I7,I2)
imwrite(I7,'mode_denoise.jpg');
x='Complete'