isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.56k stars 2.32k forks source link

`VoxelGrid.create_from_point_cloud_within_bounds` does not care for bounds #4569

Open guhur opened 2 years ago

guhur commented 2 years ago

Checklist

Describe the issue

The documentation explains that the parameters min_bound and max_bound for the function should crop the point cloud within bounds (at least in my understanding).

I don't see any impact of the bounds, as illustrated in the above example.

Steps to reproduce the bug

import open3d as o3d
import numpy as np
from open3d.web_visualizer import draw

pcd = o3d.io.read_point_cloud("/home/pguhur/src/Open3D/examples/test_data/fragment.ply")
min_bound = np.array([10,10,10])[:, None]
max_bound = np.array([10,10,10])[:, None]
voxel_grid = o3d.geometry.VoxelGrid.create_from_point_cloud_within_bounds(pcd, 0.01, min_bound, max_bound)

draw([voxel_grid])

Error message

This is providing the full point cloud:

image

Expected behavior

I would be expected the point cloud to be cropped instead.

Open3D, Python and System information

- Operating system: Ubuntu 20.04
- Python version: Python 3.8
- Open3D version: 0.14.1+068d833
- System type: x84
- Is this remote workstation?: yes
- How did you install Open3D?: pip

Additional information

No response

adamszummer-digica commented 6 months ago

I have similar issue, voxel grid is not changed

min_bound = np.asarray([1, 2, 3]).reshape(3, 1).astype(np.float64)
    max_bound = np.asarray([-1, -2, -3]).reshape(3, 1).astype(np.float64)

    voxel_grid = VoxelGrid.create_from_point_cloud_within_bounds(pcd, voxel_size, min_bound,max_bound)