cpd  0.5.1
Coherent Point Drift: C++ library for point set registration
gauss_transform_fgt.hpp
Go to the documentation of this file.
1 // cpd - Coherent Point Drift
2 // Copyright (C) 2017 Pete Gadomski <pete.gadomski@gmail.com>
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License along
15 // with this program; if not, write to the Free Software Foundation, Inc.,
16 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
21 
22 #pragma once
23 
24 #include <cpd/gauss_transform.hpp>
25 #include <fgt.hpp>
26 
27 namespace cpd {
28 
30 enum FgtMethod {
37 };
38 
42 const double DEFAULT_BREAKPOINT = 0.2;
44 const double DEFAULT_EPSILON = 1e-4;
45 
48 public:
50  : GaussTransform()
51  , m_breakpoint(DEFAULT_BREAKPOINT)
52  , m_epsilon(DEFAULT_EPSILON)
53  , m_method(DEFAULT_FGT_METHOD) {}
54 
57  m_breakpoint = breakpoint;
58  return *this;
59  }
60 
63  m_epsilon = epsilon;
64  return *this;
65  }
66 
69  m_method = method;
70  return *this;
71  }
72 
73  Probabilities compute(const Matrix& fixed, const Matrix& moving,
74  double sigma2, double outliers) const;
75 
76 private:
77  std::unique_ptr<fgt::Transform> create_transform(const Matrix& points,
78  double bandwidth) const;
79 
80  double m_breakpoint;
81  double m_epsilon;
82  FgtMethod m_method;
83 };
84 } // namespace cpd
GaussTransformFgt & breakpoint(double breakpoint)
Sets the ifgt->direct-tree breakpoint.
Definition: gauss_transform_fgt.hpp:56
Switch between direct-tree and ifgt at a certain breakpoint.
Definition: gauss_transform_fgt.hpp:36
const double DEFAULT_EPSILON
The default fgt epsilon.
Definition: gauss_transform_fgt.hpp:44
Abstract base class for Gauss transforms.
Definition: gauss_transform.hpp:46
Use only the direct-tree fgt method.
Definition: gauss_transform_fgt.hpp:32
Eigen::MatrixXd Matrix
Our base matrix class.
Definition: matrix.hpp:29
Basic correspondence/error calculation between two datasets, using the direct method of the Gauss tra...
GaussTransformFgt & epsilon(double epsilon)
Sets the epsilon.
Definition: gauss_transform_fgt.hpp:62
Probabilities compute(const Matrix &fixed, const Matrix &moving, double sigma2, double outliers) const
Computes the Gauss transform.
GaussTransformFgt & method(FgtMethod method)
Sets the method.
Definition: gauss_transform_fgt.hpp:68
The Gauss transform using the fgt library.
Definition: gauss_transform_fgt.hpp:47
FgtMethod
The method(s) by which the fgt Gauss transform will compute the differences.
Definition: gauss_transform_fgt.hpp:30
Top-level cpd namespace.
Definition: affine.hpp:26
const double DEFAULT_BREAKPOINT
The default switched fgt breakpoint.
Definition: gauss_transform_fgt.hpp:42
Probability matrices produced by comparing two data sets with a GaussTransform.
Definition: gauss_transform.hpp:32
Use only the improved fast Gauss transform method.
Definition: gauss_transform_fgt.hpp:34
const FgtMethod DEFAULT_FGT_METHOD
The default fgt method.
Definition: gauss_transform_fgt.hpp:40