PCL
|
Vector surface spline interpolation/approximation in two dimensions. More...
#include <SurfaceSpline.h>
Public Types | |
using | rbf_type = spline::rbf_type |
using | spline = SurfaceSpline< double > |
Public Member Functions | |
PointSurfaceSpline ()=default | |
template<class point_list1 , class point_list2 , class weight_vector = FVector> | |
PointSurfaceSpline (const point_list1 &P1, const point_list2 &P2, float smoothness=0, int order=2, const weight_vector &W=weight_vector(), rbf_type rbf=RadialBasisFunction::Default, double eps=0, bool polynomial=true) | |
PointSurfaceSpline (const PointSurfaceSpline &)=default | |
PointSurfaceSpline (const spline &Sx, const spline &Sy) | |
PointSurfaceSpline (PointSurfaceSpline &&)=default | |
void | Clear () |
void | DisableIncrementalFunction (bool disable=true) |
void | DisableSimplifiers (bool disable=true) |
void | EnableIncrementalFunction (bool enable=true) |
void | EnableSimplifiers (bool enable=true) |
double | ErrorX () const |
double | ErrorY () const |
template<class PV > | |
Array< DPoint > | Evaluate (const PV &P) const |
template<class V > | |
Array< DPoint > | Evaluate (const V &X, const V &Y) const |
template<typename T > | |
void | Evaluate (T *ZX, T *ZY, const T *X, const T *Y, size_type n) const |
bool | HasFastVectorEvaluation () const |
bool | IncrementalFunctionEnabled () const |
template<class point_list1 , class point_list2 , class weight_vector = FVector> | |
void | Initialize (const point_list1 &P1, const point_list2 &P2, float smoothness=0, const weight_vector &W=weight_vector(), int order=2, rbf_type rbf=RadialBasisFunction::Default, double eps=0, bool polynomial=true) |
void | Initialize (const spline &Sx, const spline &Sy) |
bool | IsValid () const |
const Matrix & | LinearFunction () const |
int | MaxSplinePoints () const |
template<typename T > | |
DPoint | operator() (const GenericPoint< T > &p) const |
DPoint | operator() (double x, double y) const |
PointSurfaceSpline & | operator= (const PointSurfaceSpline &other)=default |
PointSurfaceSpline & | operator= (PointSurfaceSpline &&)=default |
void | SetLinearFunction (const Matrix &H) |
void | SetMaxSplinePoints (int n) |
void | SetSimplifierRejectFraction (float rejectFraction) |
float | SimplifierRejectFraction () const |
bool | SimplifiersEnabled () const |
const spline & | SplineX () const |
const spline & | SplineY () const |
bool | Truncated () const |
bool | TruncatedX () const |
bool | TruncatedY () const |
The template parameter P represents an interpolation point in two dimensions. The type P must implement P::x and P::y data members accessible from the current PointSurfaceSpline template specialization. These members must provide the values of the horizontal and vertical coordinates, respectively, of an interpolation point. In addition, the scalar types of the P::x and P::y point members must support conversion to double semantics.
Definition at line 1232 of file SurfaceSpline.h.
using pcl::PointSurfaceSpline::rbf_type = spline::rbf_type |
Represents a radial basis function (RBF) supported by this point surface spline implementation.
Definition at line 1245 of file SurfaceSpline.h.
using pcl::PointSurfaceSpline::spline = SurfaceSpline<double> |
Represents a coordinate interpolating/approximating surface spline.
Definition at line 1239 of file SurfaceSpline.h.
|
default |
Default constructor. Yields an empty instance that cannot be used without initialization.
|
default |
Copy constructor.
|
default |
Move constructor.
|
inline |
Constructs a PointSurfaceSpline object initialized for the specified input data and interpolation parameters.
See the corresponding Initialize() member function for a detailed description of parameters.
Definition at line 1271 of file SurfaceSpline.h.
Constructs a PointSurfaceSpline object initialized with prescribed surface splines.
See the corresponding Initialize() member function for a more detailed description of parameters and their required conditions.
Definition at line 1288 of file SurfaceSpline.h.
|
inline |
Deallocates internal structures, yielding an empty spline that cannot be used before a new call to Initialize().
Definition at line 1568 of file SurfaceSpline.h.
|
inline |
Disables the use of incremental functions for this point surface spline.
Definition at line 1788 of file SurfaceSpline.h.
|
inline |
Disables the use of shape-preserving surface simplifiers to automatically reduce the complexity of 2-D surface splines. See the SurfaceSimplifier class for detailed information.
Definition at line 1656 of file SurfaceSpline.h.
|
inline |
Enables the use of incremental functions for this point surface spline.
Definition at line 1778 of file SurfaceSpline.h.
|
inline |
Enables the use of shape-preserving surface simplifiers to automatically reduce the complexity of 2-D surface splines. See the SurfaceSimplifier class for detailed information.
Definition at line 1644 of file SurfaceSpline.h.
|
inline |
Returns the simplification tolerance achieved on the X axis after spline initialization with automatic surface simplification enabled.
Definition at line 1687 of file SurfaceSpline.h.
|
inline |
Returns the simplification tolerance achieved on the Y axis after spline initialization with automatic surface simplification enabled.
Definition at line 1696 of file SurfaceSpline.h.
Evaluates the surface spline for a list P of points in 2-D space, and returns the corresponding function values as an array of points in 64-bit floating point format.
The type PV must be a PCL array or vector of point structures, where each P[i] is expected to have public x and y members of numeric scalar type.
See Evaluate( T*, T*, const T*, const T*, int ) const for more information.
Definition at line 1884 of file SurfaceSpline.h.
|
inline |
Evaluates the point surface spline for a set of points in 2-D space specified as the X and Y lists of n coordinates, and returns the corresponding function values as an array of points in 64-bit floating point format.
The type V must be a PCL array or vector with numeric scalar components.
See Evaluate( T*, T*, const T*, const T*, int ) const for more information.
Definition at line 1856 of file SurfaceSpline.h.
|
inline |
Evaluates the point surface spline for a set of points in 2-D space specified as the X and Y contiguous sequences of n coordinates, and stores the corresponding function values in the specified ZX and ZY arrays.
For core DDM-RBF interpolation/approximation, this is a support function for fast multithreaded evaluation of the point surface spline at large-scale sets of interpolation points. For PCL RBF implementations this function can be convenient, but it does not provide any significant performance improvement.
Definition at line 1830 of file SurfaceSpline.h.
|
inline |
Returns true iff this object can be evaluated for vectors of points in 2-D space efficiently by calling the Evaluate() member functions. In current PCL versions, this member function only returns true for RBF interpolation/approximation algorithms with core implementations.
Definition at line 1906 of file SurfaceSpline.h.
|
inline |
Returns true iff the use of incremental functions is currently enabled for this point surface spline.
When the incremental function is enabled, surface splines compute the differences with respect to a fixed linear transformation function, which should be specified calling SetLinearFunction(). Incremental surface splines can yield more accurate representations of relatively complex two-dimensional functions when a linear transformation can work as a fixed reference to absorb the largest variations.
Definition at line 1768 of file SurfaceSpline.h.
|
inline |
Initializes this PointSurfaceSpline object for the specified input data and interpolation parameters.
P1 | A sequence of distinct interpolation node points. |
P2 | A sequence of interpolation values. For each point in P1, the coordinates of its counterpart point in P2 will be used as the interpolation node values in the X and Y directions. |
smoothness | Smoothing factor. Must be ≥ 0. The default value is zero, that is, interpolating surface splines are generated by default. |
W | Reference to a vector of positive node weights > 0, when the smoothing factor is > 0. This parameter is ignored for interpolating splines (that is, when smoothness = 0) and when surface simplification is enabled (see below). When relevant, this argument must be a reference to a vector or array of float values. |
order | Derivative order of continuity. Must be ≥ 2. The default value is 2. This parameter is only taken into account when the rbf parameter is RadialBasisFunction::VariableOrder. |
rbf | The type of radial basis function (RBF) used for surface spline generation. The default is RadialBasisFunction::ThinPlateSpline in the current implementation. |
eps | The shape parameter used for decreasing radial basis functions. Increasing RBFs, such as thin plate splines and variable order functions, are parameter-free and hence ignore this parameter. |
polynomial | If true, surface spline generation will include a first order polynomial part for stabilization. If false, only radial basis functions will be used without a polynomial component. |
For smoothness <= 0, an interpolating spline will be generated: all node values will be reproduced exactly at their respective coordinates. In this case the W parameter will be ignored. The W vector will also be ignored when automatic surface simplification is enabled (see EnableSimplifiers()).
For smoothness > 0 without automatic simplification, a smoothing (or approximating) spline will be generated: increasing smoothness values will generate splines closer to the reference plane of the input node set. If nonempty, the specified vector W of node weights will be used to assign a different interpolation strength to each interpolation node. In this case the vector W must have at least the same length as the shortest of the P1 and P2 vectors, and must contain values greater than zero. A node weight larger than one will reduce the smoothness of the interpolating surface at the corresponding node coordinates, or in other words, it will give more prominence to the corresponding data point. A node weight of one will apply the specified smoothness at its node position. Contrarily, a node weight smaller than one will increase the interpolation smoothness locally.
When the variable order RBF is specified, the surface spline will be continuously differentiable up to the specified order. If this order is too high, an ill-conditioned linear system may result, especially for large data sets. The recommended values are 2, 3, 4 or 5, but order 2 is usually the most useful and safest option for most applications. Derivative orders greater than 5 may lead to numerically unstable interpolation devices, which should always be used with care. For the rest of RBFs the order parameter is ignored and second order functions are always used.
Definition at line 1381 of file SurfaceSpline.h.
Initializes this PointSurfaceSpline object with prescribed surface splines.
Sx | 2-D surface spline for interpolation of function values in the X direction. |
Sy | 2-D surface spline for interpolation of function values in the Y direction. |
Both surface splines must be valid. If one or both splines are invalid, calling this member function is equivalent to Clear().
After calling this member function successfuly, this object will store deep copies of the specified surface spline instances.
Definition at line 1552 of file SurfaceSpline.h.
|
inline |
Returns true iff this is a valid, initialized object ready for interpolation.
Definition at line 1580 of file SurfaceSpline.h.
|
inline |
Returns the 3x3 matrix of the projective transformation used as the reference function for an incremental surface spline. See the Homography class for detailed information on linear transformations.
Definition at line 1738 of file SurfaceSpline.h.
|
inline |
Returns the maximum number of interpolation points allowed for this point surface spline.
Definition at line 1607 of file SurfaceSpline.h.
|
inline |
Returns an interpolated point at the given p.x and p.y coordinates.
Definition at line 1809 of file SurfaceSpline.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
|
inline |
Returns an interpolated point at the specified coordinates.
Definition at line 1796 of file SurfaceSpline.h.
|
default |
Copy assignment operator. Returns a reference to this object.
|
default |
Move assignment operator. Returns a reference to this object.
|
inline |
Sets the 3x3 matrix of the projective transformation used as the reference function for an incremental surface spline. See the Homography class for detailed information on linear transformations.
Definition at line 1750 of file SurfaceSpline.h.
|
inline |
Sets the maximum number of interpolation points allowed for this point surface spline.
The default maximum number of interpolation points allowed for point surface splines is 2100 in current PCL versions. Take into account that surface spline generation has O(n^3) time complexity.
Definition at line 1620 of file SurfaceSpline.h.
References pcl::Max().
|
inline |
Sets the fraction of outlier points rejected by surface simplifiers.
See SurfaceSimplifier::SetRejectFraction() for a detailed description of the role of this parameter.
Definition at line 1677 of file SurfaceSpline.h.
References pcl::Range().
|
inline |
Returns the fraction of outlier points rejected by surface simplifiers.
See SetSimplifierRejectFraction() for more information on this parameter.
Definition at line 1666 of file SurfaceSpline.h.
|
inline |
Returns true iff automatic surface simplification is enabled for this point surface spline.
Definition at line 1632 of file SurfaceSpline.h.
|
inline |
Returns a reference to the internal surface spline object used for interpolation in the X plane direction.
Definition at line 1589 of file SurfaceSpline.h.
|
inline |
Returns a reference to the internal surface spline object used for interpolation in the Y plane direction.
Definition at line 1598 of file SurfaceSpline.h.
|
inline |
Returns true iff the set of interpolation nodes was truncated during automatic simplification, either on the X axis, on the Y axis, or both. This should never happen under normal working conditions.
Definition at line 1726 of file SurfaceSpline.h.
|
inline |
Returns true iff the set of interpolation nodes on the X axis was truncated during automatic simplification. This should never happen under normal working conditions.
Definition at line 1706 of file SurfaceSpline.h.
|
inline |
Returns true iff the set of interpolation nodes on the Y axis was truncated during automatic simplification. This should never happen under normal working conditions.
Definition at line 1716 of file SurfaceSpline.h.