isl-org / isl-org/Open3D

High CPU load for plane fitting

Open
#7,421 0 comments 0 reactions 0 assignees View on GitHub
question
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).

### My Question

Hello,

We came across Open3D (great work by the way) as we are using point cloud processing for plane fitting in our code base. Historically, this is based on PCL. However, most importantly due to it's Python interface, we are interested in trying Open3D, too.

We compiled Open3D by ourselves to use both, a native C++ interface as well as a Python binding to the same DLL on Windows, but we also reproduced a similar situation using Open3D's prebuilt DLL. Technically, everything works. However, we noted that Open3D requires significantly more CPU resources for simple plane fitting than PCL does. We isolated this into a small C++ for loop, executing plane fits on a sample cloud. Both libraries compare fine with respect to runtime speed (with minor advantages for Open3D) and the resulting plane equation, however Open3D peaks up to 80 % CPU load on an i7-14700, whereas PCL only requires a few percent.

Our Open3D code looks like
```C++
auto [coefs, indices] = cloud.SegmentPlane(0.02, 3, 100, 0.98);
```
wheres the intended-to-be-equivalent PCL code is:
```C++
pcl::SACSegmentation seg;
seg.setModelType(pcl::SACMODEL_PLANE);
seg.setMethodType(pcl::SAC_RANSAC);
seg.setMaxIterations(100);
seg.setDistanceThreshold(0.02);
seg.setProbability(0.98);
seg.setOptimizeCoefficients(true);
seg.setInputCloud(cloud);

pcl::PointIndices::Ptr inliers = pcl::PointIndices::Ptr(new pcl::PointIndices);
pcl::ModelCoefficients::Ptr coefs = pcl::ModelCoefficients::Ptr(new pcl::ModelCoefficients);
seg.segment(*inliers, *coefs);
```

We *strongly* guess that Open3D does significantly more with respect to parallelization / termination criteria / refinement of the result. Consequently, by adjusting the correct parameters, presumably we can tweak Open3D to stay lean as well, yielding similar results. Of course, we could also provide the respective cloud (ply file). Does anyone have an idea to resolve this issue or how to adjust Open3D's parameters?

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.