Basic Image AlgorithmS Library
2.8.0
|
this class interpolates a function y=f(t) between given control points (the y-values) More...
#include <MathAlgo/Interpolator.hh>
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
int | Bezier3 (double &res, double t) |
these functions do the bezier interpolation as described in David Salomon 4.14.19 which reaches each control point /////////////////////////////////////////// IMPORTANT NOTICE: if the knotpoints are not set, the value of t must be between 0 and 1! if t > 1 the value of the last controlpoint is returned! /////////////////////////////////////////// calculates P(t)= tvector(t)*nmatrix*cpoints More... | |
int | Bezier3 (BIAS::Vector2< double > &res, double t) |
2 dimensional case tested 28.04.03 More... | |
int | Bezier3 (BIAS::Vector3< double > &res, double t) |
3 dimensional case 28.04.03 tested and working More... | |
void | Clear () |
resets everything. More... | |
void | ClearEndTangent () |
void | ClearStartTangent () |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
const bool | DoLuTSplinesDiffer (const Interpolator &I) const |
Compare LuT data structures if matching perfectly. More... | |
void | DrawBezierCoords2 (Image< unsigned char > &img) |
void | GetControlPoints (std::vector< double > &cPnt) const |
void | GetControlPoints (std::vector< BIAS::Vector2< double > > &cPnt) const |
void | GetControlPoints (std::vector< BIAS::Vector3< double > > &cPnt) const |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
void | GetKnotPoints (std::vector< double > &kPnt) const |
void | InitBezier (int dim_of_CP) |
here the calculation of all coefficients for the bezier interpolation is done and the nmatrix is set is called by Bezier3() if not called manually More... | |
void | InitSpline () |
call this for restart at t= first knot point initiates recalculation of all polynom coefficients at first call of Spline() More... | |
Interpolator () | |
Interpolator (const Interpolator &ip) | |
long int | Name2DebugLevel (const std::string &name) const |
looks up a debuglevel in the internal map, returns 0 if not found More... | |
long int | NewDebugLevel (const std::string &name) |
creates a new debuglevel More... | |
int | PrepareLuTSpline (double min, double max, unsigned int N, unsigned int k=3) |
Prepare Look-up-Table in range [min,max] with N samples. More... | |
void | PrintDebugLevel (std::ostream &os=std::cout) const |
void | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
void | SetControlPoints (const std::vector< double > &cPnt1) |
set the control points, which control the interpolating curve More... | |
void | SetControlPoints (const std::vector< BIAS::Vector2< double > > &cPnt) |
void | SetControlPoints (const std::vector< BIAS::Vector3< double > > &cPnt) |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetEndTangent (double endTangent) |
void | SetEndTangent (BIAS::Vector2< double > endTangent) |
void | SetEndTangent (BIAS::Vector3< double > endTangent) |
void | SetKnotPoints (const std::vector< double > &kPnt) |
set the additional knot points, if you want nonuniform interpolation. More... | |
void | SetStartTangent (double startTangent) |
void | SetStartTangent (BIAS::Vector2< double > startTangent) |
void | SetStartTangent (BIAS::Vector3< double > startTangent) |
void | SetTangentsHermite (const std::vector< double > &cTan1) |
for hermite splines, a tangent can be given for each control point. More... | |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
int | Spline (double &res, double t, unsigned int k=3) |
these functions do the Spline interpolation which reaches each control point. More... | |
int | Spline (BIAS::Vector2< double > &res, double t, unsigned int k=3) |
int | Spline (BIAS::Vector3< double > &res, double t, unsigned int k=3) |
int | SplineFromLuT (double &res, double t) const |
Get spline interpolation using Look-up-Table. More... | |
~Interpolator () | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
void | fakima (BIAS::Vector< double > &a, BIAS::Vector< double > Px, BIAS::Vector< double > Py, int from, int to, int intervall) |
void | InitLinear (std::vector< BIAS::Vector< double > > &listP, const std::vector< double > &listPnt) |
void | InitSpline (const unsigned int k, const unsigned int dim) |
void | InitSpline2 (std::vector< BIAS::Vector< double > > &listP, const std::vector< double > &listPnt, double startTangent=0) |
void | InitSpline3 (std::vector< BIAS::Vector< double > > &listP, const std::vector< double > &listPnt, const double startTangent=0, const double endTangent=0) |
void | InitSplineAkima (std::vector< BIAS::Vector< double > > &listP, const std::vector< double > &listPnt, const double startTangent, const double endTangent) |
void | InitSplineHermite (std::vector< double > &tangents, const std::vector< double > &listPnt, const double startTangent, const double endTangent) |
bool | validate (double &t, bool debug=false) |
Protected Attributes | |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::map< std::string, long int > | _String2Debuglevel |
int | actIndex_ |
bool | bezierInitialized_ |
std::vector< double > | bXK_1_ |
std::vector< double > | bXK_2_ |
std::vector< double > | bXK_3_ |
std::vector< double > | bYK_1_ |
std::vector< double > | bYK_2_ |
std::vector< double > | bYK_3_ |
double | endTangentX_ |
double | endTangentY_ |
double | endTangentZ_ |
unsigned int | initializedPoly_ |
std::vector< double > | KPts_ |
std::vector< double > | listPntDim1_ |
std::vector< double > | listPntDim2_ |
std::vector< double > | listPntDim3_ |
std::vector< BIAS::Vector < double > > | listPolynoms1_ |
std::vector< BIAS::Vector < double > > | listPolynoms2_ |
std::vector< BIAS::Vector < double > > | listPolynoms3_ |
std::vector< double > | listTangDim1_ |
double | LuTMax1_ |
double | LuTMin1_ |
double | LuTSampleDist1_ |
BIAS::Matrix< double > | nmatrix_ |
std::vector< double > | SplineLuT1_ |
double | startTangentX_ |
double | startTangentY_ |
double | startTangentZ_ |
std::vector< double > | T_ |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
this class interpolates a function y=f(t) between given control points (the y-values)
this class interpolates a function y=f(t) with different algorithms between given control points (the y-values), which can be one, two or three dimensional. Interpolation means, the curve reaches all control points.
usage:
see also 'Computer Graphics & Geometric Modeling' from David Salomon
Definition at line 71 of file Interpolator.hh.
Interpolator::Interpolator | ( | ) |
Definition at line 40 of file Interpolator.cpp.
|
inline |
Definition at line 76 of file Interpolator.hh.
Interpolator::~Interpolator | ( | ) |
Definition at line 51 of file Interpolator.cpp.
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
int Interpolator::Bezier3 | ( | double & | res, |
double | t | ||
) |
these functions do the bezier interpolation as described in David Salomon 4.14.19 which reaches each control point
/////////////////////////////////////////// IMPORTANT NOTICE: if the knotpoints are not set, the value of t must be between 0 and 1! if t > 1 the value of the last controlpoint is returned! /////////////////////////////////////////// calculates P(t)= tvector(t)*nmatrix*cpoints
1 dimensional case untested 12.05.03
reference | to the result(return value) |
time | t of which value is to be calculated |
detection in which segment t is found starting with a segment 0
Definition at line 954 of file Interpolator.cpp.
References BIAS::Matrix< T >::Mult().
int Interpolator::Bezier3 | ( | BIAS::Vector2< double > & | res, |
double | t | ||
) |
2 dimensional case tested 28.04.03
detection in which segment t is found starting with a segment 0
Definition at line 1032 of file Interpolator.cpp.
References BIAS::Matrix< T >::Mult().
int Interpolator::Bezier3 | ( | BIAS::Vector3< double > & | res, |
double | t | ||
) |
3 dimensional case 28.04.03 tested and working
detection in which segment t is found starting with a segment 0
Definition at line 1119 of file Interpolator.cpp.
References BIAS::Matrix< T >::Mult().
void Interpolator::Clear | ( | ) |
resets everything.
clears all lists and calls constructor
Definition at line 57 of file Interpolator.cpp.
Referenced by BIAS::ProjectionParametersPerspectiveDepth::PrepareSpline_().
|
inline |
Definition at line 128 of file Interpolator.hh.
|
inline |
Definition at line 117 of file Interpolator.hh.
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
const bool Interpolator::DoLuTSplinesDiffer | ( | const Interpolator & | I | ) | const |
Compare LuT data structures if matching perfectly.
Used for ProjectionParametersSpherical compare.
Definition at line 1207 of file Interpolator.cpp.
References LuTMax1_, LuTMin1_, LuTSampleDist1_, and SplineLuT1_.
void BIAS::Interpolator::DrawBezierCoords2 | ( | Image< unsigned char > & | img | ) |
|
protected |
Definition at line 278 of file Interpolator.cpp.
References Lapack_LU_linear_solve().
|
inline |
Definition at line 91 of file Interpolator.hh.
Referenced by BIAS::operator<<().
void Interpolator::GetControlPoints | ( | std::vector< BIAS::Vector2< double > > & | cPnt | ) | const |
Definition at line 123 of file Interpolator.cpp.
References BIAS::Vector2< T >::clear().
void Interpolator::GetControlPoints | ( | std::vector< BIAS::Vector3< double > > & | cPnt | ) | const |
Definition at line 136 of file Interpolator.cpp.
References BIAS::Vector3< T >::clear().
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
Definition at line 103 of file Interpolator.hh.
Referenced by BIAS::operator<<().
void Interpolator::InitBezier | ( | int | dim_of_CP | ) |
here the calculation of all coefficients for the bezier interpolation is done and the nmatrix is set is called by Bezier3() if not called manually
Calculation of the coefficients of the Bezier interpolation.
dimension | of Control Points |
dimension | of control points (int) tested 12.05.03 |
Definition at line 785 of file Interpolator.cpp.
|
protected |
Definition at line 575 of file Interpolator.cpp.
void Interpolator::InitSpline | ( | ) |
call this for restart at t= first knot point initiates recalculation of all polynom coefficients at first call of Spline()
Definition at line 197 of file Interpolator.cpp.
Referenced by BIAS::ProjectionParametersSpherical::InitAngleCorrFromPoly(), BIAS::ProjectionParametersIO::InitAngleCorrFromPoly_(), and BIAS::ProjectionParametersPerspectiveDepth::PrepareSpline_().
|
protected |
Definition at line 593 of file Interpolator.cpp.
|
protected |
Definition at line 537 of file Interpolator.cpp.
|
protected |
Definition at line 400 of file Interpolator.cpp.
References BIAS::SVD::Compute(), BIAS::Matrix< T >::Fill(), BIAS::SVD::Invert(), and Lapack_LU_linear_solve().
|
protected |
Definition at line 203 of file Interpolator.cpp.
|
protected |
Definition at line 367 of file Interpolator.cpp.
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
int Interpolator::PrepareLuTSpline | ( | double | min, |
double | max, | ||
unsigned int | N, | ||
unsigned int | k = 3 |
||
) |
Prepare Look-up-Table in range [min,max] with N samples.
Prepare a Look-up-Table for spline interpolation in the range [min,max] with N samples. Use SplineFromLuT() afterwards;
Definition at line 1226 of file Interpolator.cpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
set the control points, which control the interpolating curve
Definition at line 87 of file Interpolator.hh.
Referenced by BIAS::ProjectionParametersSpherical::InitAngleCorrFromPoly(), BIAS::ProjectionParametersIO::InitAngleCorrFromPoly_(), and BIAS::ProjectionParametersPerspectiveDepth::PrepareSpline_().
void Interpolator::SetControlPoints | ( | const std::vector< BIAS::Vector2< double > > & | cPnt | ) |
Definition at line 90 of file Interpolator.cpp.
void Interpolator::SetControlPoints | ( | const std::vector< BIAS::Vector3< double > > & | cPnt | ) |
Definition at line 107 of file Interpolator.cpp.
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 121 of file Interpolator.hh.
|
inline |
Definition at line 122 of file Interpolator.hh.
|
inline |
Definition at line 124 of file Interpolator.hh.
|
inlinestaticinherited |
void Interpolator::SetKnotPoints | ( | const std::vector< double > & | kPnt | ) |
set the additional knot points, if you want nonuniform interpolation.
Otherwise they will be uniformly spaced. The values in kPnt must be increasing, such that kPnt[i]<kPnt[i+1]
Definition at line 182 of file Interpolator.cpp.
Referenced by BIAS::ProjectionParametersSpherical::InitAngleCorrFromPoly(), BIAS::ProjectionParametersIO::InitAngleCorrFromPoly_(), and BIAS::ProjectionParametersPerspectiveDepth::PrepareSpline_().
|
inline |
Definition at line 107 of file Interpolator.hh.
|
inline |
Definition at line 110 of file Interpolator.hh.
|
inline |
Definition at line 113 of file Interpolator.hh.
|
inline |
for hermite splines, a tangent can be given for each control point.
Definition at line 134 of file Interpolator.hh.
|
inlineinherited |
int Interpolator::Spline | ( | double & | res, |
double | t, | ||
unsigned int | k = 3 |
||
) |
these functions do the Spline interpolation which reaches each control point.
k is the degree of the interpolation polynom. implemented for k=1,2,3,4 (linear, quadratic splines, cubic splines, akima cubic splines) If no start or end tangents are set, the end condition is relaxed for cubic and akima splines. for k=5 and a 1D function hermite splines are implemented (todo for vector2/3).
Definition at line 659 of file Interpolator.cpp.
Referenced by BIAS::ProjectionParametersPerspectiveDepth::DistortDepth(), BIAS::ProjectionParametersSpherical::InitAngleCorrFromPoly(), BIAS::ProjectionParametersIO::InitAngleCorrFromPoly_(), and BIAS::ProjectionParametersPerspectiveDepth::UnDistortDepth().
int Interpolator::Spline | ( | BIAS::Vector2< double > & | res, |
double | t, | ||
unsigned int | k = 3 |
||
) |
Definition at line 713 of file Interpolator.cpp.
References BIAS::Vector2< T >::Set(), and BIAS::Vector2< T >::size().
int Interpolator::Spline | ( | BIAS::Vector3< double > & | res, |
double | t, | ||
unsigned int | k = 3 |
||
) |
Definition at line 743 of file Interpolator.cpp.
References BIAS::Vector3< T >::Set(), and BIAS::Vector3< T >::size().
int Interpolator::SplineFromLuT | ( | double & | res, |
double | t | ||
) | const |
Get spline interpolation using Look-up-Table.
return code is negativ if argument is out of bound os LuT
Definition at line 1246 of file Interpolator.cpp.
|
protected |
Definition at line 148 of file Interpolator.cpp.
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
Definition at line 280 of file Interpolator.hh.
|
protected |
Definition at line 284 of file Interpolator.hh.
|
protected |
Definition at line 263 of file Interpolator.hh.
|
protected |
Definition at line 264 of file Interpolator.hh.
|
protected |
Definition at line 265 of file Interpolator.hh.
|
protected |
Definition at line 267 of file Interpolator.hh.
|
protected |
Definition at line 268 of file Interpolator.hh.
|
protected |
Definition at line 269 of file Interpolator.hh.
|
protected |
Definition at line 276 of file Interpolator.hh.
|
protected |
Definition at line 277 of file Interpolator.hh.
|
protected |
Definition at line 278 of file Interpolator.hh.
|
staticprotectedinherited |
|
protected |
Definition at line 282 of file Interpolator.hh.
|
protected |
Definition at line 247 of file Interpolator.hh.
|
protected |
Definition at line 251 of file Interpolator.hh.
|
protected |
Definition at line 252 of file Interpolator.hh.
|
protected |
Definition at line 253 of file Interpolator.hh.
|
protected |
Definition at line 258 of file Interpolator.hh.
|
protected |
Definition at line 259 of file Interpolator.hh.
|
protected |
Definition at line 260 of file Interpolator.hh.
|
protected |
Definition at line 255 of file Interpolator.hh.
|
protected |
Definition at line 287 of file Interpolator.hh.
Referenced by DoLuTSplinesDiffer().
|
protected |
Definition at line 287 of file Interpolator.hh.
Referenced by DoLuTSplinesDiffer().
|
protected |
Definition at line 287 of file Interpolator.hh.
Referenced by DoLuTSplinesDiffer().
|
protected |
Definition at line 271 of file Interpolator.hh.
|
protected |
Definition at line 286 of file Interpolator.hh.
Referenced by DoLuTSplinesDiffer().
|
protected |
Definition at line 273 of file Interpolator.hh.
|
protected |
Definition at line 274 of file Interpolator.hh.
|
protected |
Definition at line 275 of file Interpolator.hh.
|
protected |
Definition at line 248 of file Interpolator.hh.