utest/ui/Matcher.cpp
Go to the documentation of this file.
1 #include "../utest.h"
2 
3 using namespace std;
4 using namespace PointMatcherSupport;
5 
6 //---------------------------
7 // Matcher modules
8 //---------------------------
9 
10 // Utility classes
11 class MatcherTest: public IcpHelper
12 {
13 
14 public:
15 
16  std::shared_ptr<PM::Matcher> testedMatcher;
17 
18  // Will be called for every tests
19  virtual void SetUp()
20  {
21  icp.setDefault();
22  // Uncomment for consol outputs
23  //setLogger(PM::get().LoggerRegistrar.create("FileLogger"));
24  }
25 
26  // Will be called for every tests
27  virtual void TearDown(){}
28 
30  {
31  testedMatcher =
32  PM::get().MatcherRegistrar.create(name, params);
33  icp.matcher = testedMatcher;
34  }
35 
36 };
37 
38 TEST_F(MatcherTest, KDTreeMatcher)
39 {
40  vector<unsigned> knn = {1, 2, 3};
41  vector<double> epsilon = {0.0, 0.2};
42  vector<double> maxDist = {1.0, 0.5};
43 
44  for(unsigned i=0; i < knn.size(); i++)
45  {
46  for(unsigned j=0; j < epsilon.size(); j++)
47  {
48  for(unsigned k=0; k < maxDist.size(); k++)
49  {
51  params["knn"] = toParam(knn[i]); // remove end parenthesis for bug
52  params["epsilon"] = toParam(epsilon[j]);
53  params["searchType"] = "1";
54  params["maxDist"] = toParam(maxDist[k]);
55 
56 
57  addFilter("KDTreeMatcher", params);
58  validate2dTransformation();
59  validate3dTransformation();
60  }
61  }
62  }
63 }
MatcherTest
Definition: utest/ui/Matcher.cpp:11
PointMatcher< float >::Parameters
Parametrizable::Parameters Parameters
alias
Definition: PointMatcher.h:186
PointMatcherSupport::toParam
std::string toParam(const S &value)
Return the string value using lexical_cast.
Definition: Parametrizable.h:123
compute_overlap.knn
int knn
Definition: compute_overlap.py:128
MatcherTest::SetUp
virtual void SetUp()
Definition: utest/ui/Matcher.cpp:19
icp_customized.name
string name
Definition: icp_customized.py:45
MatcherTest::testedMatcher
std::shared_ptr< PM::Matcher > testedMatcher
Definition: utest/ui/Matcher.cpp:16
IcpHelper
Definition: utest.h:32
TEST_F
TEST_F(MatcherTest, KDTreeMatcher)
Definition: utest/ui/Matcher.cpp:38
align_sequence.params
params
Definition: align_sequence.py:13
std
icp
Definition: icp.py:1
PointMatcher< float >::get
static const PointMatcher & get()
Return instances.
Definition: Registry.cpp:146
PointMatcherSupport
Functions and classes that are not dependant on scalar type are defined in this namespace.
Definition: Bibliography.cpp:45
MatcherTest::addFilter
void addFilter(string name, PM::Parameters params)
Definition: utest/ui/Matcher.cpp:29
MatcherTest::TearDown
virtual void TearDown()
Definition: utest/ui/Matcher.cpp:27


libpointmatcher
Author(s):
autogenerated on Mon Jan 1 2024 03:24:43