Commit 2ea07dea authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fixing behaviour changes in vcl_pow starting ITK 4.10

parent b3020c47
...@@ -112,12 +112,12 @@ FourierMellinDescriptorsImageFunction<TInputImage, TCoordRep> ...@@ -112,12 +112,12 @@ FourierMellinDescriptorsImageFunction<TInputImage, TCoordRep>
for (unsigned int q= 0; q <= m_Qmax; q++) for (unsigned int q= 0; q <= m_Qmax; q++)
{ {
ScalarComplexType power(double(p-2.0+m_Sigma)/2.0, -double(q)/2.0); ScalarComplexType power(double(p-2.0+m_Sigma)/2.0, -double(q)/2.0);
if (x!=0 || y!=0) // vcl_pow limitations if(x!=0 || y !=0) // vcl_pow limitation
{ {
coefs.at(p).at(q) += vcl_pow(xplusiy, -p) * vcl_pow(x2plusy2, power) * value; coefs.at(p).at(q) += vcl_pow(xplusiy, -static_cast<double>(p)) * vcl_pow(x2plusy2, power) * value;
} }
} }
} }
} }
......
...@@ -106,11 +106,23 @@ ComplexMomentsImageFunction<TInputImage, TCoordRep> ...@@ -106,11 +106,23 @@ ComplexMomentsImageFunction<TInputImage, TCoordRep>
{ {
for (unsigned int q= 0; q <= m_Qmax; q++) for (unsigned int q= 0; q <= m_Qmax; q++)
{ {
moments.at(p).at(q) += vcl_pow(xpy, p) * vcl_pow(xqy, q) * value; ScalarComplexType pow1(1,0);
ScalarComplexType pow2(1,0);
if(p!=0 || x!=0 || y != 0)
{
pow1=vcl_pow(xpy,p);
}
if(q!=0 || x!=0 || y != 0)
{
pow2=vcl_pow(xqy,q);
}
moments.at(p).at(q) += pow1 * pow2 * value;
} }
} }
} }
// Normalisation // Normalisation
for (int p = m_Pmax; p >= 0; p--) for (int p = m_Pmax; p >= 0; p--)
{ {
......
Supports Markdown
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