class mp2p_icp_filters::FilterPolygon2D
Overview
Split a point cloud into those points inside and outside an arbitrary 2D polygon, defined in the XY plane. A point is “inside” when its (x, y) projection lies within the polygon and its z coordinate is within the (optional) range [z_min, z_max].
Optionally, you can keep only one of those two clouds by leaving the unused one undefined in your YAML file (or as an empty string).
Unlike FilterBoundingBox, the cropping region is a general (possibly non-convex) polygon, which is useful to match footprints that are not axis-aligned rectangles.
Example YAML configuration block:
- class_name: mp2p_icp_filters::FilterPolygon2D params: input_pointcloud_layer: 'raw' # Keep at least one of these two output layers: inside_pointcloud_layer: 'inside' outside_pointcloud_layer: 'outside' # The polygon vertices, in the XY plane (map frame): polygon: [[0.0, 0.0], [10.0, 0.0], [10.0, 5.0], [0.0, 5.0]] # Optional Z crop (defaults to +/- infinity): z_min: 0.3 z_max: 2.0
#include <FilterPolygon2D.h> class FilterPolygon2D: public mp2p_icp_filters::FilterBase { public: // structs struct Parameters; // fields Parameters params; // methods virtual void initialize_filter(const mrpt::containers::yaml& c); virtual void filter(mp2p_icp::metric_map_t& inOut) const; };
Inherited Members
public: // methods virtual void filter(mp2p_icp::metric_map_t& inOut) const = 0; FilterBase& operator = (const FilterBase&); FilterBase& operator = (FilterBase&&);
Fields
Parameters params
Algorithm parameters
Methods
virtual void filter(mp2p_icp::metric_map_t& inOut) const
See docs above for FilterBase.