我在 matlab 中声明了一个类,这里是构造函数和函数。
function Ri = RGBimages(datadir)
if(isempty(dir(datadir)))
warning([datadir, ' is empty']);
return;
end
Ri.dataSrc=datadir;
Ri.twoEnds = load([datadir,'\seIndex.txt']);
Ri.startFrame = Ri.twoEnds(1);
Ri.endFrame = Ri.twoEnds(2);
Ri.numberOfFrames=Ri.twoEnds(2)-Ri.twoEnds(1)+1;
Ri.faceLmks = zeros(68,2,Ri.numberOfFrames);
end
function obtainFaceLmks(Ri)
indx=1;
for i = Ri.startFrame;%:Ri.endFrame
imstr = [Ri.dataSrc,'\rgb_',num2str(i),'.png'];
[status,result] = system(['fitD -m src\my.amf -h src\haarcascade_frontalface_alt2.xml -i ',imstr,' -n 30']);
if(status==-1)
warning(result);
else
temp=flHelper(result(1:size(result,2)-59));
Ri.faceLmks(:,:,indx)=temp;
end
indx=indx+1;
end
return;
end
然后我这样做:
ims = RGBimages('data\a01_s01_e01');
ims.obtainFaceLmks();
而且似乎ims的属性(ims.faceLmks)没有改变,为什么?
谢谢你的帮助