Commit c071f548 authored by Marius Muja's avatar Marius Muja

Fixing ticket #1228

parent be2c4ddb
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
#define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))
namespace cvflann {
/* Nearest neighbour index algorithms */ /* Nearest neighbour index algorithms */
enum flann_algorithm_t enum flann_algorithm_t
{ {
...@@ -159,4 +161,6 @@ enum ...@@ -159,4 +161,6 @@ enum
FLANN_CHECKS_AUTOTUNED = -2 FLANN_CHECKS_AUTOTUNED = -2
}; };
}
#endif /* OPENCV_FLANN_DEFINES_H_ */ #endif /* OPENCV_FLANN_DEFINES_H_ */
...@@ -53,6 +53,8 @@ namespace cv ...@@ -53,6 +53,8 @@ namespace cv
namespace flann namespace flann
{ {
using namespace cvflann;
struct CV_EXPORTS IndexParams struct CV_EXPORTS IndexParams
{ {
...@@ -88,7 +90,7 @@ struct CV_EXPORTS LinearIndexParams : public IndexParams ...@@ -88,7 +90,7 @@ struct CV_EXPORTS LinearIndexParams : public IndexParams
struct CV_EXPORTS CompositeIndexParams : public IndexParams struct CV_EXPORTS CompositeIndexParams : public IndexParams
{ {
CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11, CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 ); cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2 );
}; };
struct CV_EXPORTS AutotunedIndexParams : public IndexParams struct CV_EXPORTS AutotunedIndexParams : public IndexParams
...@@ -100,7 +102,7 @@ struct CV_EXPORTS AutotunedIndexParams : public IndexParams ...@@ -100,7 +102,7 @@ struct CV_EXPORTS AutotunedIndexParams : public IndexParams
struct CV_EXPORTS KMeansIndexParams : public IndexParams struct CV_EXPORTS KMeansIndexParams : public IndexParams
{ {
KMeansIndexParams(int branching = 32, int iterations = 11, KMeansIndexParams(int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 ); cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2 );
}; };
struct CV_EXPORTS LshIndexParams : public IndexParams struct CV_EXPORTS LshIndexParams : public IndexParams
...@@ -122,10 +124,10 @@ class CV_EXPORTS_W Index ...@@ -122,10 +124,10 @@ class CV_EXPORTS_W Index
{ {
public: public:
CV_WRAP Index(); CV_WRAP Index();
CV_WRAP Index(InputArray features, const IndexParams& params, flann_distance_t distType=FLANN_DIST_L2); CV_WRAP Index(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);
virtual ~Index(); virtual ~Index();
CV_WRAP virtual void build(InputArray features, const IndexParams& params, flann_distance_t distType=FLANN_DIST_L2); CV_WRAP virtual void build(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);
CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices, CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices,
OutputArray dists, int knn, const SearchParams& params=SearchParams()); OutputArray dists, int knn, const SearchParams& params=SearchParams());
...@@ -136,12 +138,12 @@ public: ...@@ -136,12 +138,12 @@ public:
CV_WRAP virtual void save(const std::string& filename) const; CV_WRAP virtual void save(const std::string& filename) const;
CV_WRAP virtual bool load(InputArray features, const std::string& filename); CV_WRAP virtual bool load(InputArray features, const std::string& filename);
CV_WRAP virtual void release(); CV_WRAP virtual void release();
CV_WRAP flann_distance_t getDistance() const; CV_WRAP cvflann::flann_distance_t getDistance() const;
CV_WRAP flann_algorithm_t getAlgorithm() const; CV_WRAP cvflann::flann_algorithm_t getAlgorithm() const;
protected: protected:
flann_distance_t distType; cvflann::flann_distance_t distType;
flann_algorithm_t algo; cvflann::flann_algorithm_t algo;
int featureType; int featureType;
void* index; void* index;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment