I have a database of 300 Images and I extracted for each of them a BOVW. Starting from a query image (with query_BOVW extracted from the same dictionary) I need to find similar images in my training dataset.
I used Sklearn KDTree on my training set kd_tree = KDTree(training)
and then I calculate the distance from the query vector with kd_tree.query(query_vector)
. The last function takes as second parameter the number of nearest neighbours to return, but what I seek is to set a threshold for the euclidian distance and based on this threshold have different number of nearest neighbours.
I looked into the documentation but I did not find anything about that. Am I wrong seeking something that maybe does make no sense?
Thanks for the help.