SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
slipalgo Namespace Reference

Functions

BSpline interpolation
template<class Array >
void BSplinePoles (const std::size_t degree, Array &Poles)
 BSpline Poles computations based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename InputIterator >
double BSplineInitialCausalCoefficient (InputIterator infirst, InputIterator inlast, double z, double Tolerance)
 BSpline computation of causal coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename InputIterator >
double BSplineInitialAntiCausalCoefficient (InputIterator outlast, const double z)
 BSpline computation of anticausal coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename InputIterator , typename OutputIterator , typename InputIterator2 >
void BSplineComputeInterpolationCoefficients (InputIterator infirst, InputIterator inlast, OutputIterator outfirst, InputIterator2 Poles_first, InputIterator2 Poles_last, double Tolerance=std::numeric_limits< double >::epsilon())
 BSpline computation of coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename InputIterator , typename OutputIterator , class Array >
void BSplineComputeInterpolationCoefficients (InputIterator infirst, InputIterator inlast, OutputIterator outfirst, const Array &Poles, double Tolerance)
 BSpline computation of coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename RandomAccessIterator >
void BSplineComputeInterpolationIndexes (const std::size_t spline_degree, double x, RandomAccessIterator index_first, RandomAccessIterator index_last)
 Computes the bspline interpolations indices. based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename RandomAccessIterator , typename Array >
void BSplineComputeInterpolationWeights (const std::size_t spline_degree, double x, RandomAccessIterator index_first, RandomAccessIterator index_last, Array &Weights)
 Computes the bspline interpolations weights. based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<class RandomAccessIterator >
double BSplineInterpolatedValue (RandomAccessIterator coef_first, RandomAccessIterator coef_last, double x, std::size_t SplineDegree)
 BSpline interpolation from the interpolation coefficients. based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename RandomAccessIterator2d1 , typename RandomAccessIterator2d2 >
void BSplineSamplesToCoefficients2d (RandomAccessIterator2d1 in_up, RandomAccessIterator2d1 in_bot, const std::size_t degree, RandomAccessIterator2d2 out_up, RandomAccessIterator2d2 out_bot, const double tolerance=std::numeric_limits< double >::epsilon())
 Convert a 2d samples range to a 2d bspline coefficients range. More...
 
template<class Matrix1 , class Matrix2 >
void BSplineSamplesToCoefficients (const std::size_t degree, const Matrix1 &input, Matrix2 &output)
 BSpline computation of coefficients for 2D container based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 
template<typename RandomAccessIterator3d1 , typename RandomAccessIterator3d2 >
void BSplineSamplesToCoefficients3d (RandomAccessIterator3d1 in_fup, RandomAccessIterator3d1 in_bbot, const std::size_t degree, RandomAccessIterator3d2 out_fup, RandomAccessIterator3d2 out_bbot, const double tolerance=std::numeric_limits< double >::epsilon())
 Convert a 3d samples range to a 3d bspline coefficients range. More...
 
template<typename RandomAccessIterator2d >
double BSplineInterpolatedValue (RandomAccessIterator2d Bcoeff_up, RandomAccessIterator2d Bcoeff_bot, double x, double y, std::size_t SplineDegree)
 Computes the 2d BSpline interpolation from 2d bspline interpolation coefficients. More...
 
template<class Matrix1 >
double BSplineInterpolatedValue (Matrix1 &Bcoeff, double x, double y, std::size_t SplineDegree)
 Computes the 2d BSpline interpolation from 2d bspline interpolation coefficients. More...
 
template<class Container3d >
double BSplineInterpolatedValue (Container3d &Bcoeff, double x, double y, double z, std::size_t SplineDegree)
 Computes the 3d BSpline interpolation from 3d bspline interpolation coefficients. More...
 
template<typename RandomAccessIterator3d >
double BSplineInterpolatedValue (RandomAccessIterator3d Bcoeff_fup, RandomAccessIterator3d Bcoeff_bbot, double x, double y, double z, std::size_t SplineDegree)
 Computes the 3d BSpline interpolation from 3d bspline interpolation coefficients. More...
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
void bspline_resampling_1d (RandomAccessIterator1 in_first, RandomAccessIterator1 in_last, const std::size_t spline_degree, RandomAccessIterator2 out_first, RandomAccessIterator2 out_last)
 Resample a range using bspline interpolation. More...
 
template<typename RandomAccessIterator2d1 , typename RandomAccessIterator2d2 >
void bspline_resampling_2d (RandomAccessIterator2d1 in_up, RandomAccessIterator2d1 in_bot, const std::size_t spline_degree, RandomAccessIterator2d2 out_up, RandomAccessIterator2d2 out_bot)
 Resample a 2d range using bspline interpolation. More...
 
template<typename RandomAccessIterator3d1 , typename RandomAccessIterator3d2 >
void bspline_resampling_3d (RandomAccessIterator3d1 in_fup, RandomAccessIterator3d1 in_bbot, const std::size_t spline_degree, RandomAccessIterator3d2 out_fup, RandomAccessIterator3d2 out_bbot)
 Resample a 3d range using bspline interpolation. More...
 
template<class GrayScaleImage >
void BSplineGeometricTransformation (const GrayScaleImage &InputImage, GrayScaleImage &OutputImage, const int SplineDegree=3, const double OriginX=0.0, const double OriginY=0.0, const double Angle=0.0, const double ShiftX=0.0, const double ShiftY=0.0, const bool Masking=true)
 BSpline computation of a geometric transformation. based on http://bigwww.epfl.ch/thevenaz/interpolation/. More...
 

Function Documentation

template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
void slipalgo::bspline_resampling_1d ( RandomAccessIterator1  in_first,
RandomAccessIterator1  in_last,
const std::size_t  spline_degree,
RandomAccessIterator2  out_first,
RandomAccessIterator2  out_last 
)

Resample a range using bspline interpolation.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
in_firstRandomAccessIterator to the input range.
in_lastRandomAccessIterator to the input range.
degreebspline degree (between 2 and 9)
out_firstRandomAccessIterator to the output range.
out_lastRandomAccessIterator to the output range.
Precondition
(out_last-out_first) >= (in_last-in_first)
Example:
slip::iota(A.begin(),A.end(),1.0,1.0);
std::cout<<"A = \n"<<A<<std::endl;
slip::Array<double> Aup2(A.size()*3);
3,
Aup2.begin(),Aup2.end());
std::cout<<"Aup 3 = \n"<<Aup2<<std::endl;

Definition at line 1436 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator2d1 , typename RandomAccessIterator2d2 >
void slipalgo::bspline_resampling_2d ( RandomAccessIterator2d1  in_up,
RandomAccessIterator2d1  in_bot,
const std::size_t  spline_degree,
RandomAccessIterator2d2  out_up,
RandomAccessIterator2d2  out_bot 
)

Resample a 2d range using bspline interpolation.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
in_upRandomAccessIterator2d to the input range.
in_botRandomAccessIterator2d to the input range.
degreebspline degree (between 2 and 9)
out_upRandomAccessIterator2d to the output range.
out_botRandomAccessIterator2d to the output range.
Precondition
(in_bot-in_up)[0] <= (out_bot-out_up)[0]
(in_bot-in_up)[1] <= (out_bot-out_up)[1]
Example:
slip::iota(Min.begin(),Min.end(),1.0,1.0);
std::cout<<"Min = \n"<<Min<<std::endl;
slip::Array2d<double> Mout(Min.rows()*2,
Min.cols()*3);
slipalgo::bspline_resampling_2d(Min.upper_left(),Min.bottom_right(),
3,
Mout.upper_left(),Mout.bottom_right());
std::cout<<"Mout = \n"<<Mout<<std::endl;

Definition at line 1498 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator3d1 , typename RandomAccessIterator3d2 >
void slipalgo::bspline_resampling_3d ( RandomAccessIterator3d1  in_fup,
RandomAccessIterator3d1  in_bbot,
const std::size_t  spline_degree,
RandomAccessIterator3d2  out_fup,
RandomAccessIterator3d2  out_bbot 
)

Resample a 3d range using bspline interpolation.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
in_fupRandomAccessIterator3d to the input range.
in_bbotRandomAccessIterator3d to the input range.
degreebspline degree (between 2 and 9)
out_fupRandomAccessIterator3d to the output range.
out_bbotRandomAccessIterator3d to the output range.
Precondition
(in_bbot-in_fup)[0] <= (out_bbot-out_fup)[0]
(in_bbot-in_fup)[1] <= (out_bbot-out_fup)[1]
(in_bbot-in_fup)[2] <= (out_bbot-out_fup)[3]
Example:
slip::Array3d<double> Min3d(5,7,6);
slip::iota(Min3d.begin(),Min3d.end(),1.0,1.0);
std::cout<<"Min3d = \n"<<Min3d<<std::endl;
slip::Array3d<double> Mout3d(Min3d.slices()*2,
Min3d.rows()*2,
Min3d.cols()*2);
slipalgo::bspline_resampling_3d(Min3d.front_upper_left(),
Min3d.back_bottom_right(),
3,
Mout3d.front_upper_left(),
Mout3d.back_bottom_right());
std::cout<<"Mout3d = \n"<<Mout3d<<std::endl;

Definition at line 1588 of file bspline_interpolation.hpp.

template<typename InputIterator , typename OutputIterator , typename InputIterator2 >
void slipalgo::BSplineComputeInterpolationCoefficients ( InputIterator  infirst,
InputIterator  inlast,
OutputIterator  outfirst,
InputIterator2  Poles_first,
InputIterator2  Poles_last,
double  Tolerance = std::numeric_limits<double>::epsilon() 
)
inline

BSpline computation of coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.2.0
Version
0.0.1
Parameters
infirstbegin iterator on datas
inlastpast-to-end iterator on datas
outfirstbegin iterator on results
Poles_firstbegin iterator on Poles.
Poles_lastpast-to-end iterator on Poles.
Tolerancetolerance used : admissible relative error
Example:
slip::iota(A.begin(),A.end(),1.0,1.0);
std::cout<<"A = \n"<<A<<std::endl;
std::cout<<"Poles = \n"<<Poles<<std::endl;
slip::Array<double> Coef(A.size());
Coef.begin(),
Poles.begin(),Poles.end(),
std::cout<<"Coef = \n"<<Coef<<std::endl;

Definition at line 285 of file bspline_interpolation.hpp.

template<typename InputIterator , typename OutputIterator , class Array >
void slipalgo::BSplineComputeInterpolationCoefficients ( InputIterator  infirst,
InputIterator  inlast,
OutputIterator  outfirst,
const Array &  Poles,
double  Tolerance 
)
inline

BSpline computation of coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.2.0
1.0.0
Version
0.0.1
Parameters
infirstbegin iterator on datas
inlastpast-to-end iterator on datas
outfirstbegin iterator on results
PolesPoles array
Tolerancetolerance used : admissible relative error
Deprecated:
you should use slipalgo::BSplineComputeInterpolationCoefficients(InputIterator infirst, InputIterator inlast, OutputIterator outfirst, InputIterator2 Poles_first, InputIterator2 Poles_last, double Tolerance = std::numeric_limits<double>::epsilon()) instead.

Definition at line 366 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator >
void slipalgo::BSplineComputeInterpolationIndexes ( const std::size_t  spline_degree,
double  x,
RandomAccessIterator  index_first,
RandomAccessIterator  index_last 
)
inline

Computes the bspline interpolations indices. based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.2.0
Version
0.0.1
Parameters
spline_degreebspline degree.
xcoordinate to interpolate.
index_firstRandomAccessIterator to the index range.
index_lastRandomAccessIterator to the index range.

Definition at line 392 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator , typename Array >
void slipalgo::BSplineComputeInterpolationWeights ( const std::size_t  spline_degree,
double  x,
RandomAccessIterator  index_first,
RandomAccessIterator  index_last,
Array &  Weights 
)
inline

Computes the bspline interpolations weights. based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.2.0
Version
0.0.1
Parameters
spline_degreebspline degree.
xcoordinate to interpolate.
index_firstRandomAccessIterator to the index range.
index_lastRandomAccessIterator to the index range.
WeightsArray containing the bspline interpolation weights.

Definition at line 432 of file bspline_interpolation.hpp.

template<class GrayScaleImage >
void slipalgo::BSplineGeometricTransformation ( const GrayScaleImage &  InputImage,
GrayScaleImage &  OutputImage,
const int  SplineDegree = 3,
const double  OriginX = 0.0,
const double  OriginY = 0.0,
const double  Angle = 0.0,
const double  ShiftX = 0.0,
const double  ShiftY = 0.0,
const bool  Masking = true 
)
inline

BSpline computation of a geometric transformation. based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.0.0
Version
0.0.1
Parameters
InputImageInput Image
OutputImageOutput Image
SplineDegreeSpline degree
OriginXOrigin of the x
OriginYOrigin of the y
AngleRotation angle
ShiftXShift for x
ShiftYShift for y
MaskingMasking uncover areas
Example:
ImageIn.read("lena.jpg");
slip::GrayscaleImage<double> ImageOut(ImageIn.rows(),ImageIn.cols());
slip::BSplineGeometricTransformation(ImageIn,ImageOut,3,0,0,15,0,0,true);
ImageOut.write("interpol.png");

Definition at line 1677 of file bspline_interpolation.hpp.

template<typename InputIterator >
double slipalgo::BSplineInitialAntiCausalCoefficient ( InputIterator  outlast,
const double  z 
)
inline

BSpline computation of anticausal coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.0.0
Version
0.0.1
Parameters
outlastpast-to-end iterator on datas
zactual pole
Returns
causal coefficient

Definition at line 246 of file bspline_interpolation.hpp.

template<typename InputIterator >
double slipalgo::BSplineInitialCausalCoefficient ( InputIterator  infirst,
InputIterator  inlast,
double  z,
double  Tolerance 
)
inline

BSpline computation of causal coefficients based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.0.0
Version
0.0.1
Parameters
infirstbegin iterator on datas
inlastpast-to-end iterator on datas
zactual pole
Tolerancetolerance used
Returns
causal coefficient

Definition at line 185 of file bspline_interpolation.hpp.

template<class RandomAccessIterator >
double slipalgo::BSplineInterpolatedValue ( RandomAccessIterator  coef_first,
RandomAccessIterator  coef_last,
double  x,
std::size_t  SplineDegree 
)
inline

BSpline interpolation from the interpolation coefficients. based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.2.0
Version
0.0.1
Parameters
coef_firstRandomAccessIterator to the bspline interpolation range.
coef_lastRandomAccessIterator to the bspline interpolation range.
xcoordinate to interpolate.
SplineDegreebspline degree.
Example:
slip::iota(A.begin(),A.end(),1.0,1.0);
std::cout<<"A = \n"<<A<<std::endl;
std::cout<<"Poles = \n"<<Poles<<std::endl;
slip::Array<double> Coef(A.size());
Coef.begin(),
Poles.begin(),Poles.end(),
std::cout<<"Coef = \n"<<Coef<<std::endl;
std::cout<<"interpolate at x = 0.5, degree 3 : "<<slipalgo::BSplineInterpolatedValue(Coef.begin(),Coef.end(),1.5,3)<<std::endl;

Definition at line 657 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator2d >
double slipalgo::BSplineInterpolatedValue ( RandomAccessIterator2d  Bcoeff_up,
RandomAccessIterator2d  Bcoeff_bot,
double  x,
double  y,
std::size_t  SplineDegree 
)
inline

Computes the 2d BSpline interpolation from 2d bspline interpolation coefficients.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
Bcoeff_upRandomAccessIterator2d to the 2d bspline interpolation coefficients input range.
Bcoeff_botRandomAccessIterator2d to the 2d bspline interpolation coefficients input range.
xx interpolation coordinate.
yy interpolation coordinate.
SplineDegreebspline degree (between 2 and 9)

Definition at line 913 of file bspline_interpolation.hpp.

template<class Matrix1 >
double slipalgo::BSplineInterpolatedValue ( Matrix1 &  Bcoeff,
double  x,
double  y,
std::size_t  SplineDegree 
)
inline

Computes the 2d BSpline interpolation from 2d bspline interpolation coefficients.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.0.0
Version
0.0.1
Parameters
BcoeffMatrix of the 2d BSpline coefficients.
xx interpolation coordinate.
yy interpolation coordinate.
SplineDegreebspline degree (between 2 and 9)
Returns
double interpolated value.
Example:
const std::size_t rows = 10;
const std::size_t cols = 8;
const std::size_t spline_degree = 3;
slip::Array<double> Poles;
slipalgo::BSplinePoles(spline_degree,Poles);
slip::Array2d<double> Coef(rows,cols);
slipalgo::BSplineSamplesToCoefficients2d(A.upper_left(),A.bottom_right(),
spline_degree,
Coef.upper_left(),
Coef.bottom_right());
const std::size_t out_rows = 20;
const std::size_t out_cols = 16;
slip::Array<double> x(out_cols);
slip::iota(x.begin(),x.end(),0.0,1.0);
slip::range_fun_interab<double,double> funx(0.0,double(out_cols-1),0.0,double(in_cols-1));
slip::change_dynamic(x.begin(),x.end(),x.begin(),funx);
slip::Array<double> y(out_rows);
slip::iota(y.begin(),y.end(),0.0,1.0);
slip::range_fun_interab<double,double> funy(0.0,double(out_rows-1),0.0,double(in_rows-1));
slip::change_dynamic(y.begin(),y.end(),y.begin(),funy);
for(std::size_t i = 0; i < out_rows; ++i)
{
for(std::size_t j = 0; j < out_cols; ++j)
{
out[i][j] =
x[j],
y[i],
spline_degree);
}
}

Definition at line 1043 of file bspline_interpolation.hpp.

template<class Container3d >
double slipalgo::BSplineInterpolatedValue ( Container3d &  Bcoeff,
double  x,
double  y,
double  z,
std::size_t  SplineDegree 
)
inline

Computes the 3d BSpline interpolation from 3d bspline interpolation coefficients.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
Bcoeff3d bspline interpolation coefficients.
xx interpolation coordinate.
yy interpolation coordinate.
zz interpolation coordinate.
SplineDegreebspline degree (between 2 and 9)
Returns
double interpolated value
Example:
const std::size_t in_slices = 4;
const std::size_t in_rows = 8;
const std::size_t in_cols = 10;
slip::Array3d<double> Ain(in_slices, in_rows,in_cols);
const std::size_t out_slices = 2*in_slices;
const std::size_t out_rows = 2*in_rows;
const std::size_t out_cols = 2*in_cols;
slip::Array3d<double> Aout(out_slices, out_rows,out_cols);
slipalgo::BSplinePoles(spline_degree,Poles);
slip::Array3d<double> Coef(in_slices,in_rows,in_cols);
Ain.back_bottom_right(),
spline_degree,
Coef.front_upper_left(),
Coef.back_bottom_right());
slip::Array<double> x(out_cols);
slip::iota(x.begin(),x.end(),0.0,1.0);
slip::range_fun_interab<double,double> funx(0.0,double(out_cols-1),0.0,double(in_cols-1));
slip::change_dynamic(x.begin(),x.end(),x.begin(),funx);
slip::Array<double> y(out_rows);
slip::iota(y.begin(),y.end(),0.0,1.0);
slip::range_fun_interab<double,double> funy(0.0,double(out_rows-1),0.0,double(in_rows-1));
slip::change_dynamic(y.begin(),y.end(),y.begin(),funy);
slip::Array<double> z(out_slices);
slip::iota(z.begin(),z.end(),0.0,1.0);
slip::range_fun_interab<double,double> funz(0.0,double(out_slices-1),0.0,double(in_slices-1));
slip::change_dynamic(z.begin(),z.end(),z.begin(),funz);
for(std::size_t k = 0; k < out_slices; ++k)
{
for(std::size_t i = 0; i < out_rows; ++i)
{
for(std::size_t j = 0; j < out_cols; ++j)
{
out[k][i][j] =
x[j],
y[i],
z[k],
spline_degree);
}
}
}

Definition at line 1181 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator3d >
double slipalgo::BSplineInterpolatedValue ( RandomAccessIterator3d  Bcoeff_fup,
RandomAccessIterator3d  Bcoeff_bbot,
double  x,
double  y,
double  z,
std::size_t  SplineDegree 
)
inline

Computes the 3d BSpline interpolation from 3d bspline interpolation coefficients.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
Bcoeff_fupRandomAccessIterator3d to the 3d bspline interpolation coefficients input range.
Bcoeff_bbotRandomAccessIterator3d to the 3d bspline interpolation coefficients input range.
xx interpolation coordinate.
yy interpolation coordinate.
zz interpolation coordinate.
SplineDegreebspline degree (between 2 and 9)

Definition at line 1298 of file bspline_interpolation.hpp.

template<class Array >
void slipalgo::BSplinePoles ( const std::size_t  degree,
Array &  Poles 
)
inline

BSpline Poles computations based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.0.0
Version
0.0.1
Parameters
degreespline degree (between 2 and 9)
Polesarray of computed poles
Precondition
Poles must have resize function
Example:
std::cout<<"Poles = \n"<<Poles<<std::endl;

Definition at line 110 of file bspline_interpolation.hpp.

template<class Matrix1 , class Matrix2 >
void slipalgo::BSplineSamplesToCoefficients ( const std::size_t  degree,
const Matrix1 &  input,
Matrix2 &  output 
)
inline

BSpline computation of coefficients for 2D container based on http://bigwww.epfl.ch/thevenaz/interpolation/.

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Date
2007/03/19
Since
1.0.0
Version
0.0.1
Parameters
degreespline degree (between 2 and 9)
input2D container of input datas
output2D container of output datas (coefficients)
Returns
1 if error else 0
Precondition
containers must have the same sizes
containers must have iterators on rows and columns
containers must have width() and height() functions
input.rows()=output.rows()
input.cols()=output.cols()
Deprecated:
user BSplineSamplesToCoefficients2d instead

Definition at line 799 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator2d1 , typename RandomAccessIterator2d2 >
void slipalgo::BSplineSamplesToCoefficients2d ( RandomAccessIterator2d1  in_up,
RandomAccessIterator2d1  in_bot,
const std::size_t  degree,
RandomAccessIterator2d2  out_up,
RandomAccessIterator2d2  out_bot,
const double  tolerance = std::numeric_limits<double>::epsilon() 
)
inline

Convert a 2d samples range to a 2d bspline coefficients range.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
in_upRandomAccessIterator2d to the input range.
in_botRandomAccessIterator2d to the input range.
degreebspline degree (between 2 and 9)
out_upRandomAccessIterator2d to the coefficients range.
out_botRandomAccessIterator2d to the coefficients range.
Precondition
(in_bot-in_up)[0] == (out_bot-out_up)[0]
(in_bot-in_up)[1] == (out_bot-out_up)[1]
Example:
const std::size_t rows = 10;
const std::size_t cols = 8;
const std::size_t spline_degree = 3;
slip::Array<double> Poles;
slipalgo::BSplinePoles(spline_degree,Poles);
slip::Array2d<double> Coef(rows,cols);
slipalgo::BSplineSamplesToCoefficients2d(A.upper_left(),A.bottom_right(),
spline_degree,
Coef.upper_left(),
Coef.bottom_right());

Definition at line 738 of file bspline_interpolation.hpp.

template<typename RandomAccessIterator3d1 , typename RandomAccessIterator3d2 >
void slipalgo::BSplineSamplesToCoefficients3d ( RandomAccessIterator3d1  in_fup,
RandomAccessIterator3d1  in_bbot,
const std::size_t  degree,
RandomAccessIterator3d2  out_fup,
RandomAccessIterator3d2  out_bbot,
const double  tolerance = std::numeric_limits<double>::epsilon() 
)
inline

Convert a 3d samples range to a 3d bspline coefficients range.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Date
2011/10/20
Since
1.2.0
Version
0.0.1
Parameters
in_fupRandomAccessIterator3d to the input range.
in_bbotRandomAccessIterator3d to the input range.
degreebspline degree (between 2 and 9)
out_fupRandomAccessIterator3d to the output range.
out_bbotRandomAccessIterator3d to the output range.
Precondition
(in_bbot-in_fup)[0] <= (out_bbot-out_fup)[0]
(in_bbot-in_fup)[1] <= (out_bbot-out_fup)[1]
(in_bbot-in_fup)[2] <= (out_bbot-out_fup)[3]
Example:
slip::Array3d<double> Min3d(5,7,6);
slip::iota(Min3d.begin(),Min3d.end(),1.0,1.0);
std::cout<<"Min3d = \n"<<Min3d<<std::endl;
slip::Array3d<double> Coeff3d(Min3d.slices(),
Min3d.rows(),
Min3d.cols());
Min3d.back_bottom_right(),
3,
Coeff3d.front_upper_left(),
Coeff3d.back_bottom_right());
std::cout<<"Coeff3d = \n"<<Coeff3d<<std::endl;

Definition at line 847 of file bspline_interpolation.hpp.