Storing multiple image data in feature vector or .mat file,

1 次查看(过去 30 天)
% the first part of the code reads all the images and then crops each image one by one.my problem is ,each cropped image should go to the loop and then it has be saved in the .mat file .You can see the last part of my code. Sorry, for the posting untidy works before. Thank you very much for the quick response am looking your idea.
end
image= 'D:\NAI\images\';
file = dir(fullfile(image, '*.tif'));
totimages = numel(file);
for i = 1: totimages
name= fullfile(image, file(i).name);
images = imread(name);
im_crop= imcrop(images,[]);
img= imresize(im_crop,[128 128]);
end
end
% Incriminating the feature vector's index
x =statxture([ tmp2; coeff_h{2}(:,:,k); 255*ones(5,col/4) ])
for i = 1:totimages
x= [x] +i
end
end*
  1 个评论
Nitin
Nitin 2014-8-13
It would make it easy for us if you could please post some of your code including parts where you are facing difficulties.

请先登录,再进行评论。

回答(1 个)

Joseph Cheng
Joseph Cheng 2014-8-13
Without any example implementation code, my thought is that in your loop, to go through each image, the feature vector is not incrementing its index properly or at all such that you are overwriting it each time. you'll need to either concatenate, check to see how each one is stored (using the debug tool), and/or not placed the feature vector = something in the right place (after the end of the for loop).
  1 个评论
Joseph Cheng
Joseph Cheng 2014-8-13
yeah so your code below is complete? if not it doesn't belong in the Answer section. Also can you reformat so it is legible. Check the Preview Screen or highlight the code after you paste it in and hit the {}Code button.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by