isl-org / isl-org/Open3D

Tensor version of ICP don't stop when relatives on criteria are met

Open
#7,367 1 comment 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

We are using Open3D 1.15.2 tensor pipeline version to apply ICP registration to some point cloud. We notice that icp only stops after max iterations even when relatives fitness and rmse have already been met in early iterations.

### Steps to reproduce the bug

```python
startTime = time.time()
registrationResult = open3d.t.pipelines.registration.icp(
source=sourcePointCloud,
target=targetPointCloud,
max_correspondence_distance=0.005,
estimation_method=open3d.t.pipelines.registration.TransformationEstimationPointToPoint(),
criteria=open3d.t.pipelines.registration.ICPConvergenceCriteria(
relative_fitness=0.00001,
relative_rmse=0.001,
max_iteration=30,
),
voxel_size=0.002,
callback_after_iteration=(
lambda updated_result_dict : print(
"Iteration Index: %(iteration)d, Fitness: %(fitness).6f, Inlier RMSE: %(rmse).6f, "
"Time: %(time).6f [s]"
% {
"iteration": updated_result_dict["iteration_index"].item(),
"fitness": updated_result_dict["fitness"].item(),
"rmse": updated_result_dict["inlier_rmse"].item(),
"time": time.time() - startTime,
}
)
),
)
```

### Error message

Performs 30 iterations even when stop criteria was met at iteration index 3

```
Iteration Index: 0, Fitness: 0.991531, Inlier RMSE: 0.002162, Time: 0.002552 [s]
Iteration Index: 1, Fitness: 0.993485, Inlier RMSE: 0.002068, Time: 0.003394 [s]
Iteration Index: 2, Fitness: 0.994137, Inlier RMSE: 0.002052, Time: 0.004135 [s]
Iteration Index: 3, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.004877 [s]
Iteration Index: 4, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.006665 [s]
Iteration Index: 5, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.013202 [s]
Iteration Index: 6, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.015546 [s]
Iteration Index: 7, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.017963 [s]
Iteration Index: 8, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.019468 [s]
Iteration Index: 9, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.020932 [s]
Iteration Index: 10, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.021940 [s]
Iteration Index: 11, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.022649 [s]
Iteration Index: 12, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.023459 [s]
Iteration Index: 13, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.024113 [s]
Iteration Index: 14, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.024760 [s]
Iteration Index: 15, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.025389 [s]
Iteration Index: 16, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.026125 [s]
Iteration Index: 17, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.026841 [s]
Iteration Index: 18, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.027528 [s]
Iteration Index: 19, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.028171 [s]
Iteration Index: 20, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.028818 [s]
Iteration Index: 21, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.029421 [s]
Iteration Index: 22, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.030037 [s]
Iteration Index: 23, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.030652 [s]
Iteration Index: 24, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.031330 [s]
Iteration Index: 25, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.031966 [s]
Iteration Index: 26, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.032597 [s]
Iteration Index: 27, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.033260 [s]
Iteration Index: 28, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.033925 [s]
Iteration Index: 29, Fitness: 0.993485, Inlier RMSE: 0.002047, Time: 0.034580 [s]
```

### Expected behavior

Stops at iteration index 3 as criteria has been met:

```
Iteration Index: 0, Fitness: 0.991531, Inlier RMSE: 0.002162, Time: 0.002552 [s]
Iteration Index: 1, Fitness: 0.993485, Inlier RMSE: 0.002068, Time: 0.003394 [s]
Iteration Index: 2, Fitness: 0.994137, Inlier RMSE: 0.002052, Time: 0.004135 [s]
Iteration Index: 3, Fitness: 0.994137, Inlier RMSE: 0.002050, Time: 0.004877 [s]
```

### Open3D, Python and System information

```markdown
- Operating system: Debian GNU/Linux 11 (bullseye)
- Python version: Python 3.9
- Open3D version: 0.15.2+38235c96a
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc (Debian 10.2.1-6) 10.2.1 20210110
```

### 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.