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