mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
FlannIndex: Fixed size_t matrix allocation error on 64 bits system
This commit is contained in:
@@ -436,7 +436,7 @@ void FlannIndex::knnSearch(
|
||||
UERROR("Flann index not yet created!");
|
||||
return;
|
||||
}
|
||||
indices.create(query.rows, knn, CV_32S);
|
||||
indices.create(query.rows, knn, sizeof(size_t)==8?CV_64F:CV_32S);
|
||||
dists.create(query.rows, knn, featuresType_ == CV_8UC1?CV_32S:CV_32F);
|
||||
|
||||
rtflann::Matrix<size_t> indicesF((size_t*)indices.data, indices.rows, indices.cols);
|
||||
|
||||
@@ -760,7 +760,7 @@ std::list<int> VWDictionary::addNewWords(const cv::Mat & descriptorsIn,
|
||||
for(int j=0; j<dists.cols; ++j)
|
||||
{
|
||||
float d = dists.at<float>(i,j);
|
||||
int id = uValue(_mapIndexId, results.at<int>(i,j));
|
||||
int id = uValue(_mapIndexId, (int)results.at<size_t>(i,j));
|
||||
if(d >= 0.0f && id > 0)
|
||||
{
|
||||
fullResults.insert(std::pair<float, int>(d, id));
|
||||
@@ -1108,7 +1108,7 @@ std::vector<int> VWDictionary::findNN(const cv::Mat & queryIn) const
|
||||
for(int j=0; j<dists.cols; ++j)
|
||||
{
|
||||
float d = dists.at<float>(i,j);
|
||||
int id = uValue(_mapIndexId, results.at<int>(i,j));
|
||||
int id = uValue(_mapIndexId, (int)results.at<size_t>(i,j));
|
||||
if(d >= 0.0f && id > 0)
|
||||
{
|
||||
fullResults.insert(std::pair<float, int>(d, id));
|
||||
|
||||
Reference in New Issue
Block a user