hey, I am doing a project using python and opencv(cv2). here i am calculating the dataset's image's red,green and blue mean separately and also calculating the GLCM( contrast, energy,homogeneity, and correlation) and saving it in different list's. Now i have calculated the euclidean distance between query image with DB images, but i am unable to display the images with least distance.
i have done the code partially, and it is like:
import cv2
from collections import *
import CBIR as cb
import experiment as ex
from scipy.spatial import distance
from matplotlib import pyplot as plt
result_list = list()
i = 0
a_list = list()
b_list = list()
a_list.append(ex.feature_matrix_ip)
while i < 50:
b_list.append(cb.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
result_list.sort()
res_list_sort = zip(result_list,result_list_sort)
CBIR gives red,green and blue mean with GLCM( contrast, energy,homogeneity, and correlation) of DB images and experiment will give the values of the query image.
how to display the images. Any suggestions are welcome
Thanks!