How to find euclidean distance?

4 ビュー (過去 30 日間)
Nisreen Sulayman
Nisreen Sulayman 2015 年 6 月 29 日
編集済み: Nisreen Sulayman 2015 年 6 月 29 日
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

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by