Is there any way to use a custom distance with FLANN?

asked 2017-02-12 15:20:19 -0500

juanmanpr gravatar image

Hey guys, so I see te GenericIndex class is templated. FLANN originally, however, is a bit more flexible than that. It allows defining the distance function. Is it possible with OpenCV as well? (In other words, in the code below, I would like Knn_Distance be my own class definition)

    this->p_index = std::make_shared< cv::flann::GenericIndex<Knn_Distance> >(
        train_vectors,
        cvflann::KDTreeIndexParams(this->params.num_trees), 
        Knn_Distance()
        );

Thanks!

edit retag flag offensive close merge delete