How to find euclidean distance?

2 vues (au cours des 30 derniers jours)
Nisreen Sulayman
Nisreen Sulayman le 29 Juin 2015
I have a matrix Features_DB with size 13*30 where each column represent shape features of 13 image.
I want to match between a Query Image shape feature variable Query_Feature with size 13*7(I have 7 query images) and the features vectors for the 30 image represented by
Any Help please??

Réponses (1)

Luuk van Oosten
Luuk van Oosten le 29 Juin 2015
Have you tried something like:
Z = dist(shapefeature{i},QI_Shape_feature{i})
You can see here how to use "dist" for euclidean distance weight function.
  1 commentaire
Nisreen Sulayman
Nisreen Sulayman le 29 Juin 2015
Modifié(e) : Nisreen Sulayman le 29 Juin 2015
Thank you, but it didn't work.
Could you please correct the following code
[C R]=size(Query_Features);
for j=1:R %R=1:7
Q_F=Query_Features(:,j);
E_D(j)=Euclidean_dist(Features_DB,Q_F)
save('Euc_Dist.mat','E_D(j)')
end
function [ E_D ] = Euclidean_dist(Features_DB, Query_Features )
%Features_DB: Matrix where each column represent a feature vector,
%[X,Y]=size(Features_DB): X,number of features; Y, number of images.
%X=13,Y=30
%Query_Feature:Matrix where each column represent a feature vector of a
%query image.
%[X,Y]=size(Query_Features): X,number of features; Y, number of images.
%X=13,Y=7
[X,Y]=size(Features_DB);
for i=1:Y
E_D=dist(Features_DB(:,i),Query_Features(:));
end
end

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by