📄 getbeforeafterpts.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%
%(c) Ghassan Hamarneh 1999
%%%%%%%%%%%%%%%%%%%%%%%%%%
function [pt1,pt2]=GetBeforeAfterPts(index,ContoursEndingPoints);
%function [pt1,pt2]=GetBeforeAfterPts(index,ContoursEndingPoints);
if index==1
pt1=ContoursEndingPoints(1);
pt2=2;
elseif index==ContoursEndingPoints(1)
pt1=ContoursEndingPoints(1)-1;
pt2=1;
elseif index==ContoursEndingPoints(end)
pt1=ContoursEndingPoints(end)-1;
pt2=ContoursEndingPoints(end-1)+1;
elseif ismember(index-1,ContoursEndingPoints)
tmp=find(index-1==ContoursEndingPoints);
pt1=ContoursEndingPoints(tmp+1);
pt2=index+1;
elseif ismember(index,ContoursEndingPoints)
pt1=index-1;
tmp=find(index==ContoursEndingPoints);
pt2=ContoursEndingPoints(tmp-1)+1;
else
pt1=index-1;
pt2=index+1;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -