⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getbeforeafterpts_fc.m

📁 cootes提出的ASM算法的matlab实现。在cootes用于课堂使用的源代码的基础上改写。改正了原来代码中的一些错误
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -