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

2 views (last 30 days)
% 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 Comment
Nitin
Nitin on 13 Aug 2014
It would make it easy for us if you could please post some of your code including parts where you are facing difficulties.

Sign in to comment.

Answers (1)

Joseph Cheng
Joseph Cheng on 13 Aug 2014
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 Comment
Joseph Cheng
Joseph Cheng on 13 Aug 2014
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!