我想使用MATLAB的bagOfFeatures()函数。但它需要以imageSet或imageDataStore的形式输入。我想运行的代码如下:如何以imageSet或imageDataStore的形式向MATLAB中的BagOfFeatures()函数提供输入?
Dataset = 'D:\dsktop\kinect_leap_dataset\acquisitions';
thresh1 = 0;
thresh2 = 20;
k = dir(fullfile(Dataset,'\P*\G*\*_depth.png'));
kf = {k(~[k.isdir]).folder};
kn = {k(~[k.isdir]).name};
for j=1:length(k)
% Applying thresholding to the original image
full_name = horzcat(kf{j},filesep,kn{j});
image = imread(full_name);
image_bin1 = (image < thresh2);
image_bin2 = (thresh1 < image);
image_bin = abs(image_bin2- image_bin1);
sequence{i} = image_bin;
end
% Bag of Features
bag = bagOfFeatures(sequence);
但“顺序”是细胞类等bagOfFeatures()是给我的错误。所以,我想这一点:
Dataset = 'D:\dsktop\kinect_leap_dataset\acquisitions';
imgFolder = fullfile(Dataset);
imgSets = imageSet(imgFolder, 'recursive');
imgSets.Description
但是现在的问题是怎么做的处理(阈值)对保存在imgSets图像。此外,处理后如何将所有“image_bin”图像保存在imageSet类中,以便我可以将它们作为BagOfFeatures()函数的输入。
2017-07-28
Prachi