tryweights.m
来自「active shape model的matlab代码实现」· M 代码 · 共 37 行
M
37 行
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 + =
减小字号Ctrl + -
显示快捷键?