Go to the documentation of this file.00001
00033 #ifndef __SURF_PLANAR_DETECTOR__
00034 #define __SURF_PLANAR_DETECTOR__
00035
00036 #include "ObjectModel.h"
00037 #include "ObjectDetectorMethod.h"
00038 #include "re_msgs/DetectedObject.h"
00039
00040 #include "DVision.h"
00041 #include <vector>
00042
00043 typedef DVision::SurfSet SurfSet;
00044
00045
00046 #define PLANAR_DEBUG_ENABLED 1
00047
00048 class SurfPlanarDetector: public ObjectDetectorMethod
00049 {
00050 public:
00051
00052 #if PLANAR_DEBUG_ENABLED
00053 SurfPlanarDetector(): m_detect_counter(0){}
00054 #else
00055 SurfPlanarDetector(){}
00056 #endif
00057
00058 virtual ~SurfPlanarDetector(){}
00059
00068 void detect(ObjectDetectorMethod::DetectionData &data,
00069 ObjectModel &model,
00070 re_msgs::DetectedObject &detection);
00071
00072 protected:
00073
00091 bool detectWithHomography(const SurfSet &scene_surfset,
00092 ObjectModel &model,
00093 ObjectModel::Face &face, const std::vector<int> &model_indices,
00094 const std::vector<int> &scene_indices, const std::vector<float> &distances,
00095 const ObjectDetectorMethod::DetectionData &data,
00096 const double maxReprojectionError, bool doReChecking,
00097 re_msgs::DetectedObject &detection) ;
00098
00105 bool alignedPoints(const ObjectModel::Face &face,
00106 const std::vector<int> indices) const;
00107
00108 protected:
00109
00110 #if PLANAR_DEBUG_ENABLED
00111 int m_detect_counter;
00112 std::string m_debug_prefix;
00113 #endif
00114
00115 };
00116
00117 #endif