PCL
pcl::PointSurfaceSpline< P > Class Template Reference

Vector surface spline interpolation/approximation in two dimensions. More...

#include <SurfaceSpline.h>

+ Inheritance diagram for pcl::PointSurfaceSpline< P >:

Public Types

typedef P point
 
typedef Array< pointpoint_list
 
typedef SurfaceSpline< double > spline
 

Public Member Functions

 PointSurfaceSpline ()=default
 
 PointSurfaceSpline (const PointSurfaceSpline &)=default
 
 PointSurfaceSpline (PointSurfaceSpline &&)=default
 
template<class weight_vector = FVector>
 PointSurfaceSpline (const point_list &P1, const point_list &P2, float smoothness=0, int order=2, const weight_vector &W=weight_vector())
 
 PointSurfaceSpline (const spline &Sx, const spline &Sy)
 
void Clear ()
 
template<class weight_vector = FVector>
void Initialize (const point_list &P1, const point_list &P2, float smoothness=0, const weight_vector &W=weight_vector(), int order=2)
 
void Initialize (const spline &Sx, const spline &Sy)
 
PointSurfaceSpline Inverse () const
 
bool IsValid () const
 
template<typename T >
DPoint operator() (T x, T y) const
 
template<typename T >
DPoint operator() (const GenericPoint< T > &p) const
 
PointSurfaceSplineoperator= (const PointSurfaceSpline &)=default
 
PointSurfaceSplineoperator= (PointSurfaceSpline &&)=default
 
const splineSplineX () const
 
const splineSplineY () const
 

Detailed Description

template<class P = DPoint>
class pcl::PointSurfaceSpline< P >

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 649 of file SurfaceSpline.h.

Member Typedef Documentation

◆ point

template<class P = DPoint>
typedef P pcl::PointSurfaceSpline< P >::point

Represents an interpolation point in two dimensions.

Definition at line 656 of file SurfaceSpline.h.

◆ point_list

template<class P = DPoint>
typedef Array<point> pcl::PointSurfaceSpline< P >::point_list

Represents a sequence of interpolation points.

Definition at line 661 of file SurfaceSpline.h.

◆ spline

template<class P = DPoint>
typedef SurfaceSpline<double> pcl::PointSurfaceSpline< P >::spline

Represents a coordinate interpolating/approximating surface spline.

Definition at line 666 of file SurfaceSpline.h.

Constructor & Destructor Documentation

◆ PointSurfaceSpline() [1/5]

template<class P = DPoint>
pcl::PointSurfaceSpline< P >::PointSurfaceSpline ( )
default

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

◆ PointSurfaceSpline() [2/5]

template<class P = DPoint>
pcl::PointSurfaceSpline< P >::PointSurfaceSpline ( const PointSurfaceSpline< P > &  )
default

Copy constructor.

◆ PointSurfaceSpline() [3/5]

template<class P = DPoint>
pcl::PointSurfaceSpline< P >::PointSurfaceSpline ( PointSurfaceSpline< P > &&  )
default

Move constructor.

◆ PointSurfaceSpline() [4/5]

template<class P = DPoint>
template<class weight_vector = FVector>
pcl::PointSurfaceSpline< P >::PointSurfaceSpline ( const point_list P1,
const point_list P2,
float  smoothness = 0,
int  order = 2,
const weight_vector &  W = weight_vector() 
)
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 692 of file SurfaceSpline.h.

◆ PointSurfaceSpline() [5/5]

template<class P = DPoint>
pcl::PointSurfaceSpline< P >::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 706 of file SurfaceSpline.h.

Member Function Documentation

◆ Clear()

template<class P = DPoint>
void pcl::PointSurfaceSpline< P >::Clear ( )
inline

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

Definition at line 923 of file SurfaceSpline.h.

◆ Initialize() [1/2]

template<class P = DPoint>
template<class weight_vector = FVector>
void pcl::PointSurfaceSpline< P >::Initialize ( const point_list P1,
const point_list P2,
float  smoothness = 0,
const weight_vector &  W = weight_vector(),
int  order = 2 
)
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 0.
WReference 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.
orderDerivative order. Must be >= 2. The default value is 2.

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.

For smoothness > 0, 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.

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 3 may lead to numerically unstable interpolation devices, which should always be used with care.

Definition at line 769 of file SurfaceSpline.h.

◆ Initialize() [2/2]

template<class P = DPoint>
void pcl::PointSurfaceSpline< P >::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 866 of file SurfaceSpline.h.

◆ Inverse()

template<class P = DPoint>
PointSurfaceSpline pcl::PointSurfaceSpline< P >::Inverse ( ) const
inline

Returns an approximation to the inverse surface spline of this object.

The returned object can be used to perform an inverse interpolation: Given an interpolation point P2, the returned spline will interpolate the corresponding node point P1. See Initialize() for more information on spline initialization.

In general, the returned object can only provide an approximation to the inverse of the underlying coordinate transformation. In particular, if this object has been initialized as an approximating surface spline, its inverse spline will compute node point coordinates from approximate (smoothed) interpolated coordinates, instead of the original ones.

If two or more interpolation points were identical when this object was initialized, calling this member function may lead to an ill-conditioned linear system. In such case, an Error exception will be thrown.

If this object has not been initialized, this function returns an uninitialized PointSurfaceSpline object.

Definition at line 897 of file SurfaceSpline.h.

◆ IsValid()

template<class P = DPoint>
bool pcl::PointSurfaceSpline< P >::IsValid ( ) const
inline

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

Definition at line 933 of file SurfaceSpline.h.

◆ operator()() [1/2]

template<class P = DPoint>
template<typename T >
DPoint pcl::PointSurfaceSpline< P >::operator() ( x,
y 
) const
inline

Returns an interpolated point at the specified coordinates.

Definition at line 960 of file SurfaceSpline.h.

◆ operator()() [2/2]

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

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

Definition at line 969 of file SurfaceSpline.h.

◆ operator=() [1/2]

template<class P = DPoint>
PointSurfaceSpline& pcl::PointSurfaceSpline< P >::operator= ( const PointSurfaceSpline< P > &  )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

template<class P = DPoint>
PointSurfaceSpline& pcl::PointSurfaceSpline< P >::operator= ( PointSurfaceSpline< P > &&  )
default

Move assignment operator. Returns a reference to this object.

◆ SplineX()

template<class P = DPoint>
const spline& pcl::PointSurfaceSpline< P >::SplineX ( ) const
inline

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

Definition at line 942 of file SurfaceSpline.h.

◆ SplineY()

template<class P = DPoint>
const spline& pcl::PointSurfaceSpline< P >::SplineY ( ) const
inline

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

Definition at line 951 of file SurfaceSpline.h.


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