00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __lfeatPointMatch_h
00022 #define __lfeatPointMatch_h
00023
00024 #include <boost/shared_ptr.hpp>
00025 #include <vector>
00026
00027 #include "KeyPoint.h"
00028
00029 namespace lfeat
00030 {
00031
00032 struct PointMatch
00033 {
00034
00035 PointMatch(KeyPointPtr& aPM1, KeyPointPtr& aPM2) :
00036 _img1_x(aPM1->_x), _img1_y(aPM1->_y), _img2_x(aPM2->_x), _img2_y(aPM2->_y),
00037 _img1_kp(aPM1), _img2_kp(aPM2) {};
00038
00039 double _img1_x, _img1_y, _img2_x, _img2_y;
00040
00041
00042 KeyPointPtr _img1_kp;
00043 KeyPointPtr _img2_kp;
00044
00045
00046
00047
00048
00049
00050 };
00051
00052 typedef boost::shared_ptr<PointMatch> PointMatchPtr;
00053 typedef std::vector<PointMatchPtr> PointMatchVector_t;
00054
00055 class PointMatchPtrSort
00056 {
00057 public:
00058 inline bool operator() (const PointMatchPtr& a, const PointMatchPtr& b) const
00059 {
00060 if (a->_img1_kp->_score < b->_img1_kp->_score)
00061 {
00062 return true;
00063 }
00064 else if (a->_img1_kp->_score > b->_img1_kp->_score)
00065 {
00066 return false;
00067 }
00068 else
00069 {
00070
00071 return (a->_img1_kp->_y < b->_img1_kp->_y);
00072 }
00073 }
00074 };
00075
00076 }
00077
00078 #endif // __lfeatPointMatch_h