This class holds methods for creating distance-based weight matrices and for interpolating signals.
More...
#include <interpolation.h>
|
static QSharedPointer< Eigen::SparseMatrix< float > > | createInterpolationMat (const QVector< int > &vecProjectedSensors, const QSharedPointer< Eigen::MatrixXd > matDistanceTable, double(*interpolationFunction)(double), const double dCancelDist=FLOAT_INFINITY, const QVector< int > &vecExcludeIndex=QVector< int >()) |
|
static Eigen::VectorXf | interpolateSignal (const QSharedPointer< Eigen::SparseMatrix< float > > matInterpolationMatrix, const QSharedPointer< Eigen::VectorXf > &vecMeasurementData) |
|
static Eigen::VectorXf | interpolateSignal (const Eigen::SparseMatrix< float > &matInterpolationMatrix, const Eigen::VectorXf &vecMeasurementData) |
|
static double | linear (const double dIn) |
|
static double | gaussian (const double dIn) |
|
static double | square (const double dIn) |
|
static double | cubic (const double dIn) |
|
This class holds methods for creating distance-based weight matrices and for interpolating signals.
Calculates and stores a matrix which provides the information how much each vertex is influenced by every sensor. On this basis, the user can use sensor data to calculate interpolated values for each sensor of the mesh. The user can choose the function that is used in the interpolation. Three functions are provided. Interpolation weights are calculated using the following formula: where w are interpolation weights, d are distances, m is the number of columsn and f is the used function.
Definition at line 88 of file interpolation.h.
◆ ConstSPtr
◆ SPtr
◆ Interpolation()
DISP3DLIB::Interpolation::Interpolation |
( |
| ) |
|
|
delete |
Deleted default constructor (static class).
◆ createInterpolationMat()
QSharedPointer< SparseMatrix< float > > Interpolation::createInterpolationMat |
( |
const QVector< int > & |
vecProjectedSensors, |
|
|
const QSharedPointer< Eigen::MatrixXd > |
matDistanceTable, |
|
|
double(*)(double) |
interpolationFunction, |
|
|
const double |
dCancelDist = FLOAT_INFINITY , |
|
|
const QVector< int > & |
vecExcludeIndex = QVector<int>() |
|
) |
| |
|
static |
This method calculates the weight matrix that is later needed for the interpolation of signals. The matrix will have n rows, where n is the number of rows of the passed distance table (i.e. the number of vertices of the mesh that the table is based on), and m columns, where m is the number of mapped sensors on the mesh (based on a prior sensor-to-mesh mapping). createInterplationMat calculates the matrix according to the following scheme:
- if the vertex belongs to a sensor: The value at the position of the sensor is 1 and all other values in this row are set to 0
- if not: the values are calculated to give a total of 1 (a lot of values will stay 0, because they are too far away to influence) by using the above mentioned formula
- Parameters
-
[in] | vecProjectedSensors | Vector of IDs of sensor vertices. |
[in] | matDistanceTable | Matrix that contains all needed distances. |
[in] | interpolationFunction | Function that computes interpolation coefficients using the distance values. |
[in] | dCancelDist | Distances higher than this are ignored, i.e. the respective coefficients are set to zero. |
[in] | vecExcludeIndex | The indices to be excluded from vecProjectedSensors, e.g., bad channels (empty by default). |
- Returns
- The distance matrix created.
Definition at line 71 of file interpolation.cpp.
◆ cubic()
double Interpolation::cubic |
( |
const double |
dIn | ) |
|
|
static |
Calculates interpolation weights based on distance values. Returns interpolation weight that corresponds to cubic hyperbel.
- Parameters
-
- Returns
- The function value of the cubic hyperbel at d.
Definition at line 191 of file interpolation.cpp.
◆ gaussian()
double Interpolation::gaussian |
( |
const double |
dIn | ) |
|
|
static |
Calculates interpolation weights based on distance values. Returns interpolation weight that corresponds to gauss curve with sigma set to 1.
- Parameters
-
- Returns
- The function value of the gauss curve at d.
Definition at line 177 of file interpolation.cpp.
◆ interpolateSignal() [1/2]
static Eigen::VectorXf DISP3DLIB::Interpolation::interpolateSignal |
( |
const Eigen::SparseMatrix< float > & |
matInterpolationMatrix, |
|
|
const Eigen::VectorXf & |
vecMeasurementData |
|
) |
| |
|
static |
The interpolation essentially corresponds to a matrix * vector multiplication. A vector of sensor data (i.e. a vector of double-values) is multiplied with the result of the createInterpolationMat. The result is a vector that contains interpolated values for all vertices of the mesh that was used to create the weight matrix, i.e. in first instance the distance table that the weight matrix is based on.
- Parameters
-
[in] | matInterpolationMatrix | The weight matrix which should be used for multiplying. |
[in] | vecMeasurementData | A vector with measured sensor data. |
- Returns
- Interpolated values for all vertices of the mesh.
◆ interpolateSignal() [2/2]
static Eigen::VectorXf DISP3DLIB::Interpolation::interpolateSignal |
( |
const QSharedPointer< Eigen::SparseMatrix< float > > |
matInterpolationMatrix, |
|
|
const QSharedPointer< Eigen::VectorXf > & |
vecMeasurementData |
|
) |
| |
|
static |
The interpolation essentially corresponds to a matrix * vector multiplication. A vector of sensor data (i.e. a vector of double-values) is multiplied with the result of the createInterpolationMat. The result is a vector that contains interpolated values for all vertices of the mesh that was used to create the weight matrix, i.e. in first instance the distance table that the weight matrix is based on.
- Parameters
-
[in] | matInterpolationMatrix | The weight matrix which should be used for multiplying. |
[in] | vecMeasurementData | A vector with measured sensor data. |
- Returns
- Interpolated values for all vertices of the mesh.
◆ linear()
double Interpolation::linear |
( |
const double |
dIn | ) |
|
|
static |
Serves as a placeholder for other functions and is needed in case a linear interpolation is wanted when calling createInterplationMat.Returns input argument unchanged.
- Parameters
-
- Returns
- Same value interpreted as a interpolation weight.
Definition at line 170 of file interpolation.cpp.
◆ square()
double Interpolation::square |
( |
const double |
dIn | ) |
|
|
static |
Calculates interpolation weights based on distance values. Returns interpolation weight that corresponds to negative parabel with an y-offset of 1.
- Parameters
-
- Returns
- The function value of the negative parabel at d.
Definition at line 184 of file interpolation.cpp.
The documentation for this class was generated from the following files: