PCL
pcl::PointSurfaceSpline Class Reference

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
 
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 MatrixLinearFunction () const
 
int MaxSplinePoints () const
 
template<typename T >
DPoint operator() (const GenericPoint< T > &p) const
 
DPoint operator() (double x, double y) const
 
PointSurfaceSplineoperator= (const PointSurfaceSpline &other)=default
 
PointSurfaceSplineoperator= (PointSurfaceSpline &&)=default
 
void SetLinearFunction (const Matrix &H)
 
void SetMaxSplinePoints (int n)
 
void SetSimplifierRejectFraction (float rejectFraction)
 
float SimplifierRejectFraction () const
 
bool SimplifiersEnabled () const
 
const splineSplineX () const
 
const splineSplineY () const
 
bool Truncated () const
 
bool TruncatedX () const
 
bool TruncatedY () const
 

Detailed Description

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.

See also
SurfaceSpline, RecursivePointSurfaceSpline

Definition at line 959 of file SurfaceSpline.h.

Member Typedef Documentation

◆ rbf_type

using pcl::PointSurfaceSpline::rbf_type = spline::rbf_type

Represents a radial basis function (RBF) supported by this point surface spline implementation.

Definition at line 972 of file SurfaceSpline.h.

◆ spline

Represents a coordinate interpolating/approximating surface spline.

Definition at line 966 of file SurfaceSpline.h.

Constructor & Destructor Documentation

◆ PointSurfaceSpline() [1/5]

pcl::PointSurfaceSpline::PointSurfaceSpline ( )
default

Default constructor. Yields an empty instance that cannot be used without initialization.

◆ PointSurfaceSpline() [2/5]

pcl::PointSurfaceSpline::PointSurfaceSpline ( const PointSurfaceSpline )
default

Copy constructor.

◆ PointSurfaceSpline() [3/5]

pcl::PointSurfaceSpline::PointSurfaceSpline ( PointSurfaceSpline &&  )
default

Move constructor.

◆ PointSurfaceSpline() [4/5]

template<class point_list1 , class point_list2 , class weight_vector = FVector>
pcl::PointSurfaceSpline::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 
)
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 998 of file SurfaceSpline.h.

◆ PointSurfaceSpline() [5/5]

pcl::PointSurfaceSpline::PointSurfaceSpline ( const spline Sx,
const spline Sy 
)
inline

Constructs a PointSurfaceSpline object initialized with prescribed point surface splines.

See the corresponding Initialize() member function for a more detailed description of parameters and their required conditions.

Definition at line 1015 of file SurfaceSpline.h.

Member Function Documentation

◆ Clear()

void pcl::PointSurfaceSpline::Clear ( )
inline

Deallocates internal structures, yielding an empty spline that cannot be used before a new call to Initialize().

Definition at line 1295 of file SurfaceSpline.h.

◆ DisableIncrementalFunction()

void pcl::PointSurfaceSpline::DisableIncrementalFunction ( bool  disable = true)
inline

Disables the use of incremental functions for this point surface spline.

See also
IncrementalFunctionEnabled(), DisableIncrementalFunction()

Definition at line 1515 of file SurfaceSpline.h.

◆ DisableSimplifiers()

void pcl::PointSurfaceSpline::DisableSimplifiers ( bool  disable = true)
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.

See also
SimplifiersEnabled(), EnableSimplifiers()

Definition at line 1383 of file SurfaceSpline.h.

◆ EnableIncrementalFunction()

void pcl::PointSurfaceSpline::EnableIncrementalFunction ( bool  enable = true)
inline

Enables the use of incremental functions for this point surface spline.

See also
IncrementalFunctionEnabled(), DisableIncrementalFunction()

Definition at line 1505 of file SurfaceSpline.h.

◆ EnableSimplifiers()

void pcl::PointSurfaceSpline::EnableSimplifiers ( bool  enable = true)
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.

See also
SimplifiersEnabled(), DisableSimplifiers()

Definition at line 1371 of file SurfaceSpline.h.

◆ ErrorX()

double pcl::PointSurfaceSpline::ErrorX ( ) const
inline

Returns the simplification tolerance achieved on the X axis after spline initialization with automatic surface simplification enabled.

Definition at line 1414 of file SurfaceSpline.h.

◆ ErrorY()

double pcl::PointSurfaceSpline::ErrorY ( ) const
inline

Returns the simplification tolerance achieved on the Y axis after spline initialization with automatic surface simplification enabled.

Definition at line 1423 of file SurfaceSpline.h.

◆ IncrementalFunctionEnabled()

bool pcl::PointSurfaceSpline::IncrementalFunctionEnabled ( ) const
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.

See also
EnableIncrementalFunction(), DisableIncrementalFunction()

Definition at line 1495 of file SurfaceSpline.h.

◆ Initialize() [1/2]

template<class point_list1 , class point_list2 , class weight_vector = FVector>
void pcl::PointSurfaceSpline::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 
)
inline

Initializes this PointSurfaceSpline object for the specified input data and interpolation parameters.

Parameters
P1A sequence of distinct interpolation node points.
P2A 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.
smoothnessSmoothing factor. Must be ≥ 0. The default value is zero, that is, interpolating surface splines are generated by default.
WReference 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.
orderDerivative 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.
rbfThe type of radial basis function (RBF) used for surface spline generation. The default is RadialBasisFunction::ThinPlateSpline in the current implementation.
epsThe 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.
polynomialIf 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.

Note
The smoothness and W parameters are only used for the thin plate spline and variable order spline radial basis functions. For other RBFs only interpolation surface splines can be generated with this implementation, and hence these parameters are always ignored.

Definition at line 1108 of file SurfaceSpline.h.

◆ Initialize() [2/2]

void pcl::PointSurfaceSpline::Initialize ( const spline Sx,
const spline Sy 
)
inline

Initializes this PointSurfaceSpline object with prescribed point surface splines.

Parameters
Sx2-D point surface spline for interpolation of function values in the X direction.
Sy2-D point 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 1279 of file SurfaceSpline.h.

◆ IsValid()

bool pcl::PointSurfaceSpline::IsValid ( ) const
inline

Returns true iff this is a valid, initialized object ready for interpolation.

Definition at line 1307 of file SurfaceSpline.h.

◆ LinearFunction()

const Matrix& pcl::PointSurfaceSpline::LinearFunction ( ) const
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.

See also
SetLinearFunction(), IncrementalFunctionEnabled()

Definition at line 1465 of file SurfaceSpline.h.

◆ MaxSplinePoints()

int pcl::PointSurfaceSpline::MaxSplinePoints ( ) const
inline

Returns the maximum number of interpolation points allowed for this point surface spline.

Definition at line 1334 of file SurfaceSpline.h.

◆ operator()() [1/2]

template<typename T >
DPoint pcl::PointSurfaceSpline::operator() ( const GenericPoint< T > &  p) const
inline

Returns an interpolated point at the given p.x and p.y coordinates.

Definition at line 1535 of file SurfaceSpline.h.

References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ operator()() [2/2]

DPoint pcl::PointSurfaceSpline::operator() ( double  x,
double  y 
) const
inline

Returns an interpolated point at the specified coordinates.

Definition at line 1523 of file SurfaceSpline.h.

◆ operator=() [1/2]

PointSurfaceSpline& pcl::PointSurfaceSpline::operator= ( const PointSurfaceSpline other)
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

PointSurfaceSpline& pcl::PointSurfaceSpline::operator= ( PointSurfaceSpline &&  )
default

Move assignment operator. Returns a reference to this object.

◆ SetLinearFunction()

void pcl::PointSurfaceSpline::SetLinearFunction ( const Matrix H)
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.

See also
LinearFunction(), IncrementalFunctionEnabled()

Definition at line 1477 of file SurfaceSpline.h.

◆ SetMaxSplinePoints()

void pcl::PointSurfaceSpline::SetMaxSplinePoints ( int  n)
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 1347 of file SurfaceSpline.h.

References pcl::Max().

◆ SetSimplifierRejectFraction()

void pcl::PointSurfaceSpline::SetSimplifierRejectFraction ( float  rejectFraction)
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 1404 of file SurfaceSpline.h.

References pcl::Range().

◆ SimplifierRejectFraction()

float pcl::PointSurfaceSpline::SimplifierRejectFraction ( ) const
inline

Returns the fraction of outlier points rejected by surface simplifiers.

See SetSimplifierRejectFraction() for more information on this parameter.

Definition at line 1393 of file SurfaceSpline.h.

◆ SimplifiersEnabled()

bool pcl::PointSurfaceSpline::SimplifiersEnabled ( ) const
inline

Returns true iff automatic surface simplification is enabled for this point surface spline.

See also
EnableSimplifiers(),

Definition at line 1359 of file SurfaceSpline.h.

◆ SplineX()

const spline& pcl::PointSurfaceSpline::SplineX ( ) const
inline

Returns a reference to the internal surface spline object used for interpolation in the X plane direction.

Definition at line 1316 of file SurfaceSpline.h.

◆ SplineY()

const spline& pcl::PointSurfaceSpline::SplineY ( ) const
inline

Returns a reference to the internal surface spline object used for interpolation in the Y plane direction.

Definition at line 1325 of file SurfaceSpline.h.

◆ Truncated()

bool pcl::PointSurfaceSpline::Truncated ( ) const
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 1453 of file SurfaceSpline.h.

◆ TruncatedX()

bool pcl::PointSurfaceSpline::TruncatedX ( ) const
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 1433 of file SurfaceSpline.h.

◆ TruncatedY()

bool pcl::PointSurfaceSpline::TruncatedY ( ) const
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 1443 of file SurfaceSpline.h.


The documentation for this class was generated from the following file: