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内容请搜索靠谱客的其他文章。
发表评论 取消回复