pchandler.filters.core
Abstract filter base class plus a generic field-based filter.
Classes
Generic filter that evaluates a callable on a named field. |
|
Abstract base class for |
- class pchandler.filters.core.PointCloudFilter
Bases:
ABCAbstract base class for
PointCloudDatafilters.- abstractmethod mask(pcd)
Compute and return a boolean mask for the provided point cloud.
- Parameters:
pcd (PointCloudData) – Point cloud to be evaluated.
- Returns:
Boolean mask,
Truefor points kept by the filter.- Return type:
Vector_Bool_T
- reduce(pcd)
Reduce the point cloud in place to the points selected by the mask.
- Parameters:
pcd (PointCloudData) – Point cloud mutated in place.
- extract(pcd)
Return a new point cloud built from the points selected by the mask.
The existing point cloud is reduced to only the points defined by the negated mask.
- Parameters:
pcd (PointCloudData) – Source point cloud (mutated: keeps only the negated-mask points).
- Returns:
New point cloud carrying the selected points.
- Return type:
- sample(pcd)
Return a copy of the point cloud sampled using the boolean mask.
- Parameters:
pcd (PointCloudData) – Source point cloud (not mutated).
- Returns:
New point cloud carrying the sampled points.
- Return type:
- class pchandler.filters.core.GenericFieldFilter
Bases:
PointCloudFilterGeneric filter that evaluates a callable on a named field.
- __init__(field_label, filter_func)
Build a generic filter that operates on a single named field.
- Parameters:
field_label (str) – A label or name for the field.
filter_func (Callable[[NDArray], Vector_Bool_T]) – A callable function used to perform filtering logic. Must return a boolean mask.
- mask(pcd)
Create a boolean mask from the defined field and function.
- Parameters:
pcd (PointCloudData) – Point cloud to be evaluated.
- Returns:
Boolean mask returned by
filter_funcevaluated on the named field.- Return type:
Vector_Bool_T