i want to read a folder of images and do my code on the images then obtain some features from every image and save them in a vector. how can i do that? i wrote this code but it has an error to read the folder.
Mostrar comentarios más antiguos
I1=rgb2gray(I);
>BW=edge(I1,'sobel');
>D=bwdist(BW);
>u=D(480,:);
>Z=sum(u)/720;
2 comentarios
Star Strider
el 11 de Dic. de 2015
Walter Roberson
el 11 de Dic. de 2015
That code has nothing in it that would read an image?
Respuestas (1)
Image Analyst
el 12 de Dic. de 2015
See the FAQ for code to process a bunch of files: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
In the middle of the loop, just save your result:
for k = 1 : numberOfImages
% code to read in imageArray......
% Now analyze it.
result(k) = AnalyzeSingleImage(imageArray);
end
where AnalyzeSingleImage is the function that you write to make your measurement and returns a single number.
If it returns an array of numbers, like a feature vector, then use a 2D array to store the results:
allResults = zeros(numberOfImages, 10);
for k = 1 : numberOfImages
% Get results, an array of 10 measurements we've made.
results = AnalyzeSingleImage(imageArray);
allResults(k,:) = results;
end
Categorías
Más información sobre Image Arithmetic en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!