![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/BicubicBSplineApproximation.h>
Implements the approximation of a 2D scalar field with bicubic bsplines. More...
Implements the approximation of a 2D scalar field with bicubic bsplines.
Based on the paper "Scattered Data Interpolation with MultiLevel B-Splines" by Lee et al. (1997).
Public Member Functions | |
| BicubicBSplineApproximation (const vec2i &gridSize, int numLevels) | |
| BicubicBSplineApproximation (const std::vector< vec3 > &dataPoints, const vec2i &gridSize, int numLevels) | |
| void | setPoints (const std::vector< vec3 > &dataPoints) |
| Sets data points that should be approximated by the BSpline function. | |
| double | evaluate (double x, double y) const |
| Evaluate the value of the fitted surface at given x and y coordinate. Both x and y are assumed to be in [0, 1]. | |
| std::unique_ptr< SharedImage > | generateSmoothImage (const ImageDescriptor &descriptor) const |
| Generates a smooth image based on the current control point grid. | |
| PointGrid | calculateControlPoints (const std::vector< vec3 > &dataPoints, const vec2i &gridSize) const |
| Update the control point values based on the current aggregates. | |
| std::pair< PointGrid, PointGrid > | calculatePointContributions (const vec3 &point) const |
| Calculate the contribution of the given data point on its surrounding control points. | |
| PointGrid | controlPointGrid () const |
| void | setControlPointGrid (PointGrid grid) |
| vec2i | gridSize () const |
| void | setGridSize (vec2i gridSize) |
| int | numLevels () const |
| void | setNumLevels (int numLevels) |
Static Public Member Functions | |
| static PointGrid | refineControlPoints (PointGrid currentGrid) |
| Refine the current control point grid into a grid with twice the resolution. | |
| static double | evaluateBasis (double t, int basisIndex) |
| Evaluate the given basis function at t. | |
Protected Attributes | |
| vec2i | m_gridSize |
| int | m_numLevels |
| std::vector< std::vector< double > > | m_grid |
| number of refinement levels for the estimation | |
| void setPoints | ( | const std::vector< vec3 > & | dataPoints | ) |
Sets data points that should be approximated by the BSpline function.
The first two entries of each point should lie between 0 and 1 and describe the position of the point as a fraction of the image size for x and y respectively. The third entry is the intensity value at that position.