distance metric Subscripted assignment error
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
My test feature vector is 'testpg' and trained feature vector is 'trainpg' and both are of dimension 2000*1 .I am aiming to find the distance between the two histogram feature vectors and hence i do
distance = norm(trainpg-testpg)
Next I compare it to a scalar threshold value to check whether it satisfies my condition , The above code works well as i get a scalar value of this distance ie : for eg distance = 5.4 which is a scalar
But when I change code to use any other histogram based distance metric it doesn't work
i used the pdist2 function from http://www.mathworks.com/matlabcentral/fileexchange/29004-feature-points-in-image--keypoint-extraction/content/FPS_in_image/FPS%20in%20image/Help%20Functions/SearchingMatches/pdist2.m
The new code I used is
distance = pdist2(trainpg,testpg, 'chisq')
d = size(distance)
Here I am getting subscripted assignment dimension mismatch error as the dimensions of my distance are now 2000*2000 instead of 1*1
How could I get scalar value for the distances?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Dimensionality Reduction and Feature Extraction 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!