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

work in progress

parent c0889682
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
......@@ -63,7 +63,7 @@ struct ParameterLoopClosureFalko {
// matcher threshold Default
double matcher_distance_th_ = 0.2;
int keypoints_number_th_ = 5;
int match_type = 1; // match_type=1-> uses keypoints and descriptors for
int match_type_ = 1; // match_type=1-> uses keypoints and descriptors for
// matching. match_type=2-> uses only keypoints for
// matching
......@@ -110,6 +110,7 @@ public:
matcher_.setDistanceThreshold(_param.matcher_distance_th_);
//matcher_desc_.setDistanceThreshold(_param.matcher_distance_th_);
keypoints_number_th_ = _param.keypoints_number_th_;
match_type_=_param.match_type_;
};
/** \brief Destructor
......@@ -152,23 +153,24 @@ public:
std::vector<std::pair<int, int>> asso_nn;
auto scene_1_falko = std::static_pointer_cast<SceneFalko<D>>(_scene_1);
auto scene_2_falko = std::static_pointer_cast<SceneFalko<D>>(_scene_2);
int match_type = 1;
int matching_number;
if (match_type = 1) {
if (match_type_ == 1) {
matching_number = matcher_.match(scene_1_falko->keypoints_list_,
scene_2_falko->keypoints_list_, asso_nn);
} else if (match_type = 2) {
std::cout << "AAAA" << std::endl;
} else if (match_type_ == 2) {
matching_number = matcher_.match(
scene_1_falko->keypoints_list_, scene_1_falko->descriptors_list_,
scene_2_falko->keypoints_list_, scene_2_falko->descriptors_list_,
asso_nn);
std::cout << "BBB" << std::endl;
} /*else if (match_type = 3) {
} /*else if (match_type_ = 3) {
matching_number = matcher_desc_.match(scene_1_falko->descriptors_list_,
scene_2_falko->descriptors_list_, asso_nn);
}
*/
std::cout << "matching_number : " << matching_number << std::endl;
auto new_match = std::make_shared<MatchLoopClosure>();
new_match->keypoints_number_match = matching_number;
if (matching_number > keypoints_number_th_) {
......@@ -182,7 +184,10 @@ public:
new_match->score = (double)matching_number /
(double)std::min(scene_1_falko->keypoints_list_.size(),
scene_2_falko->keypoints_list_.size());
std::cout << "score : " << new_match->score << std::endl;
std::cout << "matching_number : " << matching_number << std::endl;
std::cout << "kp1 : " << scene_1_falko->keypoints_list_.size() << std::endl;
std::cout << "kp2 : " << scene_2_falko->keypoints_list_.size() << std::endl;
return new_match;
}
......@@ -206,6 +211,7 @@ public:
}
*/
int keypoints_number_th_;
int match_type_;
};
......
......@@ -13,7 +13,6 @@
#include <memory>
#include <tuple>
#include "scene_base.h"
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