Fixed zero-ed 3D words when receiving odometry's 2D keypoints > Kp/MaxFeatures and empty 3D points

This commit is contained in:
matlabbe
2021-01-09 20:52:34 -05:00
parent 1a967127d9
commit 94cf1dfd32

View File

@@ -298,7 +298,11 @@ void Feature2D::limitKeypoints(std::vector<cv::KeyPoint> & keypoints, std::vecto
int removed = (int)hessianMap.size()-maxKeypoints;
std::multimap<float, int>::reverse_iterator iter = hessianMap.rbegin();
std::vector<cv::KeyPoint> kptsTmp(maxKeypoints);
std::vector<cv::Point3f> kpts3DTmp(maxKeypoints);
std::vector<cv::Point3f> kpts3DTmp;
if(!keypoints3D.empty())
{
kpts3DTmp.resize(maxKeypoints);
}
cv::Mat descriptorsTmp;
if(descriptors.rows)
{