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

added the prohibition of two matches for scan

parent cc9c7061
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
......@@ -61,18 +61,26 @@ void CornerFalko2d::findLoopClosure(LaserScan scan,LaserScanParams scanParams){
//Matching
int rows = keypointSets.size();
matchingNumber=0;
numberKeypointsMatch=0;
numberSceneMatch=0;
matchingPosition=-1;
for (int i=0; i<rows;i++){
std::vector<std::pair<int, int> > assoNN;
int NewMatchingNumber = match(keypointSets[i], keypointSet2, assoNN);
if (NewMatchingNumber > matchingNumber && NewMatchingNumber>keypointsNumberTh) {
matchingNumber=NewMatchingNumber;
if (NewMatchingNumber > numberKeypointsMatch && NewMatchingNumber>keypointsNumberTh) {
numberKeypointsMatch=NewMatchingNumber;
matchingPosition=i;
numberSceneMatch=numberSceneMatch+1;
}
}
if (numberSceneMatch>1){
numberKeypointsMatch=0;
numberSceneMatch=0;
matchingPosition=-1;
}
}
......@@ -95,7 +103,7 @@ int CornerFalko2d::evaluateNewReferenceScene(LaserScan scan,LaserScanParams scan
findLoopClosure(scan, scanParams);
if (matchingNumber < refSceneAddingTh) {
if (numberKeypointsMatch < refSceneAddingTh) {
falkolib::LaserScan scanFALKO= convert2LaserScanFALKO(scan, scanParams);
......
......@@ -98,8 +98,11 @@ public:
std::vector<std::vector<falkolib::BSC>> descriptorSets;
std::vector<falkolib::BSC>lastDescriptorSet;
// Number of Scene matched when performing the loop closure
int numberKeypointsMatch=0;
int matchingNumber;
//Number of keypoints that are matched between 2 scenes when performing the loop closure
int numberSceneMatch=0;
int scanNumber=0;
......
......@@ -45,5 +45,5 @@ int main(int argc, char** argv)
cornerMatching.findLoopClosure(scan, laserParams);
std::cout << "matching number : " << cornerMatching.matchingNumber << std::endl;
std::cout << "matching number : " << cornerMatching.numberKeypointsMatch << std::endl;
}
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