フィルターのクリア

how to read the features from for loop?

1 回表示 (過去 30 日間)
Dhines
Dhines 2013 年 2 月 9 日
am using ten images inside of for loop...but i get only tenth image features after for loop operation. how to i get previous 1 to 9 image's features?...

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 9 日
For k=1:10
im1=imread('yourimage')
figure;
imshow(im1);
im{k}=im1
end

Image Analyst
Image Analyst 2013 年 2 月 9 日
Inside your loop you need to save each set of features in an array, like
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);
allImagesFeatures = zeros(length(jpegFiles), 42); % Initialize.
for k = 1:length(jpegFiles)
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
imshow(imageArray); % Display image.
drawnow; % Force display to update immediately.
% Get the 42 features of this image only.
% You need to custom write AnalyzeSingleImage().
thisImagesFeatures = AnalyzeSingleImage(imageArray);
% Append these features to the cumulative array that
% we are creating to hold features from all the images.
allImagesFeatures(k, :) = thisImagesFeatures;
end
If you need help figuring out how to determine features, see my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by