Commit 2ab61527 authored by Manuel Grizonnet's avatar Manuel Grizonnet

Automated merge with http://hg.orfeo-toolbox.org/OTB

parents 041ea1ad abcc7492
......@@ -275,7 +275,7 @@ GCPsToRPCSensorModelImageFilter< TImage >
sensorPoint = m_GCPsContainer[i].first;
groundPoint = m_GCPsContainer[i].second;
// Comute Transform
// Compute Transform
Point3DType groundPointTemp;
this->TransformPoint(sensorPoint, groundPointTemp, groundPoint[2]);
......
......@@ -159,6 +159,9 @@ private:
/** Return the current NEBN value */
inline double ComputeNoiseEquivalentBetaNaught(double range) const;
/** Evaluate polynom with Horner scheme*/
inline double Horner(std::vector<double> & coefficients, const double nebn) const;
/** Calibration Factor */
double m_CalibrationFactor;
......
......@@ -59,31 +59,16 @@ TerraSarCalibrationFunctor<TInput, TOutput>
::ComputeNoiseEquivalentBetaNaught(double range) const
{
// Formula: NEBN = Ks * SUM( coef_i * (tau - tau_ref)^i)
// Retrieve the polynomial degree
unsigned int polynomialDegree = m_NoiseRecord.get_polynomialDegree();
// Compute tau - tau_ref
double deltaTau = range - m_NoiseRecord.get_referencePoint();
const double deltaTau = range - m_NoiseRecord.get_referencePoint();
// Get polynomial coefficients
std::vector<double> coefficients = m_NoiseRecord.get_polynomialCoefficients();
// Initialize nebn value
double nebn = 0.;
// For each degree
std::vector<double>::const_iterator coefIt = coefficients.begin();
unsigned int degree = 0;
// Evaluate
double nebn = Horner (coefficients, deltaTau);
while(coefIt != coefficients.end() && degree <= polynomialDegree)
{
// Cumulate polynomial
nebn += (*coefIt) * vcl_pow(deltaTau,static_cast<double>(degree));
++degree;
++coefIt;
}
// Do not forget to multiply by the calibration factor
nebn*=m_CalibrationFactor;
......@@ -91,6 +76,22 @@ TerraSarCalibrationFunctor<TInput, TOutput>
return nebn;
}
template <class TInput, class TOutput>
double TerraSarCalibrationFunctor<TInput, TOutput>
::Horner(std::vector<double> & coefficients, const double nebn) const
{
std::vector<double>::const_reverse_iterator coefIt = coefficients.rbegin();
double res = *(coefIt);
++coefIt;
while(coefIt != coefficients.rend())
{
// Cumulate polynomial
res= res*nebn + (*coefIt);
++coefIt;
}
return res;
}
template <class TInput, class TOutput>
TOutput
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment