Skip to content
Snippets Groups Projects
Commit 17c6a875 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

Merge branch 'feature/int_max_new_features' into 'devel'

int ProcessorParamsTracker::max_new_feature_

Closes #91

See merge request mobile_robotics/wolf_projects/wolf_lib/wolf!265
parents 226ca789 da547822
No related branches found
No related tags found
No related merge requests found
Showing
with 93 additions and 61 deletions
...@@ -18,7 +18,7 @@ WOLF_STRUCT_PTR_TYPEDEFS(ProcessorParamsTracker); ...@@ -18,7 +18,7 @@ WOLF_STRUCT_PTR_TYPEDEFS(ProcessorParamsTracker);
struct ProcessorParamsTracker : public ProcessorParamsBase struct ProcessorParamsTracker : public ProcessorParamsBase
{ {
unsigned int min_features_for_keyframe; ///< minimum nbr. of features to vote for keyframe unsigned int min_features_for_keyframe; ///< minimum nbr. of features to vote for keyframe
unsigned int max_new_features; int max_new_features; ///< maximum nbr. of new features to be processed when adding a keyframe (-1: unlimited. 0: none.)
}; };
WOLF_PTR_TYPEDEFS(ProcessorTracker); WOLF_PTR_TYPEDEFS(ProcessorTracker);
...@@ -181,7 +181,7 @@ class ProcessorTracker : public ProcessorBase ...@@ -181,7 +181,7 @@ class ProcessorTracker : public ProcessorBase
/**\brief Process new Features or Landmarks /**\brief Process new Features or Landmarks
* *
*/ */
virtual unsigned int processNew(const unsigned int& _max_features) = 0; virtual unsigned int processNew(const int& _max_features) = 0;
/**\brief Creates and adds factors from last_ to origin_ /**\brief Creates and adds factors from last_ to origin_
* *
......
...@@ -143,17 +143,19 @@ class ProcessorTrackerFeature : public ProcessorTracker ...@@ -143,17 +143,19 @@ class ProcessorTrackerFeature : public ProcessorTracker
/**\brief Process new Features /**\brief Process new Features
* *
*/ */
virtual unsigned int processNew(const unsigned int& _max_features); virtual unsigned int processNew(const int& _max_features);
/** \brief Detect new Features /** \brief Detect new Features
* \param _max_features maximum number of features detected * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_last_, the list of newly detected features. * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_,
* the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_new_features, FeatureBasePtrList& _features_incoming_out) = 0; virtual unsigned int detectNewFeatures(const int& _max_new_features, FeatureBasePtrList& _features_last_out) = 0;
/** \brief Create a new factor and link it to the wolf tree /** \brief Create a new factor and link it to the wolf tree
* \param _feature_ptr pointer to the parent Feature * \param _feature_ptr pointer to the parent Feature
......
...@@ -106,16 +106,16 @@ class ProcessorTrackerFeatureCorner : public ProcessorTrackerFeature ...@@ -106,16 +106,16 @@ class ProcessorTrackerFeatureCorner : public ProcessorTrackerFeature
virtual bool voteForKeyFrame(); virtual bool voteForKeyFrame();
/** \brief Detect new Features /** \brief Detect new Features
* \param _capture_ptr Capture for feature detection. Defaults to incoming_ptr_. * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _new_features_list The list of detected Features. Defaults to member new_features_list_. * \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_list_, the list of newly detected features, * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_,
* to be used for landmark initialization. * the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out); virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out);
virtual FactorBasePtr createFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr); virtual FactorBasePtr createFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr);
......
...@@ -56,16 +56,16 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature ...@@ -56,16 +56,16 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature
virtual bool voteForKeyFrame(); virtual bool voteForKeyFrame();
/** \brief Detect new Features /** \brief Detect new Features
* \param _capture_ptr Capture for feature detection. Defaults to incoming_ptr_. * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _new_features_list The list of detected Features. Defaults to member new_features_list_. * \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_list_, the list of newly detected features, * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_,
* to be used for landmark initialization. * the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out); virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out);
virtual FactorBasePtr createFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr); virtual FactorBasePtr createFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr);
......
...@@ -112,14 +112,16 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature ...@@ -112,14 +112,16 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature
virtual bool voteForKeyFrame(); virtual bool voteForKeyFrame();
/** \brief Detect new Features /** \brief Detect new Features
* \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _features_last_out The list of detected Features.
* \return The number of detected Features.
* *
* This is intended to create Features that are not among the Features already known in the Map. * This function detects Features that do not correspond to known Features/Landmarks in the system.
*
* This function sets new_features_last_, the list of newly detected features.
* *
* \return The number of detected Features. * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_,
* the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_new_features, FeatureBasePtrList& _features_incoming_out); virtual unsigned int detectNewFeatures(const int& _max_new_features, FeatureBasePtrList& _features_incoming_out);
virtual FactorBasePtr createFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr); virtual FactorBasePtr createFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr);
......
...@@ -85,14 +85,16 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature ...@@ -85,14 +85,16 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature
virtual bool voteForKeyFrame() override; virtual bool voteForKeyFrame() override;
/** \brief Detect new Features /** \brief Detect new Features
* \param _max_features maximum number of features detected * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_last_, the list of newly detected features. * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_,
* the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_new_features, FeatureBasePtrList& _features_incoming_out) override; virtual unsigned int detectNewFeatures(const int& _max_new_features, FeatureBasePtrList& _features_incoming_out) override;
/** \brief Create a new factor and link it to the wolf tree /** \brief Create a new factor and link it to the wolf tree
* \param _feature_ptr pointer to the parent Feature * \param _feature_ptr pointer to the parent Feature
......
...@@ -128,18 +128,19 @@ class ProcessorTrackerLandmark : public ProcessorTracker ...@@ -128,18 +128,19 @@ class ProcessorTrackerLandmark : public ProcessorTracker
/** \brief Process new Features /** \brief Process new Features
* *
*/ */
unsigned int processNew(const unsigned int& _max_features); unsigned int processNew(const int& _max_features);
/** \brief Detect new Features /** \brief Detect new Features
* \param _max_features The maximum number of features to detect. * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_list_, the list of newly detected features, * The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_,
* to be used for landmark initialization. * the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out) = 0; virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out) = 0;
/** \brief Creates a landmark for each of new_features_last_ /** \brief Creates a landmark for each of new_features_last_
**/ **/
......
...@@ -135,16 +135,16 @@ class ProcessorTrackerLandmarkCorner : public ProcessorTrackerLandmark ...@@ -135,16 +135,16 @@ class ProcessorTrackerLandmarkCorner : public ProcessorTrackerLandmark
virtual bool voteForKeyFrame(); virtual bool voteForKeyFrame();
/** \brief Detect new Features /** \brief Detect new Features
* \param _capture_ptr Capture for feature detection. Defaults to incoming_ptr_. * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _new_features_list The list of detected Features. Defaults to member new_features_list_. * \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_list_, the list of newly detected features, * The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_,
* to be used for landmark initialization. * the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out); virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out);
/** \brief Create one landmark /** \brief Create one landmark
* *
......
...@@ -48,15 +48,16 @@ class ProcessorTrackerLandmarkDummy : public ProcessorTrackerLandmark ...@@ -48,15 +48,16 @@ class ProcessorTrackerLandmarkDummy : public ProcessorTrackerLandmark
virtual bool voteForKeyFrame(); virtual bool voteForKeyFrame();
/** \brief Detect new Features /** \brief Detect new Features
* \param _max_features maximum number of features to detect. * \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _features_last_out The list of detected Features.
* \return The number of detected Features. * \return The number of detected Features.
* *
* This function detects Features that do not correspond to known Features/Landmarks in the system. * This function detects Features that do not correspond to known Features/Landmarks in the system.
* *
* The function sets the member new_features_list_, the list of newly detected features, * The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_,
* to be used for landmark initialization. * the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out); virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out);
/** \brief Create one landmark /** \brief Create one landmark
* *
......
...@@ -128,14 +128,16 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark ...@@ -128,14 +128,16 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark
virtual bool voteForKeyFrame(); virtual bool voteForKeyFrame();
/** \brief Detect new Features /** \brief Detect new Features
* \param _max_features maximum number of features detected (-1: unlimited. 0: none)
* \param _features_last_out The list of detected Features.
* \return The number of detected Features.
* *
* This is intended to create Features that are not among the Features already known in the Map. * This function detects Features that do not correspond to known Features/Landmarks in the system.
*
* This function sets new_features_last_, the list of newly detected features.
* *
* \return The number of detected Features. * The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_,
* the list of newly detected features of the capture last_ptr_.
*/ */
virtual unsigned int detectNewFeatures(const unsigned int& _max_new_features, FeatureBasePtrList& _features_incoming_out); virtual unsigned int detectNewFeatures(const int& _max_new_features, FeatureBasePtrList& _features_incoming_out);
/** \brief Create one landmark /** \brief Create one landmark
* *
......
...@@ -21,7 +21,7 @@ ProcessorTrackerFeature::~ProcessorTrackerFeature() ...@@ -21,7 +21,7 @@ ProcessorTrackerFeature::~ProcessorTrackerFeature()
{ {
} }
unsigned int ProcessorTrackerFeature::processNew(const unsigned int& _max_new_features) unsigned int ProcessorTrackerFeature::processNew(const int& _max_new_features)
{ {
/* Rationale: A keyFrame will be created using the last Capture. /* Rationale: A keyFrame will be created using the last Capture.
* First, we work on the last Capture to detect new Features, * First, we work on the last Capture to detect new Features,
......
...@@ -107,10 +107,13 @@ bool ProcessorTrackerFeatureCorner::voteForKeyFrame() ...@@ -107,10 +107,13 @@ bool ProcessorTrackerFeatureCorner::voteForKeyFrame()
return incoming_ptr_->getFeatureList().size() < params_tracker_feature_corner_->n_corners_th; return incoming_ptr_->getFeatureList().size() < params_tracker_feature_corner_->n_corners_th;
} }
unsigned int ProcessorTrackerFeatureCorner::detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerFeatureCorner::detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out)
{ {
// in corners_last_ remain all not tracked corners // in corners_last_ remain all not tracked corners
_features_incoming_out = std::move(corners_last_); _features_incoming_out = std::move(corners_last_);
if (_max_features != -1 && _features_incoming_out.size() > _max_features)
_features_incoming_out.resize(_max_features);
return _features_incoming_out.size(); return _features_incoming_out.size();
} }
......
...@@ -49,12 +49,19 @@ bool ProcessorTrackerFeatureDummy::voteForKeyFrame() ...@@ -49,12 +49,19 @@ bool ProcessorTrackerFeatureDummy::voteForKeyFrame()
return incoming_ptr_->getFeatureList().size() < params_tracker_feature_->min_features_for_keyframe; return incoming_ptr_->getFeatureList().size() < params_tracker_feature_->min_features_for_keyframe;
} }
unsigned int ProcessorTrackerFeatureDummy::detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerFeatureDummy::detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out)
{ {
unsigned int max_features = _max_features;
if (max_features == -1)
{
max_features = 10;
WOLF_INFO("max_features unlimited, setting it to " , max_features);
}
WOLF_INFO("Detecting " , _max_features , " new features..." ); WOLF_INFO("Detecting " , _max_features , " new features..." );
// detecting new features // detecting new features
for (unsigned int i = 1; i <= _max_features; i++) for (unsigned int i = 0; i < max_features; i++)
{ {
n_feature_++; n_feature_++;
FeatureBasePtr ftr(std::make_shared<FeatureBase>("POINT IMAGE", FeatureBasePtr ftr(std::make_shared<FeatureBase>("POINT IMAGE",
......
...@@ -244,7 +244,7 @@ bool ProcessorTrackerFeatureImage::correctFeatureDrift(const FeatureBasePtr _ori ...@@ -244,7 +244,7 @@ bool ProcessorTrackerFeatureImage::correctFeatureDrift(const FeatureBasePtr _ori
} }
} }
unsigned int ProcessorTrackerFeatureImage::detectNewFeatures(const unsigned int& _max_new_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerFeatureImage::detectNewFeatures(const int& _max_new_features, FeatureBasePtrList& _features_incoming_out)
{ {
cv::Rect roi; cv::Rect roi;
KeyPointVector new_keypoints; KeyPointVector new_keypoints;
...@@ -252,7 +252,7 @@ unsigned int ProcessorTrackerFeatureImage::detectNewFeatures(const unsigned int& ...@@ -252,7 +252,7 @@ unsigned int ProcessorTrackerFeatureImage::detectNewFeatures(const unsigned int&
cv::KeyPointsFilter keypoint_filter; cv::KeyPointsFilter keypoint_filter;
unsigned int n_new_features = 0; unsigned int n_new_features = 0;
for (unsigned int n_iterations = 0; _max_new_features == 0 || n_iterations < _max_new_features; n_iterations++) for (unsigned int n_iterations = 0; _max_new_features == -1 || n_iterations < _max_new_features; n_iterations++)
{ {
if (active_search_ptr_->pickEmptyRoi(roi)) if (active_search_ptr_->pickEmptyRoi(roi))
......
...@@ -134,7 +134,7 @@ bool ProcessorTrackerFeatureTrifocal::isInlier(const cv::KeyPoint& _kp_last, con ...@@ -134,7 +134,7 @@ bool ProcessorTrackerFeatureTrifocal::isInlier(const cv::KeyPoint& _kp_last, con
} }
unsigned int ProcessorTrackerFeatureTrifocal::detectNewFeatures(const unsigned int& _max_new_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerFeatureTrifocal::detectNewFeatures(const int& _max_new_features, FeatureBasePtrList& _features_incoming_out)
{ {
// // DEBUG ===================================== // // DEBUG =====================================
// clock_t debug_tStart; // clock_t debug_tStart;
...@@ -143,7 +143,7 @@ unsigned int ProcessorTrackerFeatureTrifocal::detectNewFeatures(const unsigned i ...@@ -143,7 +143,7 @@ unsigned int ProcessorTrackerFeatureTrifocal::detectNewFeatures(const unsigned i
// WOLF_TRACE("======== DetectNewFeatures ========="); // WOLF_TRACE("======== DetectNewFeatures =========");
// // =========================================== // // ===========================================
for (unsigned int n_iterations = 0; n_iterations < _max_new_features; ++n_iterations) for (unsigned int n_iterations = 0; _max_new_features == -1 || n_iterations < _max_new_features; ++n_iterations)
{ {
Eigen::Vector2i cell_last; Eigen::Vector2i cell_last;
if (capture_last_->grid_features_->pickEmptyTrackingCell(cell_last)) if (capture_last_->grid_features_->pickEmptyTrackingCell(cell_last))
......
...@@ -60,7 +60,7 @@ void ProcessorTrackerLandmark::resetDerived() ...@@ -60,7 +60,7 @@ void ProcessorTrackerLandmark::resetDerived()
// std::cout << "\t" << match.first->id() << " to " << match.second.landmark_ptr_->id() << std::endl; // std::cout << "\t" << match.first->id() << " to " << match.second.landmark_ptr_->id() << std::endl;
} }
unsigned int ProcessorTrackerLandmark::processNew(const unsigned int& _max_features) unsigned int ProcessorTrackerLandmark::processNew(const int& _max_features)
{ {
/* Rationale: A keyFrame will be created using the last Capture. /* Rationale: A keyFrame will be created using the last Capture.
* First, we work on this Capture to detect new Features, * First, we work on this Capture to detect new Features,
......
...@@ -375,10 +375,13 @@ LandmarkBasePtr ProcessorTrackerLandmarkCorner::createLandmark(FeatureBasePtr _f ...@@ -375,10 +375,13 @@ LandmarkBasePtr ProcessorTrackerLandmarkCorner::createLandmark(FeatureBasePtr _f
_feature_ptr->getMeasurement()(3)); _feature_ptr->getMeasurement()(3));
} }
unsigned int ProcessorTrackerLandmarkCorner::detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerLandmarkCorner::detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out)
{ {
// already computed since each scan is computed in preprocess() // in corners_last_ remain all not tracked corners, already computed in preprocess()
_features_incoming_out = std::move(corners_last_); _features_incoming_out = std::move(corners_last_);
if (_max_features != -1 && _features_incoming_out.size() > _max_features)
_features_incoming_out.resize(_max_features);
return _features_incoming_out.size(); return _features_incoming_out.size();
} }
......
...@@ -63,16 +63,25 @@ bool ProcessorTrackerLandmarkDummy::voteForKeyFrame() ...@@ -63,16 +63,25 @@ bool ProcessorTrackerLandmarkDummy::voteForKeyFrame()
return incoming_ptr_->getFeatureList().size() < 4; return incoming_ptr_->getFeatureList().size() < 4;
} }
unsigned int ProcessorTrackerLandmarkDummy::detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerLandmarkDummy::detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out)
{ {
std::cout << "\tProcessorTrackerLandmarkDummy::detectNewFeatures" << std::endl; std::cout << "\tProcessorTrackerLandmarkDummy::detectNewFeatures" << std::endl;
// detecting 5 new features unsigned int max_features = _max_features;
for (unsigned int i = 1; i <= _max_features; i++)
if (max_features == -1)
{
max_features = 10;
WOLF_INFO("max_features unlimited, setting it to " , max_features);
}
// detecting new features
for (unsigned int i = 1; i <= max_features; i++)
{ {
n_feature_++; n_feature_++;
_features_incoming_out.push_back( _features_incoming_out.push_back(std::make_shared<FeatureBase>("POINT IMAGE",
std::make_shared<FeatureBase>("POINT IMAGE", n_feature_ * Eigen::Vector1s::Ones(), Eigen::MatrixXs::Ones(1, 1))); n_feature_ * Eigen::Vector1s::Ones(),
Eigen::MatrixXs::Ones(1, 1)));
std::cout << "\t\tfeature " << _features_incoming_out.back()->getMeasurement() << " detected!" << std::endl; std::cout << "\t\tfeature " << _features_incoming_out.back()->getMeasurement() << " detected!" << std::endl;
} }
return _features_incoming_out.size(); return _features_incoming_out.size();
......
...@@ -225,7 +225,7 @@ bool ProcessorTrackerLandmarkImage::voteForKeyFrame() ...@@ -225,7 +225,7 @@ bool ProcessorTrackerLandmarkImage::voteForKeyFrame()
// return landmarks_tracked_ < params_tracker_landmark_image_->min_features_for_keyframe; // return landmarks_tracked_ < params_tracker_landmark_image_->min_features_for_keyframe;
} }
unsigned int ProcessorTrackerLandmarkImage::detectNewFeatures(const unsigned int& _max_features, FeatureBasePtrList& _features_incoming_out) unsigned int ProcessorTrackerLandmarkImage::detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out)
{ {
cv::Rect roi; cv::Rect roi;
KeyPointVector new_keypoints; KeyPointVector new_keypoints;
...@@ -233,7 +233,7 @@ unsigned int ProcessorTrackerLandmarkImage::detectNewFeatures(const unsigned int ...@@ -233,7 +233,7 @@ unsigned int ProcessorTrackerLandmarkImage::detectNewFeatures(const unsigned int
cv::KeyPointsFilter keypoint_filter; cv::KeyPointsFilter keypoint_filter;
unsigned int n_new_features = 0; unsigned int n_new_features = 0;
for (unsigned int n_iterations = 0; n_iterations < _max_features; n_iterations++) for (unsigned int n_iterations = 0; _max_features == -1 || n_iterations < _max_features; n_iterations++)
{ {
if (active_search_ptr_->pickEmptyRoi(roi)) if (active_search_ptr_->pickEmptyRoi(roi))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment