def dictionary(descriptors, N):
pdb.set_trace()
em = cv2.EM(N)
em.train(descriptors)
return np.float32(em.getMat("means")), \
np.float32(em.getMatVector("covs")), np.float32(em.getMat("weights"))[0]
#def image_descriptors(file):
# img = cv2.imread(file, 0)
# img = cv2.resize(img, (256, 256))
# _ , descriptors = cv2.SIFT().detectAndCompute(img, None)
# return descriptors
评论列表
文章目录