概述
function feaOfBB = getBBFeat(savepath,i,medFeatMat,location,blockHeight,blockWidth,step)
% blockproc的函数句柄
if ~isdir(savepath)
mkdir(savepath);
end
[h,w,~] = size(medFeatMat);
medFeaOfBB = medFeatMat(location(1):(location(1)+blockHeight-1),location(2):(location(2)+blockWidth-1),:);
feaOfBB = [location(1),location(2), blockHeight,blockWidth,histAndVectOfBb(medFeaOfBB)];
dlmwrite([savepath 'person_' num2str(i,'%04d') '.txt'],feaOfBB,'-append');
if location(1)+blockHeight+step-1 <= h
medFeaOfBB2 = medFeatMat(location(1)+step:(location(1)+blockHeight+step-1),location(2):(location(2)+blockWidth-1),:);
feaOfBB2 = [location(1)+step,location(2),blockHeight,blockWidth,histAndVectOfBb(medFeaOfBB2)];
dlmwrite([savepath 'person_' num2str(i,'%04d') '.txt'],feaOfBB2,'-append');
end
if location(2)+blockWidth+step-1 <= w
medFeaOfBB3 = medFeatMat(location(1):(location(1)+blockHeight-1),location(2)+step:(location(2)+blockWidth+step-1),:);
feaOfBB3 = [location(1),location(2)+step,blockHeight,blockWidth,histAndVectOfBb(medFeaOfBB3)];
dlmwrite([savepath 'person_' num2str(i,'%04d') '.txt'],feaOfBB3,'-append');
end
if ( location(1)+blockHeight+step-1<=h ) && ( location(2)+blockWidth+step-1<=w )
medFeaOfBB4 = medFeatMat(location(1)+step:(location(1)+blockHeight+step-1),location(2)+step:(location(2)+blockWidth+step-1),:);
feaOfBB4 = [location(1)+step,location(2)+step,blockHeight,blockWidth,histAndVectOfBb(medFeaOfBB4)];
dlmwrite([savepath 'person_' num2str(i,'%04d') '.txt'],feaOfBB4,'-append');
end
end
最后
以上就是清秀小蝴蝶为你收集整理的matlab 写文件 %116,dlmwrite读取文件出错的全部内容,希望文章能够帮你解决matlab 写文件 %116,dlmwrite读取文件出错所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复