isl-org / isl-org/Open3D

Gicp registration failed

Open
#7,012 0 comments 0 reactions 0 assignees View on GitHub
bug
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](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### Describe the issue

I learned how to register Gicp from the source code and found the following two problems.
BUG 1 :Gicp registration requires a normal vector or covariance. If only normal is provided, the result can be calculated, but if only covariance is provided, the calculation will fail.

BUG 2:In the function TransformationEstimationForGeneralizedICP:: ComputeTransformation, compute_jackian_1and_desidual
const Eigen::Matrix3d M = Ct + Cs;
const Eigen::Matrix3d W = M.inverse().sqrt();
Only after array() conversion can it be sqrt, and if there are negative numbers in the value of M.inverte(), the result will be nan.

This function will encounter errors during compilation. Does the gicp algorithm call other functions?

### Steps to reproduce the bug

```python
auto pcd = std::make_shared();
auto pcd2 = std::make_shared();
open3d::io::ReadPointCloud("1.ply", *pcd);
open3d::io::ReadPointCloud("1.ply", *pcd2);
float voxel_size = 6.5;
pcd = pcd->VoxelDownSample(voxel_size);
pcd2 = pcd2->VoxelDownSample(voxel_size);
//pcd->EstimateNormals(open3d::geometry::KDTreeSearchParamHybrid(voxel_size * 2, 30));
//pcd2->EstimateNormals(open3d::geometry::KDTreeSearchParamHybrid(voxel_size * 2, 30));
pcd->EstimateCovariances(open3d::geometry::KDTreeSearchParamHybrid(voxel_size * 2, 30)); // gicp error
pcd2->EstimateCovariances(open3d::geometry::KDTreeSearchParamHybrid(voxel_size * 2, 30)); // gicp error

auto R = pcd2->GetRotationMatrixFromXYZ(Eigen::Vector3d(0.2 * M_PI / 180.0, -0.2 * M_PI / 180.0, 0.2 * M_PI / 180.0));
pcd2->Rotate(R, pcd2->GetCenter());
pcd2->Translate(Eigen::Vector3d(10, 40, 5));

std::shared_ptr loss = std::make_shared();
auto criteria = open3d::pipelines::registration::ICPConvergenceCriteria(0.01, 0.05, 100);
open3d::pipelines::registration::RegistrationResult result;
result = open3d::pipelines::registration::RegistrationGeneralizedICP(*pcd, *pcd2, voxel_size * 2, Eigen::Matrix4d::Identity(),
open3d::pipelines::registration::TransformationEstimationForGeneralizedICP(0.001, loss), criteria);
cout << result.transformation_ << endl;
```

### Error message

-nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind)

### Expected behavior

_No response_

### Open3D, Python and System information

```markdown
- Operating system: Windows 11 64-bit
- Python version: Python 3.11`
- Open3D version: output from python: `0.18.0`
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
- Compiler version (if built from source): gcc 7.5 / clang 7.0
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.