hey guys, i am trying to calculate the euclidean distance, but it is not giving me the proper values. i have no idea, whether the problem is with my code or the IDE i'm using. I use enthought canopy with python and opencv.
even if the image belongs to the database also, the distance will not be 0.0
Any suggestions are welcome!
Thanks for the support!
Code:
from collections import *
from CBIR import *
from experiment import *
from scipy.spatial import distance
result_list = list()
i = 0
a_list = list()
b_list = list()
a_list.append(feature_matrix_ip)
while i < 9:
b_list.append(feature_matrix_db[i])
dist = distance.euclidean(a_list,b_list[i])
result_list.append(dist)
result_list_sort = OrderedDict(sorted(enumerate(result_list),key=lambda x: x[0])).keys()
i = i + 1
res_lst_srt = zip(result_list,result_list_sort)
res_lst_srt.sort()
print res_lst_srt
Any suggestions are welcome!
Thanks for the support!