mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
SuperPoint: return at minimum 2 features or 0 (fixed crash when only one feature). Python: added main python instance from Rtabmap object (to get python instancied once for ROS). MultiSessionWidget: Fixed layout warning. Memory::computeTransform() avoid re-instanciating RegistrationVis when Reg/Strategy=1 for guess transform (to fix PyMatcher re-initialized every time). CMake: added video module to opencv required components.
This commit is contained in:
@@ -198,11 +198,20 @@ std::vector<cv::KeyPoint> SPDetector::detect(const cv::Mat &img, const cv::Mat &
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
cv::Mat descEmpty;
|
||||
NMS(keypoints_no_nms, conf, descEmpty, keypoints, descEmpty, border, dist_thresh, width, height);
|
||||
return keypoints;
|
||||
if(keypoints.size()>1)
|
||||
{
|
||||
return keypoints;
|
||||
}
|
||||
return std::vector<cv::KeyPoint>();
|
||||
}
|
||||
else {
|
||||
else if(keypoints_no_nms.size()>1)
|
||||
{
|
||||
return keypoints_no_nms;
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::vector<cv::KeyPoint>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -218,6 +227,10 @@ cv::Mat SPDetector::compute(const std::vector<cv::KeyPoint> &keypoints)
|
||||
UERROR("SPDetector has been reset before extracting the descriptors! detect() should be called before compute().");
|
||||
return cv::Mat();
|
||||
}
|
||||
if(keypoints.empty())
|
||||
{
|
||||
return cv::Mat();
|
||||
}
|
||||
if(model_.get())
|
||||
{
|
||||
cv::Mat kpt_mat(keypoints.size(), 2, CV_32F); // [n_keypoints, 2] (y, x)
|
||||
|
||||
Reference in New Issue
Block a user