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

📄 tryweights.m

📁 cootes提出的ASM算法的matlab实现。在cootes用于课堂使用的源代码的基础上改写。改正了原来代码中的一些错误
💻 M
字号:
function TerminateNotContinue=TryWeights(MeanShape,tEigenvectors,ContoursEndingPoints);%function TerminateNotContinue=TryWeights(MeanShape,tEigenvectors,ContoursEndingPoints);t=size(tEigenvectors,2);prompt=cell(1,t);def   =cell(1,t);for ind1=1:t   prompt{ind1}=['Enter weighting factor No.',num2str(ind1)];   def{ind1}='0';% test   %def{ind1}=num2str(0);endTheTitle='ASM: Trying differnt weights';lineNo=1;ButtonName='Yes';while ButtonName=='Yes',   answer=inputdlg(prompt,TheTitle,lineNo,def,'on');   if isempty(answer) TerminateNotContinue = 1;  return;    end   b=zeros(t,1);   for ind1=1:t        b(ind1)=str2num(answer{ind1});   end     Xtest=MeanShape + tEigenvectors*b;   figure   PlotShapes(Xtest,['ASM: test shape with b = [',num2str(b(:)'),']'],ContoursEndingPoints);      ButtonName=questdlg('Do you want to try again?','ASM: Trying differnt weights');   if(strcmp(ButtonName,'Cancel'))      TerminateNotContinue = 1;      return;    elseif (strcmp(ButtonName,'No'))      TerminateNotContinue = 0;      return;      endend

⌨️ 快捷键说明

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