|
|
|
@ -59,7 +59,7 @@ can be found in @cite Muja2009 . |
|
|
|
|
namespace cvflann |
|
|
|
|
{ |
|
|
|
|
CV_EXPORTS flann_distance_t flann_distance_type(); |
|
|
|
|
FLANN_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order); |
|
|
|
|
CV_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -230,7 +230,7 @@ public: |
|
|
|
|
|
|
|
|
|
::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); } |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); } |
|
|
|
|
CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); } |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
::cvflann::Index<Distance>* nnIndex; |
|
|
|
@ -344,7 +344,7 @@ public: |
|
|
|
|
typedef typename L2<T>::ElementType ElementType; |
|
|
|
|
typedef typename L2<T>::ResultType DistanceType; |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params) |
|
|
|
|
CV_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params) |
|
|
|
|
{ |
|
|
|
|
printf("[WARNING] The cv::flann::Index_<T> class is deperecated, use cv::flann::GenericIndex<Distance> instead\n"); |
|
|
|
|
|
|
|
|
@ -368,13 +368,13 @@ public: |
|
|
|
|
if (nnIndex_L1) nnIndex_L1->buildIndex(); |
|
|
|
|
if (nnIndex_L2) nnIndex_L2->buildIndex(); |
|
|
|
|
} |
|
|
|
|
FLANN_DEPRECATED ~Index_() |
|
|
|
|
CV_DEPRECATED ~Index_() |
|
|
|
|
{ |
|
|
|
|
if (nnIndex_L1) delete nnIndex_L1; |
|
|
|
|
if (nnIndex_L2) delete nnIndex_L2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED void knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
CV_DEPRECATED void knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
{ |
|
|
|
|
::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size()); |
|
|
|
|
::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size()); |
|
|
|
@ -383,7 +383,7 @@ public: |
|
|
|
|
if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams); |
|
|
|
|
if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams); |
|
|
|
|
} |
|
|
|
|
FLANN_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
CV_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
{ |
|
|
|
|
CV_Assert(queries.type() == CvType<ElementType>::type()); |
|
|
|
|
CV_Assert(queries.isContinuous()); |
|
|
|
@ -401,7 +401,7 @@ public: |
|
|
|
|
if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED int radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
CV_DEPRECATED int radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
{ |
|
|
|
|
::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size()); |
|
|
|
|
::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size()); |
|
|
|
@ -411,7 +411,7 @@ public: |
|
|
|
|
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) |
|
|
|
|
{ |
|
|
|
|
CV_Assert(query.type() == CvType<ElementType>::type()); |
|
|
|
|
CV_Assert(query.isContinuous()); |
|
|
|
@ -429,32 +429,32 @@ public: |
|
|
|
|
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED void save(String filename) |
|
|
|
|
CV_DEPRECATED void save(String filename) |
|
|
|
|
{ |
|
|
|
|
if (nnIndex_L1) nnIndex_L1->save(filename); |
|
|
|
|
if (nnIndex_L2) nnIndex_L2->save(filename); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED int veclen() const |
|
|
|
|
CV_DEPRECATED int veclen() const |
|
|
|
|
{ |
|
|
|
|
if (nnIndex_L1) return nnIndex_L1->veclen(); |
|
|
|
|
if (nnIndex_L2) return nnIndex_L2->veclen(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED int size() const |
|
|
|
|
CV_DEPRECATED int size() const |
|
|
|
|
{ |
|
|
|
|
if (nnIndex_L1) return nnIndex_L1->size(); |
|
|
|
|
if (nnIndex_L2) return nnIndex_L2->size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED ::cvflann::IndexParams getParameters() |
|
|
|
|
CV_DEPRECATED ::cvflann::IndexParams getParameters() |
|
|
|
|
{ |
|
|
|
|
if (nnIndex_L1) return nnIndex_L1->getParameters(); |
|
|
|
|
if (nnIndex_L2) return nnIndex_L2->getParameters(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() |
|
|
|
|
CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() |
|
|
|
|
{ |
|
|
|
|
if (nnIndex_L1) return nnIndex_L1->getIndexParameters(); |
|
|
|
|
if (nnIndex_L2) return nnIndex_L2->getIndexParameters(); |
|
|
|
@ -505,7 +505,7 @@ int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::K |
|
|
|
|
/** @deprecated
|
|
|
|
|
*/ |
|
|
|
|
template <typename ELEM_TYPE, typename DIST_TYPE> |
|
|
|
|
FLANN_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params) |
|
|
|
|
CV_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params) |
|
|
|
|
{ |
|
|
|
|
printf("[WARNING] cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE> is deprecated, use " |
|
|
|
|
"cv::flann::hierarchicalClustering<Distance> instead\n"); |
|
|
|
|