removeborderpixels.m

来自「Matlab程序」· M 代码 · 共 14 行

M
14
字号
function bw = RemoveBorderPixels( bw )

%removes regions of ones that touch the image border

bw =  1-bwfill(1-bw, ...
    1:size(bw,2),...
    repmat( size(bw,1), 1, size(bw,2))   );

bw =  1-bwfill(1-bw, 1:size(bw,2), repmat( 1, 1, size(bw,2)) );

bw =  1-bwfill(1-bw, repmat( size(bw,2), 1, size(bw,1)), 1:size(bw,1) );

bw =  1-bwfill(1-bw, repmat( 1, 1, size(bw,1)) , 1:size(bw,1));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?