00001 /* 00002 * RGBFeatureDetection.h 00003 * 00004 * Created on: Sep 25, 2012 00005 * Author: kidson 00006 */ 00007 00008 #ifndef RGBFEATUREDETECTION_H_ 00009 #define RGBFEATUREDETECTION_H_ 00010 00011 #include "opencv2/core/core.hpp" 00012 #include "opencv2/nonfree/features2d.hpp" 00013 00014 #include "rgbd_registration/typedefs.h" 00015 00016 class RGBFeatureDetection 00017 { 00018 public: 00019 RGBFeatureDetection (); 00020 virtual ~RGBFeatureDetection (); 00021 00022 cv::Mat restoreCVMatFromPointCloud (PointCloudConstPtr cloud_in); 00023 00024 void projectFeaturesTo3D (std::vector<cv::KeyPoint>& feature_locations_2d, std::vector< 00025 Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> > & feature_locations_3d, 00026 const PointCloudConstPtr point_cloud); 00027 00028 void detectFeatures (const cv::Mat& input_image, std::vector<cv::KeyPoint>& keypoints); 00029 00030 void extractFeatures (const cv::Mat& input_image, std::vector<cv::KeyPoint>& keypoints, 00031 cv::Mat& descriptors); 00032 00033 void findMatches (const cv::Mat& source_descriptors, const cv::Mat& target_descriptors, 00034 std::vector<cv::DMatch>& good_matches); 00035 00036 void OutlierRemoval (const std::vector<cv::DMatch>& matches, 00037 std::vector<cv::DMatch>& good_matches); 00038 00039 private: 00040 int image_counter_; 00041 }; 00042 00043 #endif /* RGBFEATUREDETECTION_H_ */