45 PointMatcher<T>::DataPointsFilter(
"MaxQuantileOnAxisDataPointsFilter",
68 throw InvalidParameter((boost::format(
"MaxQuantileOnAxisDataPointsFilter: Error, filtering on dimension number %1%, larger than feature dimensionality %2%") %
dim % cloud.
features.rows()).str());
70 const int nbPointsIn = cloud.
features.cols();
71 const int nbPointsOut = nbPointsIn *
ratio;
75 values.reserve(nbPointsIn);
76 for (
int x = 0;
x < nbPointsIn; ++
x)
80 std::nth_element(values.begin(), values.begin() + (values.size() *
ratio), values.end());
81 const T limit = values[nbPointsOut];
85 for (
int i = 0; i < nbPointsIn; ++i)
94 assert(j <= nbPointsOut);
Parametrizable::Parameters Parameters
void setColFrom(Index thisCol, const DataPoints &that, Index thatCol)
Set column thisCol equal to column thatCol of that, copy features and descriptors if any...
std::vector< double > values
Functions and classes that are dependant on scalar type are defined in this templatized class...
const M::mapped_type & get(const M &m, const typename M::key_type &k)
The superclass of classes that are constructed using generic parameters. This class provides the para...
virtual DataPoints filter(const DataPoints &input)
Apply filters to input point cloud. This is the non-destructive version and returns a copy...
void conservativeResize(Index pointCount)
Resize the cloud to pointCount points, conserving existing ones.
MaxQuantileOnAxisDataPointsFilter(const Parameters ¶ms=Parameters())
Constructor, uses parameter interface.
Parametrizable::InvalidParameter InvalidParameter
Subsampling. Filter points beyond a maximum quantile measured on a specific axis. ...
Matrix features
features of points in the cloud
virtual void inPlaceFilter(DataPoints &cloud)
Apply these filters to a point cloud without copying.