0
我想使用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()函數的輸入。