How to find euclidean distance?

1 次查看(过去 30 天)
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??

回答(1 个)

Luuk van Oosten
Luuk van Oosten 2015-6-29
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 个评论
Nisreen Sulayman
Nisreen Sulayman 2015-6-29
编辑:Nisreen Sulayman 2015-6-29
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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by