8 #include "pipelines/registration/Registration.h"
11 #include <benchmark/benchmark.h>
15 #include <Eigen/Eigen>
23 namespace registration {
37 const std::string& source_filename,
38 const std::string& target_filename,
39 const double voxel_downsample_factor) {
47 if (voxel_downsample_factor > 0.001) {
52 " VoxelDownSample: Impractical voxel size [< 0.001], skiping "
56 return std::make_tuple(source, target);
67 std::shared_ptr<TransformationEstimation> estimation;
69 estimation = std::make_shared<TransformationEstimationPointToPlane>();
71 estimation = std::make_shared<TransformationEstimationPointToPoint>();
74 Eigen::Matrix4d init_trans;
75 init_trans << 0.862, 0.011, -0.507, 0.5, -0.139, 0.967, -0.215, 0.7, 0.487,
76 0.255, 0.835, -1.4, 0.0, 0.0, 0.0, 1.0;
85 for (
auto _ : state) {
102 ->Unit(benchmark::kMillisecond);
107 ->Unit(benchmark::kMillisecond);
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
std::shared_ptr< ccPointCloud > VoxelDownSample(double voxel_size)
Function to downsample input ccPointCloud into output ccPointCloud with a voxel.
Data class for DemoICPPointClouds contains 3 point clouds of binary PCD format. This data is used in ...
std::vector< std::string > GetPaths() const
Returns list of 3 point cloud paths.
Class that defines the convergence criteria of ICP.
double inlier_rmse_
RMSE of all inlier correspondences. Lower is better.
bool ReadPointCloud(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption ¶ms)
BENCHMARK_CAPTURE(BenchmarkCreateFromPointCloudBallPivoting, Without Non Finite Points, true) -> Unit(benchmark::kMillisecond)
static std::tuple< ccPointCloud, ccPointCloud > LoadPointCloud(const std::string &source_filename, const std::string &target_filename, const double voxel_downsample_factor)
static void BenchmarkICPLegacy(benchmark::State &state, const TransformationEstimationType &type)
RegistrationResult RegistrationICP(const ccPointCloud &source, const ccPointCloud &target, double max_correspondence_distance, const Eigen::Matrix4d &init, const TransformationEstimation &estimation, const ICPConvergenceCriteria &criteria)
Functions for ICP registration.
static const int max_iterations
static const double max_correspondence_distance
static const double relative_fitness
TransformationEstimationType
static const double voxel_downsampling_factor
static const double relative_rmse
Generic file read and write utility for python interface.