Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KDTree.h

Go to the documentation of this file.
00001 #ifndef __KDTREE_H
00002 #define __KDTREE_H
00003 
00004 #include <vector>
00005 class keypoint;
00006 
00007 class KDTree{
00008 private:
00009   bool                   isLeaf;
00010   std::vector<keypoint*> keypts;
00011   int                    axis;
00012   std::vector<double>    variance;
00013   std::vector<double>    mean;
00014   double                 median;
00015   KDTree*                leftChild;
00016   KDTree*                rightChild;
00017   int                    height;
00018   
00019   void makeLeaf();
00020   void computeMeans(std::vector< std::vector<double> >& vals);
00021   int computeVariances();
00022   
00023 public:
00024   KDTree(const std::vector<keypoint*>& C);
00025   ~KDTree();
00026   
00027   bool isleaf();
00028   const std::vector<keypoint*>& getKeypoints();
00029   int                      getAxis();
00030   double                   getVariance(int x);
00031   double                   getMean(int x);
00032   double                   getMedian();
00033   KDTree*                  getLeftChild();
00034   KDTree*                  getRightChild();
00035   int                      getHeight();
00036   
00037   void                     getBestNKeypointMatch(keypoint& key, int maxSearches, int n);
00038   
00039 private:
00040   KDTree(const KDTree&); // Do not call
00041   KDTree& operator=(const KDTree&); // Do not call
00042 };
00043 
00044 
00045 class axisVarPair{
00046 public:
00047   int axis;
00048   double variance;
00049 };
00050 
00051 bool operator<(const axisVarPair& p1, const axisVarPair& p2);
00052 
00053 class nodeSqDistPair{
00054 public:
00055   KDTree* node;
00056   double sqDist;
00057   std::vector<bool>  activeAxes;
00058   std::vector<double> activeDist;
00059   
00060   nodeSqDistPair();
00061   nodeSqDistPair(KDTree* N, nodeSqDistPair& pair);
00062   nodeSqDistPair(const nodeSqDistPair&);
00063   nodeSqDistPair& operator=(const nodeSqDistPair&);
00064   ~nodeSqDistPair();
00065   
00066   bool operator<(const nodeSqDistPair& p);
00067   
00068 private:
00069 };
00070 
00071 double computePositionK(std::vector<double> V, size_t posK);
00072 
00073 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:42 2016 by Doxygen 1.6.3