mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-07 18:47:48 +08:00
* Fixing empty descriptors on bad signatures (#1714), (bug from #1698) * PyDetector: dont assert (just error) if descriptors/keypoints don't match. SuperPoint approaches: try re-initializing superpoint detection on the provided image if descriptors could not be fetched the first time (auto recover).
This commit is contained in:
@@ -247,7 +247,15 @@ std::vector<cv::KeyPoint> PyDetector::generateKeypointsImpl(const cv::Mat & imag
|
||||
|
||||
cv::Mat PyDetector::generateDescriptorsImpl(const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints) const
|
||||
{
|
||||
UASSERT((int)keypoints.size() == descriptors_.rows);
|
||||
if(!keypoints.empty() && (int)keypoints.size() != descriptors_.rows)
|
||||
{
|
||||
UERROR("The number of keypoints (%ld) doesn't match the number of buffered "
|
||||
"descriptors (%d). PyDetector's descriptors extraction should "
|
||||
"be called right after keypoints detection, with same keypoints "
|
||||
"returned by the detection. Returning empty descriptors.",
|
||||
keypoints.size(), descriptors_.rows);
|
||||
return cv::Mat();
|
||||
}
|
||||
return descriptors_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user