Skip to content
Snippets Groups Projects
Commit e6ef7245 authored by Sergi Pujol's avatar Sergi Pujol
Browse files

improved function cornerFalko2d->findLoopClosure

parent 416428f0
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
...@@ -61,13 +61,28 @@ void CornerFalko2d::findLoopClosure(falkolib::LaserScan scan){ ...@@ -61,13 +61,28 @@ void CornerFalko2d::findLoopClosure(falkolib::LaserScan scan){
compute(scan, keypointSet2, descriptorSet2); compute(scan, keypointSet2, descriptorSet2);
//Matching //Matching
int rows = sizeof(keypointSets)/sizeof(keypointSets[0]); int rows = keypointSets.size();
int cols = sizeof(keypointSets)/(sizeof(int)*rows);
matchingNumber=0;
matchingPosition=-1;
for (int i=0; i<rows;i++){ for (int i=0; i<rows;i++){
std::vector<std::pair<int, int> > assoNN; std::vector<std::pair<int, int> > assoNN;
matchingNumber = match(keypointSets[i], keypointSet2, assoNN);
} int NewMatchingNumber = match(keypointSets[i], keypointSet2, assoNN);
if (NewMatchingNumber > matchingNumber ) {
matchingNumber=NewMatchingNumber;
matchingPosition=i;
}
/* for (auto& match : assoNN) {
if (match.second >= 0) {
int i1 = match.first;
int i2 = match.second;
std::cout << "i1: " << i1 << "\ti2: " << i2 << "\t keypoints distance: " << (keypoints1[i1].distance(keypoints2[i2])) << "\t CHG Distance: " << (cghDesc1[i1].distance(cghDesc2[i2])) << "\t BSC Distance: " << (bscDesc1[i1].distance(bscDesc2[i2])) << endl;
}
}
*/ }
} }
......
...@@ -82,6 +82,8 @@ public: ...@@ -82,6 +82,8 @@ public:
int scanNumber=0; int scanNumber=0;
int scansExtracted=0; int scansExtracted=0;
int matchingPosition=-1;
}; };
} /* namespace laserscanutils */ } /* namespace laserscanutils */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment