📄 mystatistic.m
字号:
function pstatistic=mystatistic(pmat)
%顺序统计滤波,采用最小值滤波器
[row col]=size(pmat); %原始图像的大小
%对图像进行零填充
pfilled=zeros(row+2,col+2);
pfilled(2:row+1,2:col+1)=pmat;
%计算输出图像各点的灰度值
pstatistic=zeros(row,col);
for i=1:row
for j=1:col
array=[pfilled(i,j) pfilled(i,j+1) pfilled(i,j+2) pfilled(i+1,j) pfilled(i+1,j+1) pfilled(i+1,j+2) pfilled(i+2,j) pfilled(i+2,j+2) pfilled(i+2,j+2)];
pstatistic(i,j)=min(array);
end
end
pstatistic=uint8(pstatistic);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -