diff --git a/include/vision/processor/active_search.h b/include/vision/processor/active_search.h index bdfca97a02f83ed9ee6b7055b2247a63a51330a1..bda60ffc3c9ce0778b24db4999a61feef75e7532 100644 --- a/include/vision/processor/active_search.h +++ b/include/vision/processor/active_search.h @@ -236,6 +236,13 @@ class ActiveSearchGrid { */ void blockCell(const cv::Rect & _roi); + /** + * \brief Call this after pickRoi if no point was found in the roi + * in order to avoid searching again in it. + * \param _cell the cell where nothing was found + */ + void blockCell(const Vector2i & _cell); + private: /** diff --git a/src/processor/active_search.cpp b/src/processor/active_search.cpp index 76abe9f868d315edc31cc09e953053dfe15027fd..a316781a633b81766b249b7df2b8b54cd85fc09d 100644 --- a/src/processor/active_search.cpp +++ b/src/processor/active_search.cpp @@ -131,7 +131,12 @@ void ActiveSearchGrid::blockCell(const cv::Rect & _roi) pix(0) = _roi.x+_roi.width/2; pix(1) = _roi.y+_roi.height/2; Eigen::Vector2i cell = coords2cell(pix(0), pix(1)); - projections_count_(cell(0), cell(1)) = -1; + blockCell(cell); +} + +void ActiveSearchGrid::blockCell(const cv::Rect & _cell) +{ + projections_count_(_cell(0), _cell(1)) = -1; }