i have a .mat file in which i saved a struct array containing two columns (one has names of images and the second has feature vectors corresponding to each of the images) i calculated the Euclidean distance between a feature vector (of a query image) and features stored with the corresponding image names in the .mat file. i did it, using the code bellow :
load('MyFeatures.mat');
HSV = features.HSV_images;
Edistance = pdist2(HSV,hsvQuery);
My question, is how to sort the results from the smallest distance to the biggest (similar to un-similar) and have the images showing, which means correspond the distances to each image.
My idea is to gather the results from Edistance and the names of images in another array and then do the sorting and show the image, is it correct ? is there a better way to do it ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…