@@ -40,11 +40,8 @@ namespace diffCheck::registrations
4040 // voxelize at the scale of the point cloud
4141 if (voxelise)
4242 {
43- double absoluteVoxelSize =
44- voxelSize * std::abs (sourceO3D->GetMaxBound ().norm () - sourceO3D->GetMinBound ().norm ());
45-
46- sourceO3D->VoxelDownSample (absoluteVoxelSize);
47- targetO3D->VoxelDownSample (absoluteVoxelSize);
43+ sourceO3D->VoxelDownSample (voxelSize);
44+ targetO3D->VoxelDownSample (voxelSize);
4845 }
4946
5047 if (sourceO3D->normals_ .size () == 0 )
@@ -57,18 +54,15 @@ namespace diffCheck::registrations
5754 targetO3D->EstimateNormals ();
5855 }
5956
60- double absoluteRadiusKDTreeSearch =
61- radiusKDTreeSearch * std::abs (sourceO3D->GetMaxBound ().norm () - sourceO3D->GetMinBound ().norm ());
62-
6357 std::shared_ptr<open3d::pipelines::registration::Feature> sourceFPFHFeatures =
6458 open3d::pipelines::registration::ComputeFPFHFeature (
6559 *sourceO3D,
66- open3d::geometry::KDTreeSearchParamHybrid (absoluteRadiusKDTreeSearch , maxNeighborKDTreeSearch));
60+ open3d::geometry::KDTreeSearchParamHybrid (radiusKDTreeSearch , maxNeighborKDTreeSearch));
6761
6862 std::shared_ptr<open3d::pipelines::registration::Feature> targetFPFHFeatures =
6963 open3d::pipelines::registration::ComputeFPFHFeature (
7064 *targetO3D,
71- open3d::geometry::KDTreeSearchParamHybrid (absoluteRadiusKDTreeSearch , maxNeighborKDTreeSearch));
65+ open3d::geometry::KDTreeSearchParamHybrid (radiusKDTreeSearch , maxNeighborKDTreeSearch));
7266
7367 std::shared_ptr<open3d::pipelines::registration::FastGlobalRegistrationOption> option =
7468 std::make_shared<open3d::pipelines::registration::FastGlobalRegistrationOption>();
@@ -115,11 +109,8 @@ namespace diffCheck::registrations
115109 // voxelize at the scale of the point cloud
116110 if (voxelise)
117111 {
118- double absoluteVoxelSize =
119- voxelSize * std::abs (sourceO3D->GetMaxBound ().norm () - sourceO3D->GetMinBound ().norm ());
120-
121- sourceO3D->VoxelDownSample (absoluteVoxelSize);
122- targetO3D->VoxelDownSample (absoluteVoxelSize);
112+ sourceO3D->VoxelDownSample (voxelSize);
113+ targetO3D->VoxelDownSample (voxelSize);
123114 }
124115
125116 if (sourceO3D->normals_ .size () == 0 )
@@ -132,30 +123,20 @@ namespace diffCheck::registrations
132123 targetO3D->EstimateNormals ();
133124 }
134125
135- // convert the relative values to absolute ones
136- double absoluteRadiusKDTreeSearch =
137- radiusKDTreeSearch * std::abs (sourceO3D->GetMaxBound ().norm () - sourceO3D->GetMinBound ().norm ());
138-
139- double absoluteCorrespodenceCheckerDistance =
140- correspondenceCheckerDistance * std::abs (sourceO3D->GetMaxBound ().norm () - sourceO3D->GetMinBound ().norm ());
141-
142- double absoluteMaxCorrespondenceDistance =
143- maxCorrespondenceDistance * std::abs (sourceO3D->GetMaxBound ().norm () - sourceO3D->GetMinBound ().norm ());
144-
145126 std::shared_ptr<open3d::pipelines::registration::Feature> sourceFPFHFeatures =
146127 open3d::pipelines::registration::ComputeFPFHFeature (
147128 *sourceO3D,
148- open3d::geometry::KDTreeSearchParamHybrid (absoluteRadiusKDTreeSearch , maxNeighborKDTreeSearch));
129+ open3d::geometry::KDTreeSearchParamHybrid (radiusKDTreeSearch , maxNeighborKDTreeSearch));
149130
150131 std::shared_ptr<open3d::pipelines::registration::Feature> targetFPFHFeatures =
151132 open3d::pipelines::registration::ComputeFPFHFeature (
152133 *targetO3D,
153- open3d::geometry::KDTreeSearchParamHybrid (absoluteRadiusKDTreeSearch , maxNeighborKDTreeSearch));
134+ open3d::geometry::KDTreeSearchParamHybrid (radiusKDTreeSearch , maxNeighborKDTreeSearch));
154135
155136 std::vector<std::reference_wrapper<const open3d::pipelines::registration::CorrespondenceChecker>> correspondanceChecker;
156137
157138 open3d::pipelines::registration::CorrespondenceCheckerBasedOnDistance checkerOnDistance =
158- open3d::pipelines::registration::CorrespondenceCheckerBasedOnDistance (absoluteCorrespodenceCheckerDistance );
139+ open3d::pipelines::registration::CorrespondenceCheckerBasedOnDistance (correspondenceCheckerDistance );
159140
160141 open3d::pipelines::registration::CorrespondenceCheckerBasedOnEdgeLength checkerOnEdgeLength =
161142 open3d::pipelines::registration::CorrespondenceCheckerBasedOnEdgeLength (similarityThreshold);
@@ -168,7 +149,7 @@ namespace diffCheck::registrations
168149 *sourceFPFHFeatures,
169150 *targetFPFHFeatures,
170151 true ,
171- absoluteMaxCorrespondenceDistance ,
152+ maxCorrespondenceDistance ,
172153 transformationEstimation,
173154 ransacN,
174155 correspondanceChecker,
0 commit comments