tuxbjie4.m
来自「包括MATLAB7.0实用指南(下)中所有例子的源代码」· M 代码 · 共 19 行
M
19 行
BW = imread('blobs.png');
imshow(BW,[]);
s=size(BW);
for row = 2:55:s(1)
for col=1:s(2)
if BW(row,col),
break;
end
end
contour = bwtraceboundary(BW, [row, col], 'W', 8, 50,...
'counterclockwise');
if(~isempty(contour))
hold on; plot(contour(:,2),contour(:,1),'g','LineWidth',2);
hold on; plot(col, row,'gx','LineWidth',2);
else
hold on; plot(col, row,'rx','LineWidth',2);
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?