PointClip#
- class PointClip(point_cloud_range=(-80, -80, -3, 80, 80, 1))[source]#
Bases:
objectClamp
coordto an axis-aligned point-cloud range.Clips each coordinate column to the
[min, max]box given bypoint_cloud_rangein place (out-of-range values are saturated to the nearest face, not removed; the point count is unchanged). Requirescoord; a no-op ifcoordis absent. Registered asPointClip– use this string as thetypein atransform=[...]config list.- Parameters:
point_cloud_range (tuple[float, ...]) – six values
(x_min, y_min, z_min, x_max, y_max, z_max)giving the clamp box. Defaults to(-80, -80, -3, 80, 80, 1).
Note
This clamps coordinates; it does not drop points. Per-point arrays stay the same length, so coordinates collapsed onto a face remain present.
Example
>>> import numpy as np >>> from pimm.datasets.transform import PointClip >>> data = {"coord": np.array([[-2., 0.5, 0.], [2., -3., 0.]], dtype="f4")} >>> out = PointClip(point_cloud_range=(-1, -1, -1, 1, 1, 1))(data) >>> out["coord"] # out-of-range coords saturated to the box faces; count unchanged array([[-1. , 0.5, 0. ], [ 1. , -1. , 0. ]])