[Depreciating RegistrationColoredICP function]. Legacy ColoredICP Refactoring. #3616
[Depreciating RegistrationColoredICP function]. Legacy ColoredICP Refactoring. #3616reyanshsolis wants to merge 5 commits intomasterfrom
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| @@ -144,34 +144,34 @@ | |||
| "# This is implementation of following paper\n", | |||
There was a problem hiding this comment.
Line #8. criteria_list = [
Simplify o3d calls with some imports:
from o3d.pipelines.registration import ICPConvergenceCriteria, TransformationEstimationForColoredICP, registration_multi_scale_icp
from o3d.geometry import KDTreeSearchParamHybrid
Reply via ReviewNB
| @@ -144,34 +144,34 @@ | |||
| "# This is implementation of following paper\n", | |||
There was a problem hiding this comment.
ssheorey
left a comment
There was a problem hiding this comment.
Looks good to me, other than the minor comments / typo in the review.
Pretty comprehensive update!
Verify reconstruction system result. is also done, right?
Reviewable status: 0 of 19 files reviewed, 16 unresolved discussions (waiting on @reyanshsolis and @yxlao)
cpp/open3d/geometry/PointCloud.cpp, line 106 at r1 (raw file):
if ((!HasPoints() || HasNormals()) && cloud.HasNormals()) { normals_.resize(new_vert_num); #pragma omp parallel for schedule(static)
This is likely too fine grained an operation and memory access bound to benefit from multi threading. It may even slow things down.
cpp/open3d/geometry/PointCloud.cpp, line 115 at r1 (raw file):
if ((!HasPoints() || HasColors()) && cloud.HasColors()) { colors_.resize(new_vert_num); #pragma omp parallel for schedule(static)
Same here.
cpp/open3d/geometry/PointCloud.cpp, line 124 at r1 (raw file):
if ((!HasPoints() || HasColorGradients()) && cloud.HasColorGradients()) { colors_.resize(new_vert_num); #pragma omp parallel for schedule(static)
Same...
cpp/open3d/geometry/PointCloud.cpp, line 133 at r1 (raw file):
points_.resize(new_vert_num); #pragma omp parallel for schedule(static) for (int i = 0; i < add_vert_num; i++) {
..here
cpp/open3d/geometry/PointCloud.cpp, line 356 at r1 (raw file):
} for (auto accpoint : voxelindex_to_accpoint) {
This doesn't look necessary. It's a good idea to keep changes to only those required to speed up reviews.
cpp/open3d/geometry/PointCloud.cpp, line 414 at r1 (raw file):
*this, static_cast<size_t>(i), cid, approximate_class); }
Same...
cpp/open3d/geometry/PointCloud.cpp, line 616 at r1 (raw file):
size_t nn = point_idx.size(); Eigen::MatrixXd A(nn, 3); Eigen::MatrixXd b(nn, 1);
nit: A, b memory can be reused for all points by making them thread_local and defining them before the parallel for.
cpp/open3d/pipelines/registration/Registration.h, line 189 at r1 (raw file):
/// \param target The target point cloud. /// \param voxel_sizes VectorDouble of voxel scales of type double. /// \param criterias Vector of ICPConvergenceCriteria objects for each scale.
Mention example or default values for ICPConvergenceCriteria, if any.
cpp/open3d/pipelines/registration/Registration.h, line 193 at r1 (raw file):
/// points-pair distances of type double, for each iteration. Must be of same /// length as voxel_sizes and criterias. /// \param init Initial transformation estimation.
Default values?
cpp/open3d/pipelines/registration/Registration.h, line 205 at r1 (raw file):
Depreciated
\deprecated Please use the general RegistrationICP instead.
(doxygen markup)
cpp/open3d/pipelines/registration/Registration.cpp, line 195 at r1 (raw file):
target_copy.EstimateColorGradients(geometry::KDTreeSearchParamHybrid( max_correspondence_distances[num_iterations - 1] * 2.0, 30)); target_ptr = std::make_shared<geometry::PointCloud>(target_copy);
Can skip this if color_gradients_ is already present.
nit: A plain pointer is OK instead of a shared_ptr since we are not passing the data to another function.
cpp/open3d/pipelines/registration/Registration.cpp, line 287 at r1 (raw file):
Depreciated
Deprecated (typo)
cpp/open3d/pipelines/registration/TransformationEstimation.cpp, line 205 at r1 (raw file):
1.0 - nt(1) * nt(1), -nt(1) * nt(2), -nt(0) * nt(2), -nt(1) * nt(2), 1.0 - nt(2) * nt(2)) .finished();
nit: Arrange in 3x3 grid for easier reading. Use // clang-format off if it complains.
cpp/pybind/pipelines/registration/registration.cpp, line 598 at r1 (raw file):
m.def("registration_colored_icp", &RegistrationColoredICP, py::call_guard<py::gil_scoped_release>(), "[Depreciated Function] Colored ICP registration", "source"_a,
deprecated (typo)
examples/python/reconstruction_system/colored_icp.py, line 82 at r1 (raw file):
relative_rmse=1e-6, max_iteration=14) ]
Simplify open3d function calls with some imports (as in the Jupyter notebook).
|
We should merge PR #3181 before this, since there may be some updates needed to this PR from changes there. |
|
@reyanshsolis can this be merged now? Color ICP segfaults on 0.13.0 |
This PR depreciates the function
RegistationColoredICPfrom legacy, to resolve the following issues:TransformationEstimationType::ColoredICPto the functionRegistrationICPwas not defined, hence segmentation fault.MultiScaleICPsupport to legacy.Changes:
RegistrationColoredICP, made required changes to generalizeRegistrationICP. Now one may directly useRegistrationICP/registration_icpfunction for colored icp, by passingTransformationEstimationType::ColoredICP, like they do forPointToPointandPointToPlane.color_gradients_attribute forlegacy pointcloudand added changes to the required functions.EstimateColorGradientsfunction.pragma omp parallel forconstruct inEstimateColorGradientsat points level. [Performance may be further improved].MultiScaleICPsupport in legacy. [Exposingcolor_gradientand implementingmulti_scale_icpmay have combined performance improvement as previously users had to manually implement it for multi-scale (the paper suggests better converge in colored-icp for multi-scale), which made the functionreigstration_colored_icpcomputecolor_gradientfor each scale].benchmarks. Added pybinds and unit test.reconstruction_systemto use the newly added supports.TODO:
Change 1:
registration_icpcan be directly used, instead ofregistration_colored_icp.Change 2: MultiScale ICP support.
Performance Improvement:
To verify that colored icp is still working the same:

This change is