ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CorrespondenceChecker.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
16 
17 class ccPointCloud;
18 namespace cloudViewer {
19 
20 namespace pipelines {
21 namespace registration {
22 
31 public:
36  CorrespondenceChecker(bool require_pointcloud_alignment)
37  : require_pointcloud_alignment_(require_pointcloud_alignment) {}
39 
40 public:
49  virtual bool Check(const ccPointCloud &source,
50  const ccPointCloud &target,
51  const CorrespondenceSet &corres,
52  const Eigen::Matrix4d &transformation) const = 0;
53 
54 public:
58 };
59 
70 public:
75  CorrespondenceCheckerBasedOnEdgeLength(double similarity_threshold = 0.9)
76  : CorrespondenceChecker(false),
77  similarity_threshold_(similarity_threshold) {}
79 
80 public:
81  bool Check(const ccPointCloud &source,
82  const ccPointCloud &target,
83  const CorrespondenceSet &corres,
84  const Eigen::Matrix4d &transformation) const override;
85 
86 public:
92 };
93 
98 public:
102  CorrespondenceCheckerBasedOnDistance(double distance_threshold)
103  : CorrespondenceChecker(true),
104  distance_threshold_(distance_threshold) {}
106 
107 public:
108  bool Check(const ccPointCloud &source,
109  const ccPointCloud &target,
110  const CorrespondenceSet &corres,
111  const Eigen::Matrix4d &transformation) const override;
112 
113 public:
116 };
117 
125 public:
129  CorrespondenceCheckerBasedOnNormal(double normal_angle_threshold)
130  : CorrespondenceChecker(true),
131  normal_angle_threshold_(normal_angle_threshold) {}
133 
134 public:
135  bool Check(const ccPointCloud &source,
136  const ccPointCloud &target,
137  const CorrespondenceSet &corres,
138  const Eigen::Matrix4d &transformation) const override;
139 
140 public:
143 };
144 
145 } // namespace registration
146 } // namespace pipelines
147 } // namespace cloudViewer
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
bool Check(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const override
Function to check if two points can be aligned.
CorrespondenceCheckerBasedOnDistance(double distance_threshold)
Default Constructor.
Check if two point clouds build the polygons with similar edge lengths.
bool Check(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const override
Function to check if two points can be aligned.
CorrespondenceCheckerBasedOnEdgeLength(double similarity_threshold=0.9)
Default Constructor.
Class to check if two aligned point clouds have similar normals.
CorrespondenceCheckerBasedOnNormal(double normal_angle_threshold)
Parameterized Constructor.
bool Check(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const override
Function to check if two points can be aligned.
Base class that checks if two (small) point clouds can be aligned.
CorrespondenceChecker(bool require_pointcloud_alignment)
Default Constructor.
virtual bool Check(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const =0
Function to check if two points can be aligned.
std::vector< Eigen::Vector2i > CorrespondenceSet
Generic file read and write utility for python interface.