Problem with cell2mat "Cannot support cell arrays containing cell arrays or objects."
古いコメントを表示
I am trying to run a pseudocode, which needs to run on a complete dataset of images. Name of the dataset is MICC-F220. The path of the dataset is 'C:\Users\parminder\Downloads\sift-forensic-master\sift-forensic-master\dataset'. I have following lines to process each image of the dataset.
% RUN EXPERIMENT
tstart = tic;
% dataset
DB = 'MICC-F220';
db_dir ='C:\Users\parminder\Downloads\sift-forensic-master\sift-forensic-master\dataset';
file_ground_truth = 'groundtruthDB_220.txt';
% parameters
metric = 'ward';
th = 2.2;
min_pts = 4;
% load ground truth from a file
[ImageName, GT] = textread(fullfile(db_dir,DB,file_ground_truth), '%s %d');
num_images = size(ImageName,1);
fid_gt = fopen(fullfile(db_dir,DB,file_ground_truth));
C = textscan(fid_gt, '%s %u');
fclose(fid_gt);
TP = 0; % True Positive
TN = 0; % True Negative
FP = 0; % False Positive
FN = 0; % False Negative
for i = 1:num_images
%parfor i = 1:num_images % use for parallel computation (needs matlabpool)
loc_file = fullfile(db_dir,DB,cell2mat(ImageName(i)));
name = cell2mat(ImageName(i));
% process an image
fprintf('Processing: %s (%d/%d)\n',loc_file,i,num_images);
countTrasfGeom = process_image(loc_file, metric, th, min_pts, 0);
......and so on
I am getting the following error
>>run_F220_experiment
Error using cell2mat (line 53)
Cannot support cell arrays containing cell arrays or objects.
Error in run_F220_experiment (line 30)
loc_file = fullfile(db_dir,DB,cell2mat(ImageName(i)));
How can i resolve it.
採用された回答
その他の回答 (1 件)
Matt J
2015 年 5 月 2 日
0 投票
It is complaining that ImageName(i) does not contain a data type that cell2mat can handle. Check the content of ImageName{i} and re-evaluate whether cell2mat is the appropriate tool.
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!