adjascence.m
来自「Fusion algorithm example to split a pict」· M 代码 · 共 14 行
M
14 行
function matAdj=adjascence(labels)
taille=size(labels(:,:));
matAdj = zeros(max(max(labels)),max(max(labels)));
for i=1:taille(1)-1,
for j=1:taille(2)-1,
if(labels(i,j) ~= labels(i,j+1))
matAdj(labels(i,j),labels(i,j+1))=1;
end
if(labels(i,j) ~= labels(i+1,j))
matAdj(labels(i,j),labels(i+1,j))=1;
end
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?