Errors with registration_icp and registration_generalized_icp
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### Describe the issue
The functions `open3d.pipelines.registration.registration_icp` and `open3d.pipelines.registration.registration_generalized_icp` have a parameter `estimation_method`. The documentation says that can be any of `TransformationEstimationPointToPoint`, `TransformationEstimationPointToPlane`, `TransformationEstimationForGeneralizedICP`, `TransformationEstimationForColoredICP` but
not all methods work for the the two functions.
The function `open3d.pipelines.registration.registration_icp` works only with `TransformationEstimationPointToPoint` and `TransformationEstimationPointToPlane`, the function `open3d.pipelines.registration.registration_generalized_icp` works only with `TransformationEstimationForGeneralizedICP`.
### Steps to reproduce the bug
```python
import numpy as np
import open3d as o3d
demo_icp_pcds = o3d.data.DemoICPPointClouds()
source = o3d.io.read_point_cloud(demo_icp_pcds.paths[0])
source.colors = o3d.utility.Vector3dVector(np.zeros_like(np.asarray(source.points)))
target = o3d.io.read_point_cloud(demo_icp_pcds.paths[1])
target.colors = o3d.utility.Vector3dVector(np.zeros_like(np.asarray(target.points)))
threshold = 0.02
trans_init = np.asarray(
[
[0.862, 0.011, -0.507, 0.5],
[-0.139, 0.967, -0.215, 0.7],
[0.487, 0.255, 0.835, -1.4],
[0.0, 0.0, 0.0, 1.0],
]
)
for method in ["registration_generalized_icp", "registration_icp"]:
for mode in ["point2point", "point2plane", "generalized", "color"]:
if method == "registration_icp":
fn = o3d.pipelines.registration.registration_icp
elif method == "registration_generalized_icp":
fn = o3d.pipelines.registration.registration_generalized_icp
if mode == "point2point":
m = o3d.pipelines.registration.TransformationEstimationPointToPoint()
elif mode == "point2plane":
m = o3d.pipelines.registration.TransformationEstimationPointToPlane()
elif mode == "generalized":
m = o3d.pipelines.registration.TransformationEstimationForGeneralizedICP()
elif mode == "color":
m = o3d.pipelines.registration.TransformationEstimationForColoredICP()
print(method, mode)
try:
fn(source, target, threshold, trans_init, m)
except Exception as e:
print("FAILED!")
print(e)
else:
print("SUCCESS!")
print("--------------------------------------------------")
```
### Error message
```bash
registration_generalized_icp point2point
FAILED!
registration_generalized_icp(): incompatible function arguments. The following argument types are supported:
1. (source: open3d.cuda.pybind.geometry.PointCloud, target: open3d.cuda.pybind.geometry.PointCloud, max_correspondence_distance: float, init: numpy.ndarray[numpy.float64[4, 4]] = array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]), estimation_method: open3d.cuda.pybind.pipelines.registration.TransformationEstimationForGeneralizedICP = TransformationEstimationForGeneralizedICP with epsilon=0.001000, criteria: open3d.cuda.pybind.pipelines.registration.ICPConvergenceCriteria = ICPConvergenceCriteria class with relative_fitness=1.000000e-06, relative_rmse=1.000000e-06, and max_iteration=30) -> open3d.cuda.pybind.pipelines.registration.RegistrationResult
Invoked with: PointCloud with 198835 points., PointCloud with 137833 points., 0.02, array([[ 0.862, 0.011, -0.507, 0.5 ],
[-0.139, 0.967, -0.215, 0.7 ],
[ 0.487, 0.255, 0.835, -1.4 ],
[ 0. , 0. , 0. , 1. ]]), TransformationEstimationPointToPoint without scaling.
--------------------------------------------------
registration_generalized_icp point2plane
FAILED!
registration_generalized_icp(): incompatible function arguments. The following argument types are supported:
1. (source: open3d.cuda.pybind.geometry.PointCloud, target: open3d.cuda.pybind.geometry.PointCloud, max_correspondence_distance: float, init: numpy.ndarray[numpy.float64[4, 4]] = array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]), estimation_method: open3d.cuda.pybind.pipelines.registration.TransformationEstimationForGeneralizedICP = TransformationEstimationForGeneralizedICP with epsilon=0.001000, criteria: open3d.cuda.pybind.pipelines.registration.ICPConvergenceCriteria = ICPConvergenceCriteria class with relative_fitness=1.000000e-06, relative_rmse=1.000000e-06, and max_iteration=30) -> open3d.cuda.pybind.pipelines.registration.RegistrationResult
Invoked with: PointCloud with 198835 points., PointCloud with 137833 points., 0.02, array([[ 0.862, 0.011, -0.507, 0.5 ],
[-0.139, 0.967, -0.215, 0.7 ],
[ 0.487, 0.255, 0.835, -1.4 ],
[ 0. , 0. , 0. , 1. ]]), TransformationEstimationPointToPlane
--------------------------------------------------
registration_generalized_icp generalized
SUCCESS!
--------------------------------------------------
registration_generalized_icp color
FAILED!
registration_generalized_icp(): incompatible function arguments. The following argument types are supported:
1. (source: open3d.cuda.pybind.geometry.PointCloud, target: open3d.cuda.pybind.geometry.PointCloud, max_correspondence_distance: float, init: numpy.ndarray[numpy.float64[4, 4]] = array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]), estimation_method: open3d.cuda.pybind.pipelines.registration.TransformationEstimationForGeneralizedICP = TransformationEstimationForGeneralizedICP with epsilon=0.001000, criteria: open3d.cuda.pybind.pipelines.registration.ICPConvergenceCriteria = ICPConvergenceCriteria class with relative_fitness=1.000000e-06, relative_rmse=1.000000e-06, and max_iteration=30) -> open3d.cuda.pybind.pipelines.registration.RegistrationResult
Invoked with: PointCloud with 198835 points., PointCloud with 137833 points., 0.02, array([[ 0.862, 0.011, -0.507, 0.5 ],
[-0.139, 0.967, -0.215, 0.7 ],
[ 0.487, 0.255, 0.835, -1.4 ],
[ 0. , 0. , 0. , 1. ]]), TransformationEstimationForColoredICP with lambda_geometric=0.968000
--------------------------------------------------
registration_icp point2point
SUCCESS!
--------------------------------------------------
registration_icp point2plane
SUCCESS!
--------------------------------------------------
registration_icp generalized
FAILED!
[Open3D Error] (open3d::pipelines::registration::RegistrationResult open3d::pipelines::registration::RegistrationICP(const open3d::geometry::PointCloud&, const open3d::geometry::PointCloud&, double, const Matrix4d&, const open3d::pipelines::registration::TransformationEstimation&, const open3d::pipelines::registration::ICPConvergenceCriteria&)) /root/Open3D/cpp/open3d/pipelines/registration/Registration.cpp:136: TransformationEstimationForGeneralizedICP require pre-computed per point covariances matrices for source and target PointCloud.
--------------------------------------------------
registration_icp color
Segmentation fault (core dumped)
```
### Expected behavior
_No response_
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 22.04
- Python version: Python 3.8.18
- Open3D version: output from python: 0.17.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
```
### Additional information
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.