フィルターのクリア

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 回表示 (過去 30 日間)
I1=rgb2gray(I);
>BW=edge(I1,'sobel');
>D=bwdist(BW);
>u=D(480,:);
>Z=sum(u)/720;

回答 (1 件)

Image Analyst
Image Analyst 2015 年 12 月 12 日
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

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by