24 lines
871 B
Matlab
24 lines
871 B
Matlab
close all
|
|
clear
|
|
clc
|
|
disp('====E4_8_1.m====');
|
|
|
|
I1=[0 0 0 240 80 100 240 0 0 0]
|
|
uint8I1=uint8(I1);
|
|
subplot(2,4,1),imshow(uint8I1),xlabel('(a-1)噪声图像(l=4)');
|
|
subplot(2,4,2),plot(I1,'.-'),axis([0 11 0 250]),xlabel('(a-2)噪声图像的灰度值序列');
|
|
|
|
J1=medfilt2(uint8I1,[1,3]) % 语句1
|
|
uint8J1=uint8(J1);
|
|
subplot(2,4,3),imshow(uint8J1),xlabel('(b-1)1-D中值滤波图像(r=3)');
|
|
subplot(2,4,4),plot(J1,'.-'),axis([0 11 0 250]),xlabel('(b-2)1-D中值滤波图像灰度值序列');
|
|
|
|
J2=medfilt2(uint8I1,[1,9])
|
|
uint8J2=uint8(J2);
|
|
subplot(2,4,5),imshow(uint8J2),xlabel('(c-1)1-D中值滤波图像(r=4)');
|
|
subplot(2,4,6),plot(J2,'.-'),axis([0 11 0 250]),xlabel('(c-2)1-D中值滤波图像灰度值序列');
|
|
|
|
J3=medfilt2(uint8I1,[1,11])
|
|
uint8J3=uint8(J3);
|
|
subplot(2,4,7),imshow(uint8J3),xlabel('(d-1)1-D中值滤波图像(r=5)');
|
|
subplot(2,4,8),plot(J3,'.-'),axis([0 11 0 250]),xlabel('(d-2)1-D中值滤波图像灰度值序列');
|