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

1 visualización (últimos 30 días)
Adnan Ibrahim
Adnan Ibrahim el 13 de Ag. de 2014
Editada: Adnan Ibrahim el 13 de Ag. de 2014
% 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 comentario
Nitin
Nitin el 13 de Ag. de 2014
It would make it easy for us if you could please post some of your code including parts where you are facing difficulties.

Iniciar sesión para comentar.

Respuestas (1)

Joseph Cheng
Joseph Cheng el 13 de Ag. de 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 comentario
Joseph Cheng
Joseph Cheng el 13 de Ag. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by