Filter löschen
Filter löschen

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.

1 Ansicht (letzte 30 Tage)
I1=rgb2gray(I);
>BW=edge(I1,'sobel');
>D=bwdist(BW);
>u=D(480,:);
>Z=sum(u)/720;

Antworten (1)

Image Analyst
Image Analyst am 12 Dez. 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

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by