matlab里toimage函数_如何以imageSet或imageDataStore的形式向MATLAB中的BagOfFeatures()函数提供输入?...

我想使用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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值