📄 m_connect.m
字号:
function [out] = m_connect(in);
% apply m_connectivity to the one pixel wide image
% 2/12
[w,h] = size(in);
out=in;
for i=3:h-2
for j = 3:w-2
if out(i,j) == 1 & out(i+1,j+1) == 1
out(i+1,j) = 0;
out(i,j+1) = 0;
end;
if out(i,j) == 1 & out(i-1,j+1) == 1
out(i,j+1) = 0;
out(i-1,j) = 0;
end;
end;
end;
imagesc(out);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -