diff --git a/include/misc3d/pose_estimation/ppf_estimation.h b/include/misc3d/pose_estimation/ppf_estimation.h index 27b486a..d938e4f 100644 --- a/include/misc3d/pose_estimation/ppf_estimation.h +++ b/include/misc3d/pose_estimation/ppf_estimation.h @@ -41,8 +41,9 @@ class PPFEstimatorConfig { // sparse pose refine methods enum class RefineMethod { - PointToPoint = 0, - PointToPlane = 1, + NoRefine = 0, + PointToPoint = 1, + PointToPlane = 2, }; struct TrainingParam { diff --git a/python/py_pose_estimation.cpp b/python/py_pose_estimation.cpp index 56ef8f0..1537ef8 100644 --- a/python/py_pose_estimation.cpp +++ b/python/py_pose_estimation.cpp @@ -57,6 +57,7 @@ void pybind_pose_estimation(py::module &m) { .export_values(); py::enum_(config, "RefineMethod") + .value("NoRefine", PPFEstimatorConfig::RefineMethod::NoRefine) .value("PointToPlane", PPFEstimatorConfig::RefineMethod::PointToPlane) .value("PointToPoint", PPFEstimatorConfig::RefineMethod::PointToPoint) .export_values(); @@ -78,7 +79,8 @@ void pybind_pose_estimation(py::module &m) { py::class_(config, "VotingParam") .def(py::init<>()) .def_readwrite("method", &PPFEstimatorConfig::VotingParam::method) - .def_readwrite("faster_mode", &PPFEstimatorConfig::VotingParam::faster_mode) + .def_readwrite("faster_mode", + &PPFEstimatorConfig::VotingParam::faster_mode) .def_readwrite("angle_step", &PPFEstimatorConfig::VotingParam::angle_step) .def_readwrite("min_dist_thresh", diff --git a/src/ppf_estimation.cpp b/src/ppf_estimation.cpp index 75c03ae..aa86888 100644 --- a/src/ppf_estimation.cpp +++ b/src/ppf_estimation.cpp @@ -980,7 +980,11 @@ void PPFEstimator::Impl::RefineSparsePose( #pragma omp critical { pose_list.emplace_back(max_votes_pose); - pose_list[pose_list.size() - 1].UpdateByPose(res.transformation_); + if (config_.refine_param_.method != + PPFEstimatorConfig::RefineMethod::NoRefine) { + pose_list[pose_list.size() - 1].UpdateByPose( + res.transformation_); + } } } }