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

📄 gettrnsetcoor.m

📁 cootes提出的ASM算法的matlab实现。在cootes用于课堂使用的源代码的基础上改写。改正了原来代码中的一些错误
💻 M
字号:
function [Xu,TrnImgFiles]=GetTrnSetCoor(NumLandMarkPts,ContoursEndingPoints)%function Xu=GetTrnSetCoor(NumLandMarkPts)ind1=1;       % % 选择目录directory_name = uigetdir('I:\Work\work200511\MouthASM\MouthImage100\1_big');if directory_name==0    TrnImgFiles={};    msgbox('cancel'); return;endfiles = dir(strcat(directory_name,'\*.bmp'));NumTrnSetImgs=length(files);if NumTrnSetImgs==0    msgbox('No bmp file here. Exit');    return;endButton1=questdlg('已存在部分标点结果?','ASM');if(strcmp(Button1,'Yes')) % 有一部分图像已经标过点了,打开标点文件。文件夹中的一部分图像的标点结果在标点文件中。    [fname,pname]=uigetfile('*.mat','读入已标点文件');    load([pname,fname]);elseif(strcmp(Button1,'No'))    [fname,pname] = uiputfile('*.mat', '保存标点结果');    TrnImgFiles={};    Xu=[];else    msgbox('cancel');    return;end    while ind1<=NumTrnSetImgs,   FileName=files(ind1).name;   PathName=strcat(directory_name,'\');        % 如果标点文件中已经有了这个图像的标点数据,则跳过这个图像   skip=0;   for i=1:1:length(TrnImgFiles)       if strcmp(TrnImgFiles{i},strcat(PathName,FileName))           skip=1;           break;       end   end   if skip==1       ind1=ind1+1;       continue;   end      Img=imread([PathName,FileName]);      [Y,X]=landmark(Img,['Labeling Image: ',num2str(ind1)],NumLandMarkPts);            button2=questdlg('保存这副图像的标点结果','save');   if strcmp(button2,'Yes')       TrnImgFiles=[TrnImgFiles;{[PathName,FileName]}];       Xu=[Xu,[round(X);round(Y)]];       save([pname,fname],'Xu','TrnImgFiles','ContoursEndingPoints','NumLandMarkPts');       ind1=ind1+1;   endendclose;

⌨️ 快捷键说明

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