This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/DIPCV/lab3/lab4_4.m

23 lines
544 B
Mathematica
Raw Normal View History

2022-11-21 03:42:00 +00:00
close all
clear
clc
disp('====E4_7_5.m====');
I=imread('eight.tif');
subplot(2,3,1),imshow(I),xlabel('(a)ԭʼͼ<EFBFBD><EFBFBD>');
J=imnoise(I,'salt & pepper',0.4); % <EFBFBD><EFBFBD><EFBFBD><EFBFBD>1
subplot(2,3,2),imshow(J),xlabel('(b)<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD>');
K1=wiener2(J,[3,3]);
subplot(2,3,3),imshow(uint8(K1)),xlabel('(c)3*3Wiener<EFBFBD>˲<EFBFBD>');
K2=wiener2(J,[5,5]);
subplot(2,3,4),imshow(uint8(K2)),xlabel('(d)5*5Wiener<EFBFBD>˲<EFBFBD>');
K3=wiener2(J,[7,7]);
subplot(2,3,5),imshow(uint8(K3)),xlabel('(e)7*7Wiener<EFBFBD>˲<EFBFBD>');
K4=wiener2(J,[9,9]);
subplot(2,3,6),imshow(uint8(K4)),xlabel('(f)9*9Wiener<EFBFBD>˲<EFBFBD>');