在提取图像文件夹的HOG功能后,我想将所有这些结果添加到一个矩阵中。我怎么能这样做?这是我在matlab中的代码:
% Get list of all jpg files in this directory
% DIR returns as a structure array. You will need to use () and . to get
% the file names.
%to get all images in Motorbikes directory
imagefiles = dir('Motorbikes/*.jpg');
nfiles = length(imagefiles); % Number of files found
for ii=1:nfiles
currentfilename = ['Motorbikes/',imagefiles(ii).name];
currentimage = imread(currentfilename);
images{ii} = currentimage;
end
%To extract features of each image
featureMatrix = [];
for jj=1:nfiles
currentImageFeatures = extractHOGFeatures(images{jj});
featureMatrix = [featureMatrix, currentImageFeatures];
end