Return the index of cropped point cloud by `SelectionPolygonVolume.crop_point_cloud()`
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
**Is your feature request related to a problem? Please describe.**
Either `open3d.visualization.SelectionPolygonVolume.crop_point_cloud()` or `open3d.geometry.PointCloud.crop()` return the point cloud type directly. However, sometimes the cropped points index are also useful.
And I check the source code of cpp (I am a python user and very new to cpp), it seems these functions utilized by
```cpp
return input.SelectByIndex(CropInPolygon(input.points_));
```
which get the point index first, and then `selected_by_index` to get the cropped point cloud.
**Describe the solution you'd like**
Add a control parameter of `return_index` in the function:
```python
cropped_pcd = SelectionPolygonVolume.crop_point_cloud(raw_pcd, return_index=False)
cropped_pcd, cropped_index = SelectionPolygonVolume.crop_point_cloud(raw_pcd, return_index=True)
```
or add an new function `crop_point_cloud_and_trace()`:
```python
cropped_pcd, cropped_index = SelectionPolygonVolume.crop_point_cloud_and_trace(raw_pcd)
```
**Additional context**
Then reason why I want to get the cropping point index, is willing to accelerate the batch cropping of large amount of polygons in a very large point cloud
For example, I have a large point cloud with 8000,0000 points, and I need to extract and save 1000 sub point clouds from corresponding 1000 polygon boundaries. Current processing time is around 1.5 hours by doing for loop of each polygon boundary, and it is really necessary to accelerate this process.
One idea I came out is, after cropping one polygon, remove those cropped points in raw point cloud, it will gradually decrease the points that need to be sorted in the next iteration. So getting the index of previous cropped point is really important.
Or any other suggestions to solve current dilemma?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.