getbeforeafterpts_fc.m
来自「active shape model的matlab代码实现」· M 代码 · 共 33 行
M
33 行
function [pt1,pt2]=GetBeforeAfterPts_fc(index,ContoursEndingPoints)
% 为了用c实现而重写
if index==1
pt1=ContoursEndingPoints(1);
pt2=2;
return;
elseif index==ContoursEndingPoints(1)
pt1=ContoursEndingPoints(1)-1;
pt2=1;
return;
elseif index==ContoursEndingPoints(end)
pt1=ContoursEndingPoints(end)-1;
pt2=ContoursEndingPoints(end-1)+1;
return;
else
for i=1:1:length(ContoursEndingPoints)
if index==ContoursEndingPoints(i)
pt1=index-1;
pt2=ContoursEndingPoints(i-1)+1;
return;
elseif index-1==ContoursEndingPoints(i)
pt1=ContoursEndingPoints(i+1);
pt2=index+1;
return;
end
end
pt1=index-1;
pt2=index+1;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?