get_names_with_pm.m

来自「matlab aamtool box」· M 代码 · 共 27 行

M
27
字号
%%%%%%%%%%%%%%%%%%%%%%
%
%  Verify Image List is consistent with point model list
%
%%%%%%%%%%%%%%%%%%%%%%
function aam=get_names_with_pm(aam,cwd)
ind=findstr(aam.modelDirec(19:end),'\')+17;
dirname=[cwd,'\PointModels\',aam.modelDirec(19:ind(1))];
d=dir([dirname,'\','*_pm*']);
%now go through the list of files that we need, taking them from the dir
dnames={d.name};
m=1;
for i=1:length(aam.am_imagenames)
    imagename=aam.am_imagenames{i};
    filename=imagename(1:regexpi(imagename,'.jpg')-1);
    for j=1:length(dnames)
        pointmodelname=dnames{j}(1:findstr(dnames{j},'_pm')-1);
        %[filename,' ',pointmodelname]
        if strcmp(pointmodelname,filename) % non-empty disc file matches image filename
            selected_names{m}=imagename;
            m=m+1;
        end
    end
end
if exist('selected_names')
    aam=set(aam, 'am_imagenames',selected_names);
end

⌨️ 快捷键说明

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