how to read the features from for loop?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?...
0 commentaires
Réponses (2)
Azzi Abdelmalek
le 9 Fév 2013
For k=1:10
im1=imread('yourimage')
figure;
imshow(im1);
im{k}=im1
end
0 commentaires
Image Analyst
le 9 Fév 2013
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
0 commentaires
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!