PCL
|
Vector surface spline interpolation/approximation in two dimensions with recursive subspline generation. More...
#include <SurfaceSpline.h>
Public Member Functions | |
RecursivePointSurfaceSpline ()=default | |
template<class point_list1 , class point_list2 , class weight_vector = FVector> | |
RecursivePointSurfaceSpline (const point_list1 &P1, const point_list2 &P2, float smoothness=0, int order=2, const weight_vector &W=weight_vector(), bool allowExtrapolation=__PCL_RSSPLINE_DEFAULT_ALLOW_EXTRAPOLATION, int maxSplineLength=__PCL_RSSPLINE_DEFAULT_SPLINE_MAX_LENGTH, int bucketCapacity=__PCL_RSSPLINE_DEFAULT_TREE_BUCKET_CAPACITY, bool verbose=true) | |
RecursivePointSurfaceSpline (const RecursivePointSurfaceSpline &)=delete | |
RecursivePointSurfaceSpline (RecursivePointSurfaceSpline &&)=default | |
~RecursivePointSurfaceSpline () override | |
void | Clear () |
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, bool allowExtrapolation=__PCL_RSSPLINE_DEFAULT_ALLOW_EXTRAPOLATION, int maxSplineLength=__PCL_RSSPLINE_DEFAULT_SPLINE_MAX_LENGTH, int bucketCapacity=__PCL_RSSPLINE_DEFAULT_TREE_BUCKET_CAPACITY, bool verbose=true) |
bool | IsRecursive () const |
bool | IsValid () const |
template<typename T > | |
DPoint | operator() (const GenericPoint< T > &p) const |
DPoint | operator() (double x, double y) const |
RecursivePointSurfaceSpline & | operator= (const RecursivePointSurfaceSpline &)=delete |
RecursivePointSurfaceSpline & | operator= (RecursivePointSurfaceSpline &&)=default |
Public Member Functions inherited from pcl::ParallelProcess | |
ParallelProcess ()=default | |
ParallelProcess (const ParallelProcess &)=default | |
virtual | ~ParallelProcess () |
void | DisableParallelProcessing (bool disable=true) noexcept |
void | EnableParallelProcessing (bool enable=true, int maxProcessors=0) noexcept |
bool | IsParallelProcessingEnabled () const noexcept |
int | MaxProcessors () const noexcept |
ParallelProcess & | operator= (const ParallelProcess &)=default |
void | SetMaxProcessors (int maxProcessors) noexcept |
void | Swap (ParallelProcess &process) noexcept |
This class is a functional replacement for PointSurfaceSpline. It splits the interpolation region recursively using quadtrees. At each quadtree leaf node a subspline is generated with a subset of the interpolation nodes, with additional data redundancy to ensure smoothness across subregion boundaries.
This recursive scheme is appropriate for large-scale problems, where single thin plate splines can be impractical because their generation has O(n^3) time complexity. An instance of RecursivePointSurfaceSpline can be built with an unlimited number of arbitrarily distributed interpolation points.
Definition at line 1633 of file SurfaceSpline.h.
|
default |
Default constructor. Yields an empty instance that cannot be used without initialization.
|
delete |
Copy constructor. Copy construction is disabled because this class uses internal data structures that cannot be copy-constructed. However, RecursivePointSurfaceSpline implements move construction and move assignment.
|
default |
Move constructor.
|
inline |
Constructs a RecursivePointSurfaceSpline 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 1677 of file SurfaceSpline.h.
|
inlineoverride |
Destroys a RecursivePointSurfaceSpline object.
Definition at line 1692 of file SurfaceSpline.h.
|
inline |
Deallocates internal structures, yielding an empty object that cannot be used before a new call to Initialize().
Definition at line 1952 of file SurfaceSpline.h.
|
inline |
Initializes this RecursivePointSurfaceSpline 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 (default = 0). |
W | Reference to a vector of positive node weights > 0, when the smoothing factor is > 1. For an interpolating spline this parameter will be ignored (see below). This argument must be a reference to a vector or array of float values. |
order | Derivative order. Must be ≥ 2 (default = 2). |
allowExtrapolation | Whether to allow extrapolation on points exterior to the region defined by the specified set of interpolation node points P1. Extrapolation is not allowed by default because recursively generated subsplines are slightly more prone to oscillation than normal surface splines. |
maxSplineLength | Maximum length of a point surface spline in a non-recursive RecursivePointSurfaceSpline instance. The default value is 1600 points. Be aware that surface spline generation has O(n^3) time complexity (that's why this class exists after all), and the number of generated quadtree nodes grows exponentially with the total number of interpolation points. The default value is a reasonable compromise for balanced efficiency in most practical cases. |
bucketCapacity | Bucket capacity for quadtree generation. The default value is 64 points. By decreasing this value the recursive surface spline initialization process will be faster, but the generated subsplines will be less accurate, leading to more border artifacts between contiguous quadtree node regions. |
verbose | If true, this function will write information to the standard PixInsight console to provide some feedback to the user during the (potentially long) initialization process. If false, no feedback will be provided. |
For smoothness ≤ 0, interpolating subsplines will be generated: all node values will be reproduced exactly at their respective coordinates. In this case the W parameter will be ignored.
For smoothness > 0, smoothing (or approximating) subsplines will be generated: increasing smoothness values will generate splines closer to the reference planes of their input node sets. 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.
The generated surface subsplines will be continuously differentiable up to the specified order. If this order is too high, ill-conditioned linear systems 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 3 may lead to numerically unstable interpolation devices, which should always be used with care.
Definition at line 1774 of file SurfaceSpline.h.
|
inline |
Returns true if this object splits the interpolation space recursively with subsplines. In such case this object contains a quadtree structure that will be searched for suitable point surface splines to interpolate function values.
Returns false is this object performs no further recursion. In such case this object contains a point surface spline that will be used directly to interpolate function values.
Definition at line 1974 of file SurfaceSpline.h.
|
inline |
Returns true iff this is a valid, initialized object ready for interpolation.
Definition at line 1983 of file SurfaceSpline.h.
|
inline |
Returns an interpolated point at the given p.x and p.y coordinates.
If extrapolation is disabled for this object and the specified point lies outside the interpolation region defined upon initialization, a point at the origin (that is, with zero coordinates) is returned conventionally. Otherwise the nearest subspline will be used to extrapolate the returned value.
Definition at line 2132 of file SurfaceSpline.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
|
inline |
Returns an interpolated point at the specified x, y coordinates.
If extrapolation is disabled for this object and the specified coordinates fall outside the interpolation region defined upon initialization, a point at the origin (that is, with zero coordinates) is returned conventionally. Otherwise the nearest subspline will be used to extrapolate the returned value.
Definition at line 1997 of file SurfaceSpline.h.
|
delete |
Copy assignment operator. Copy assignment is disabled because this class uses internal data structures that cannot be copy-assigned. However, RecursivePointSurfaceSpline implements move assignment and move construction.
|
default |
Move assignment operator. Returns a reference to this object.