PCL
|
Shape-preserving simplification of 2-D surfaces. More...
#include <SurfaceSimplifier.h>
Public Member Functions | |
SurfaceSimplifier ()=default | |
SurfaceSimplifier (const SurfaceSimplifier &)=default | |
SurfaceSimplifier (double tolerance) | |
void | DisableCentroidInclusion (bool disable=true) |
void | DisableRejection (bool disable=true) |
void | EnableCentroidInclusion (bool enable=true) |
void | EnableRejection (bool enabled=true) |
bool | IsCentroidInclusionEnabled () const |
bool | IsRejectionEnabled () const |
float | RejectFraction () const |
void | SetRejectFraction (float rejectFraction) |
void | SetTolerance (double tolerance) |
template<class C > | |
void | Simplify (C &xs, C &ys, C &zs, const C &x, const C &y, const C &z) const |
double | Tolerance () const |
Given a finite set of three dimensional points representing sampled values of a real bivariate function of the form
z = f(x,y),
the shape-preserving surface simplification algorithm attempts to generate a reduced set of points with equivalent geometric properties to within a prescribed maximum error parameter.
The implemented algorithm divides the input point space recursively on the XY plane into rectangular regions using custom quadtree structures. For each region, the algorithm finds the orientation of the dominant plane through principal component analysis. The deviation of function values from the dominant plane is evaluated for the points in the region, and if the region is considered flat to within a tolerance parameter, its points are replaced with a simplified (reduced) set of points that tends to preserve the local shape of the original function over the region. If the region is tagged as curve, it is further divided using a new quadtree recursion, until no additional simplification can be achieved.
Surface simplification is an important auxiliary tool to improve the practical application of surface interpolation and approximation devices. These algorithms allow us to work with large-scale data sets by selecting a subset of essential data points, usually much smaller than the original set, adapted to solve a particular problem. Surface simplification is particularly useful for the application of computationally expensive approximation algorithms, such as surface splines or thin plates. A good example is computation of high accuracy astrometric solutions, where surface simplification allows us to use large sets of thousands of stars to generate thin plate models of local distortions. Since generation of thin plates has roughly O(N^3) time complexity, the efficient reduction of input point sets is crucial for this application.
Definition at line 145 of file SurfaceSimplifier.h.
|
default |
Constructs a new SurfaceSimplifier object with default parameters:
|
inline |
Constructs a new SurfaceSimplifier instance with the specified tolerance.
Definition at line 223 of file SurfaceSimplifier.h.
|
default |
Copy constructor.
|
inline |
Disables inclusion of centroid points for this surface simplifier. See EnableCentroidInclusion() for more information.
Definition at line 369 of file SurfaceSimplifier.h.
|
inline |
Disables outlier rejection for this surface simplifier. See EnableRejection() for more information.
Definition at line 297 of file SurfaceSimplifier.h.
|
inline |
Enables inclusion of centroid points for this surface simplifier.
When a subregion of the input space is simplified, the surface simplification algorithm replaces the subset of points in the subregion with a simplified, reduced set. If this option is enabled, the average point of the subset, also known as centroid, is also included in the simplified point list. This usually improves the shape preservation behavior of the algorithm, at the cost of a small amount of additional points in the simplified point list.
Definition at line 360 of file SurfaceSimplifier.h.
|
inline |
Enables outlier rejection for this surface simplifier.
When enabled, a prescribed fraction of outlier points (see the RejectFraction() member function) will be rejected on each subregion for estimation of local curvature. An adequate amount of rejection is important to achieve a robust result, especially for simplification of noisy data where outliers may generate false curvatures that prevent efficient simplification.
Definition at line 288 of file SurfaceSimplifier.h.
|
inline |
Returns true iff inclusion of centroid points is enabled for this object.
See the EnableCentroidInclusion() member function for a description of the centroid inclusion feature of the surface simplification algorithm.
Definition at line 344 of file SurfaceSimplifier.h.
|
inline |
Returns true iff outlier rejection is enabled for this object.
See the EnableRejection() and RejectFraction() member functions for a description of outlier rejection in the surface simplification algorithm.
Definition at line 273 of file SurfaceSimplifier.h.
|
inline |
Returns the fraction of outlier points rejected for estimation of local curvature.
See the EnableRejection() and RejectFraction() member functions for a description of outlier rejection in the surface simplification algorithm.
Definition at line 309 of file SurfaceSimplifier.h.
|
inline |
Sets the fraction of outlier points rejected by this surface simplifier.
This parameter defines a fraction of outlier points that will be rejected on each subregion of the point space being simplified, for estimation of local curvature.
Rejecting an adequate fraction of points makes the surface simplification algorithm more immune to noise in the input data, including erroneous points that may deviate considerably from the true surface represented by the sampled function. The result is a more robust and accurate simplified surface. However, too high of a rejection fraction may remove significant data and lead to an inaccurate result.
The specified rejectFraction value must be in the (0,1) range. The default value upon construction is 0.2, which is quite appropriate in most cases.
Definition at line 332 of file SurfaceSimplifier.h.
References pcl::Range().
|
inline |
Sets the tolerance of this surface simplifier.
The tolerance parameter determines the maximum absolute deviation of function values from a plane allowed to simplify the subset of points within a subregion of the input point space.
The value of this parameter is specified in bivariate function value units, i.e. in Z-axis units. Higher tolerances tend to allow for more simplification, and hence for shorter simplified point lists. However, an excessive tolerance value may degrade the accuracy of the simplified surface in terms of preservation of the original function's structure and shape. This parameter must be tailored carefully to the requirements of the function being simplified and the tasks where the simplified version is going to be applied.
Definition at line 261 of file SurfaceSimplifier.h.
References pcl::Abs().
|
inline |
Attempts to simplify a set of points given by its separate coordinates and function values.
[out] | xs | The X coordinates of the simplified point set. |
[out] | ys | The Y coordinates of the simplified point set. |
[out] | zs | The function values for the simplified point set. |
x | The X coordinates of the input point set. | |
y | The Y coordinates of the input point set. | |
z | The function values for the input point set. |
The template argument C must be a direct container of numeric scalars with random access semantics, such as Array or GenericVector.
If the specified surface can be simplified with the current working parameters defined for this object, the output containers will have less elements (usually much less) than the input containers. Otherwise an exact copy of the input containers will be obtained in xs, ys and zs. This will happen also if the input containers have less than four coordinates, since a triangular facet cannot be simplified.
Definition at line 401 of file SurfaceSimplifier.h.
|
inline |
Returns the current tolerance of this surface simplifier.
See the SetTolerance() member function for a description of the tolerance parameter.
Definition at line 240 of file SurfaceSimplifier.h.