In a given point cloud, I want to remove all the points which are less than min
and greater than max
for all x
, y
and
What about using pcl::CropBox
? (documentation)
pcl::CropBox boxFilter;
boxFilter.setMin(Eigen::Vector4f(minX, minY, minZ, 1.0));
boxFilter.setMax(Eigen::Vector4f(maxX, maxY, maxZ, 1.0));
boxFilter.setInputCloud(body);
boxFilter.filter(*bodyFiltered);
To know why this filter takes Vector4f (and not Vector3f) see the comments below and this question.