필터 지우기
필터 지우기

How to find euclidean distance?

조회 수: 2 (최근 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

댓글을 달려면 로그인하십시오.

카테고리

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