Commit 62c6ec1d authored by Manuel Grizonnet's avatar Manuel Grizonnet

ENH: delay multiplication to avoid round up error

parent 3a033810
......@@ -94,7 +94,7 @@ public:
{
TOutput outPixel;
double temp, temp2;
temp = static_cast<double>(inPixel) * m_Coefficient + m_Residu;
temp = (static_cast<double>(inPixel) + m_Residu)* m_Coefficient;
temp2 = temp / (1. + m_SphericalAlbedo * temp);
outPixel = static_cast<TOutput>(temp2);
......
......@@ -173,7 +173,7 @@ ReflectanceToSurfaceReflectanceImageFilter<TInputImage, TOutputImage>
* m_AtmosphericRadiativeTerms->GetDownwardTransmittance(wavelengthPosition)
* m_AtmosphericRadiativeTerms->GetUpwardTransmittance(wavelengthPosition));
coef = 1. / coef;
res = -m_AtmosphericRadiativeTerms->GetIntrinsicAtmosphericReflectance(wavelengthPosition) * coef;
res = -m_AtmosphericRadiativeTerms->GetIntrinsicAtmosphericReflectance(wavelengthPosition);
FunctorType functor;
functor.SetCoefficient(coef);
functor.SetResidu(res);
......
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