Commit 42b20073 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: Relative comparison for vector pixels

parent 680bddaa
......@@ -190,6 +190,13 @@ DifferenceImageFilter<TInputImage, TOutputImage>
}
}
}
//for complex and vector type. FIXME: module might be better
ScalarRealType tMax=t[0];
for (unsigned int j = 0;j<t.Size();++j)
{
if (t[j]>tMax) tMax = t[j];
}
// Check if difference is above threshold
// the threshold is interpreted as relative to the value
......@@ -197,7 +204,7 @@ DifferenceImageFilter<TInputImage, TOutputImage>
for(unsigned int j = 0;j<minimumDifference.Size();++j)
{
if(minimumDifference[j] > m_DifferenceThreshold * vcl_abs(t[j]))
if(minimumDifference[j] > m_DifferenceThreshold * tMax)
{
isDifferent = true;
}
......
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