gft_detector.cpp
Go to the documentation of this file.
00001 
00024 #include "rgbdtools/features/gft_detector.h"
00025 
00026 namespace rgbdtools {
00027 
00028 GftDetector::GftDetector():
00029   FeatureDetector()
00030 {
00031   gft_detector_.reset(
00032     new cv::GoodFeaturesToTrackDetector(n_features_, 0.01, min_distance_));
00033 }
00034 
00035 GftDetector::~GftDetector()
00036 {
00037 
00038 }
00039 
00040 void GftDetector::findFeatures(RGBDFrame& frame, const cv::Mat& input_img)
00041 {
00042   cv::Mat mask(frame.depth_img.size(), CV_8UC1);
00043   frame.depth_img.convertTo(mask, CV_8U);
00044 
00045   gft_detector_->detect(input_img, frame.keypoints, mask);
00046   
00047   if(compute_descriptors_)
00048     orb_descriptor_.compute(
00049       input_img, frame.keypoints, frame.descriptors);
00050 }
00051 
00052 void GftDetector::setNFeatures(int n_features)
00053 {
00054   n_features_ = n_features;
00055     
00056   gft_detector_.reset(
00057     new cv::GoodFeaturesToTrackDetector(n_features_, 0.01, min_distance_));
00058 }
00059     
00060 void GftDetector::setMinDistance(double min_distance)
00061 {
00062   min_distance_ = min_distance;
00063     
00064   gft_detector_.reset(
00065     new cv::GoodFeaturesToTrackDetector(n_features_, 0.01, min_distance_));
00066 }
00067 
00068 } // namespace rgbdtools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


lib_rgbdtools
Author(s): Ivan Dryanovski
autogenerated on Tue Aug 27 2013 10:33:54