📄 regiongrow.m
字号:
function [g,NR,SI,TI]=regiongrow(f,S,T)
%REFIONGROW Perform segmentation by region growing.
f=double(f);
%If S is a scalar, obtain the seed image.
if numel(S)==1
SI=f==S;
S1=S;
else
% S is an array. Eliminate duplicate, connect seed locations
% to reduce the number of loop executions in the following
% sections of code.
SI=bwmorph(S,'shrink',Inf);
J=find(SI);
S1=f(J); % Array of seed value.
end
TI=false(size(f));
for K=1:length(S1)
seedvalue=S1(K);
S=abs(f-seedvalue)<=T;
TI=TI|S;
end
[g,NR]=bwlabel(imreconstruct(SI,TI));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -