iterative closest points
CEV ICP algorithm library
Loading...
Searching...
No Matches
feature_aware.h
Go to the documentation of this file.
1
6#include "icp/icp.h"
7#include <Eigen/Core>
8
9namespace icp {
10 class FeatureAware final : public ICP {
11 using FeatureVector = Eigen::VectorXd;
12
13 public:
14 FeatureAware(double overlap_rate, double feature_weight, int symmetric_neighbors);
15 FeatureAware(const Config& config);
17
18 void setup() override;
19 void iterate() override;
20
21 private:
22 void compute_matches();
23
24 void compute_features(const std::vector<icp::Vector>& points, Vector cm,
25 std::vector<FeatureVector>& features);
26
27 template<typename TVector>
28 Eigen::MatrixXd compute_norm_dists(const std::vector<TVector>& first,
29 const std::vector<TVector>& second) {
30 Eigen::MatrixXd norm_dists(first.size(), second.size());
31 double max_dist = std::numeric_limits<double>::min();
32 for (size_t i = 0; i < first.size(); i++) {
33 for (size_t j = 0; j < second.size(); j++) {
34 double dist = (first[i] - second[j]).norm();
35 norm_dists(i, j) = dist;
36 if (dist > max_dist) {
37 max_dist = dist;
38 }
39 }
40 }
41
42 norm_dists /= max_dist;
43 return norm_dists;
44 }
45
46 std::vector<icp::Vector> a_current;
47
48 icp::Vector b_cm;
49
50 std::vector<FeatureVector> a_features;
51 std::vector<FeatureVector> b_features;
52
53 Eigen::MatrixXd norm_feature_dists;
54
55 double overlap_rate;
56 int symmetric_neighbors;
57 double feature_weight;
58 double neighbor_weight;
59 };
60}
void setup() override
Per-method setup code.
void iterate() override
Perform one iteration of ICP for the point clouds a and b provided with ICP::begin.
Configuration for ICP instances.
Definition icp.h:81
Interface for iterative closest points.
Definition icp.h:49
Definition driver.h:12
Eigen::Vector2d Vector
Definition geo.h:15