diff --git a/include/base/processor/processor_tracker.h b/include/base/processor/processor_tracker.h index 2461a69fe70597ff5a4b97f9b331a8254f66c6cf..38dc26b30d80c419c69f3640c71645352afa6f66 100644 --- a/include/base/processor/processor_tracker.h +++ b/include/base/processor/processor_tracker.h @@ -18,7 +18,7 @@ WOLF_STRUCT_PTR_TYPEDEFS(ProcessorParamsTracker); struct ProcessorParamsTracker : public ProcessorParamsBase { 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); @@ -181,7 +181,7 @@ class ProcessorTracker : public ProcessorBase /**\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_ * diff --git a/include/base/processor/processor_tracker_feature.h b/include/base/processor/processor_tracker_feature.h index d3b0eedd6c9627bb0f56c86689f6f3dada9220f5..c743eed17a62e6f506ac0d7adb01354ee4d4d011 100644 --- a/include/base/processor/processor_tracker_feature.h +++ b/include/base/processor/processor_tracker_feature.h @@ -143,17 +143,19 @@ class ProcessorTrackerFeature : public ProcessorTracker /**\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 - * \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. * * 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 * \param _feature_ptr pointer to the parent Feature diff --git a/include/base/processor/processor_tracker_feature_corner.h b/include/base/processor/processor_tracker_feature_corner.h index e0c2ecbad2f1b89d8e11b15ea174714066ea4f58..63ef69245d53cb14520d8f5b16759b8b34b230d2 100644 --- a/include/base/processor/processor_tracker_feature_corner.h +++ b/include/base/processor/processor_tracker_feature_corner.h @@ -106,16 +106,16 @@ class ProcessorTrackerFeatureCorner : public ProcessorTrackerFeature virtual bool voteForKeyFrame(); /** \brief Detect new Features - * \param _capture_ptr Capture for feature detection. Defaults to incoming_ptr_. - * \param _new_features_list The list of detected Features. Defaults to member new_features_list_. + * \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 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, - * to be used for landmark initialization. + * 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_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); diff --git a/include/base/processor/processor_tracker_feature_dummy.h b/include/base/processor/processor_tracker_feature_dummy.h index 586cd57d716519a45f01f66050f39f2bb45f6bee..419c31f5d31b81211c2b9cf15048c559103356ae 100644 --- a/include/base/processor/processor_tracker_feature_dummy.h +++ b/include/base/processor/processor_tracker_feature_dummy.h @@ -56,16 +56,16 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature virtual bool voteForKeyFrame(); /** \brief Detect new Features - * \param _capture_ptr Capture for feature detection. Defaults to incoming_ptr_. - * \param _new_features_list The list of detected Features. Defaults to member new_features_list_. + * \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 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, - * to be used for landmark initialization. + * 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_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); diff --git a/include/base/processor/processor_tracker_feature_image.h b/include/base/processor/processor_tracker_feature_image.h index 800ca1211fbdcdd3d8f99781be90d4ddfdbfad11..25e2c629157033508b32bba6e80c910510ca8e16 100644 --- a/include/base/processor/processor_tracker_feature_image.h +++ b/include/base/processor/processor_tracker_feature_image.h @@ -112,14 +112,16 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature virtual bool voteForKeyFrame(); /** \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 sets new_features_last_, the list of newly detected features. + * This function detects Features that do not correspond to known Features/Landmarks in the system. * - * \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); diff --git a/include/base/processor/processor_tracker_feature_trifocal.h b/include/base/processor/processor_tracker_feature_trifocal.h index dba9e91714a2736b7bae8a970dc5f8cde9cc05d6..52b6d902be1fa4b33f4730bcdf90a87e646bd8ea 100644 --- a/include/base/processor/processor_tracker_feature_trifocal.h +++ b/include/base/processor/processor_tracker_feature_trifocal.h @@ -85,14 +85,16 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature virtual bool voteForKeyFrame() override; /** \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. * * 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 * \param _feature_ptr pointer to the parent Feature diff --git a/include/base/processor/processor_tracker_landmark.h b/include/base/processor/processor_tracker_landmark.h index 23e8132e308138b41b9c2e79553c82e4cb4b03ba..35a99280c4a2fc9b72bce7dbc00f6f937bcfa993 100644 --- a/include/base/processor/processor_tracker_landmark.h +++ b/include/base/processor/processor_tracker_landmark.h @@ -128,18 +128,19 @@ class ProcessorTrackerLandmark : public ProcessorTracker /** \brief Process new Features * */ - unsigned int processNew(const unsigned int& _max_features); + unsigned int processNew(const int& _max_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. * * 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, - * to be used for landmark initialization. + * 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_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_ **/ diff --git a/include/base/processor/processor_tracker_landmark_corner.h b/include/base/processor/processor_tracker_landmark_corner.h index a25a2646f21efd437201b8cac0c0899164a07597..83be3c837aa8c2f26f57ceb8322a3897303096ad 100644 --- a/include/base/processor/processor_tracker_landmark_corner.h +++ b/include/base/processor/processor_tracker_landmark_corner.h @@ -135,16 +135,16 @@ class ProcessorTrackerLandmarkCorner : public ProcessorTrackerLandmark virtual bool voteForKeyFrame(); /** \brief Detect new Features - * \param _capture_ptr Capture for feature detection. Defaults to incoming_ptr_. - * \param _new_features_list The list of detected Features. Defaults to member new_features_list_. + * \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 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, - * to be used for landmark initialization. + * 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_features, FeatureBasePtrList& _features_incoming_out); + virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out); /** \brief Create one landmark * diff --git a/include/base/processor/processor_tracker_landmark_dummy.h b/include/base/processor/processor_tracker_landmark_dummy.h index 82b446c47d15b282d985a5d6020a9f33c9d79936..c0c3424cb0983f352d6976a7bee0ec07af9bdaa2 100644 --- a/include/base/processor/processor_tracker_landmark_dummy.h +++ b/include/base/processor/processor_tracker_landmark_dummy.h @@ -48,15 +48,16 @@ class ProcessorTrackerLandmarkDummy : public ProcessorTrackerLandmark virtual bool voteForKeyFrame(); /** \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. * * 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, - * to be used for landmark initialization. + * 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_features, FeatureBasePtrList& _features_incoming_out); + virtual unsigned int detectNewFeatures(const int& _max_features, FeatureBasePtrList& _features_incoming_out); /** \brief Create one landmark * diff --git a/include/base/processor/processor_tracker_landmark_image.h b/include/base/processor/processor_tracker_landmark_image.h index d58920cc10b943c74a27dd1c3f61946624747133..afdc8eff9200218c2856ee397aac879960a146d2 100644 --- a/include/base/processor/processor_tracker_landmark_image.h +++ b/include/base/processor/processor_tracker_landmark_image.h @@ -128,14 +128,16 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark virtual bool voteForKeyFrame(); /** \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 sets new_features_last_, the list of newly detected features. + * This function detects Features that do not correspond to known Features/Landmarks in the system. * - * \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 * diff --git a/src/processor/processor_tracker_feature.cpp b/src/processor/processor_tracker_feature.cpp index 0ee10e6f75b5fa6e843421eaba7728edc7b2f4ea..793b279883beaa3411cedc781e128da718fcc178 100644 --- a/src/processor/processor_tracker_feature.cpp +++ b/src/processor/processor_tracker_feature.cpp @@ -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. * First, we work on the last Capture to detect new Features, diff --git a/src/processor/processor_tracker_feature_corner.cpp b/src/processor/processor_tracker_feature_corner.cpp index 4414d8caf499e187e28961b54f8a65e80455716a..9218dba63738e88a65e2fcf3572ed2a1b5757237 100644 --- a/src/processor/processor_tracker_feature_corner.cpp +++ b/src/processor/processor_tracker_feature_corner.cpp @@ -107,10 +107,13 @@ bool ProcessorTrackerFeatureCorner::voteForKeyFrame() 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 _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(); } diff --git a/src/processor/processor_tracker_feature_dummy.cpp b/src/processor/processor_tracker_feature_dummy.cpp index 060b54e83a3aba8e7b483c2e2678b88b7e468678..b5b225f8490b8cf4b4f6823be870fc3f22ab8df7 100644 --- a/src/processor/processor_tracker_feature_dummy.cpp +++ b/src/processor/processor_tracker_feature_dummy.cpp @@ -49,12 +49,19 @@ bool ProcessorTrackerFeatureDummy::voteForKeyFrame() 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..." ); // detecting new features - for (unsigned int i = 1; i <= _max_features; i++) + for (unsigned int i = 0; i < max_features; i++) { n_feature_++; FeatureBasePtr ftr(std::make_shared<FeatureBase>("POINT IMAGE", diff --git a/src/processor/processor_tracker_feature_image.cpp b/src/processor/processor_tracker_feature_image.cpp index 3f6bec8fe828580d8b04e5b0c390a8441cc24a9e..c2f68524b6fcae33ff95a838601618a613784ff9 100644 --- a/src/processor/processor_tracker_feature_image.cpp +++ b/src/processor/processor_tracker_feature_image.cpp @@ -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; KeyPointVector new_keypoints; @@ -252,7 +252,7 @@ unsigned int ProcessorTrackerFeatureImage::detectNewFeatures(const unsigned int& cv::KeyPointsFilter keypoint_filter; 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)) diff --git a/src/processor/processor_tracker_feature_trifocal.cpp b/src/processor/processor_tracker_feature_trifocal.cpp index 980c652af00ecb490250ac0baabb375ddf5ba98e..620cb4c05988e4552232c78b14d3a8b6bab072ee 100644 --- a/src/processor/processor_tracker_feature_trifocal.cpp +++ b/src/processor/processor_tracker_feature_trifocal.cpp @@ -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 ===================================== // clock_t debug_tStart; @@ -143,7 +143,7 @@ unsigned int ProcessorTrackerFeatureTrifocal::detectNewFeatures(const unsigned i // 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; if (capture_last_->grid_features_->pickEmptyTrackingCell(cell_last)) diff --git a/src/processor/processor_tracker_landmark.cpp b/src/processor/processor_tracker_landmark.cpp index d19610391edb98ee2565c2f477970a11c0088075..8516719fe6ea6b1bf02ab72cf4fb5f92d3d433a7 100644 --- a/src/processor/processor_tracker_landmark.cpp +++ b/src/processor/processor_tracker_landmark.cpp @@ -60,7 +60,7 @@ void ProcessorTrackerLandmark::resetDerived() // 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. * First, we work on this Capture to detect new Features, diff --git a/src/processor/processor_tracker_landmark_corner.cpp b/src/processor/processor_tracker_landmark_corner.cpp index aeba30f8e908a72a57aad5b5f617edfa249b8982..c3cac8003660aa14149fe1fa4ba2e01927772312 100644 --- a/src/processor/processor_tracker_landmark_corner.cpp +++ b/src/processor/processor_tracker_landmark_corner.cpp @@ -375,10 +375,13 @@ LandmarkBasePtr ProcessorTrackerLandmarkCorner::createLandmark(FeatureBasePtr _f _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_); + if (_max_features != -1 && _features_incoming_out.size() > _max_features) + _features_incoming_out.resize(_max_features); + return _features_incoming_out.size(); } diff --git a/src/processor/processor_tracker_landmark_dummy.cpp b/src/processor/processor_tracker_landmark_dummy.cpp index b2f92d72dd8bdc8d377905977185da6ae776688f..f514cb7efd76a571c7cd6f74c1353b21ca745050 100644 --- a/src/processor/processor_tracker_landmark_dummy.cpp +++ b/src/processor/processor_tracker_landmark_dummy.cpp @@ -63,16 +63,25 @@ bool ProcessorTrackerLandmarkDummy::voteForKeyFrame() 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; - // detecting 5 new features - for (unsigned int i = 1; i <= _max_features; i++) + unsigned int max_features = _max_features; + + 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_++; - _features_incoming_out.push_back( - std::make_shared<FeatureBase>("POINT IMAGE", n_feature_ * Eigen::Vector1s::Ones(), Eigen::MatrixXs::Ones(1, 1))); + _features_incoming_out.push_back(std::make_shared<FeatureBase>("POINT IMAGE", + n_feature_ * Eigen::Vector1s::Ones(), + Eigen::MatrixXs::Ones(1, 1))); std::cout << "\t\tfeature " << _features_incoming_out.back()->getMeasurement() << " detected!" << std::endl; } return _features_incoming_out.size(); diff --git a/src/processor/processor_tracker_landmark_image.cpp b/src/processor/processor_tracker_landmark_image.cpp index a88ec47c932f3c1c7f9098a532285c20940dbeda..6d6ca0cf23ef88cfddfefac7d4de28b2c51004d4 100644 --- a/src/processor/processor_tracker_landmark_image.cpp +++ b/src/processor/processor_tracker_landmark_image.cpp @@ -225,7 +225,7 @@ bool ProcessorTrackerLandmarkImage::voteForKeyFrame() // 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; KeyPointVector new_keypoints; @@ -233,7 +233,7 @@ unsigned int ProcessorTrackerLandmarkImage::detectNewFeatures(const unsigned int cv::KeyPointsFilter keypoint_filter; 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)) {