selecting an image from folder
Afficher commentaires plus anciens
I have 30 images in a folder,I have to select only21st image from it,please help,i tried this code but only first image is shown
I have 30 images in folder named photos
path='D:\photos\';
files=dir(strcat(path,'*.jpg'))
for k=1:numel(files(21))%numel(files)
file_name=files(k).name;
image_name=strcat(path,file_name);
I=imread(image_name);
figure,imshow(I)
end
2 commentaires
kash
le 29 Déc 2011
Image Analyst
le 29 Déc 2011
Look up the mod() function to take every 5th one.
Réponse acceptée
Plus de réponses (1)
Chandra Kurniawan
le 22 Déc 2011
Then you just need to pass your feature vector 1x80 and
feature vector of query image in
suppose that dataset1 is feature vector 1x80
dataset2 is feature vector of query image
function D = DistEuclidian(dataset1, dataset2)
[m1 n1] = size(dataset1);
[m2 n2] = size(dataset2);
D = zeros(m1, m2);
for i = 1 : m1
for j = 1 : m2
D(i, j) = sqrt((dataset1(i, 1) - dataset2(j, 1)) ^ 2 + ...
(dataset1(i, 2) - dataset2(j, 2)) ^ 2);
end
end
And you'll get the Distance matrix.
Then make a limit. If all values in Distance matrix lower than your limit,
We can say that your query image is match with feature vector 1x80
7 commentaires
FIR
le 22 Déc 2011
But Chandra How to retrieve the image finally
kash
le 22 Déc 2011
kash
le 22 Déc 2011
Chandra Kurniawan
le 22 Déc 2011
Please send me the MAT file of 'feature vector 1x80'
and tell me what are feature vector of query image.
It's hard if I only imagine about that.
kash
le 22 Déc 2011
kash
le 28 Déc 2011
Image Analyst
le 28 Déc 2011
Did you try
% Multiply by 2 and divide by 2, for some weird reason.
newVector = (2*data80) / (2*data80); % Not sure of the point.
% Get running average.
output = conv(newVector, ones(1,8)/8, 'valid');
Catégories
En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!