Skip to content
Snippets Groups Projects
Commit 0732d0c2 authored by Julien Michel's avatar Julien Michel
Browse files

correction correlation

parent 17136215
No related branches found
No related tags found
No related merge requests found
...@@ -89,14 +89,17 @@ public: ...@@ -89,14 +89,17 @@ public:
TOutput crossCorrel = 0.0; TOutput crossCorrel = 0.0;
for(unsigned long pos = 0; pos< itA.Size(); ++pos) if(varA!=0 && varB!=0)
{
if(varA!=0 && varB!=0)
{ {
crossCorrel += (static_cast<TOutput>(itA.GetPixel(pos))-meanA)*(static_cast<TOutput>(itB.GetPixel(pos))-meanB)/(itA.Size()*vcl_sqrt(varA*varB)); for(unsigned long pos = 0; pos< itA.Size(); ++pos)
{
crossCorrel += (static_cast<TOutput>(itA.GetPixel(pos))-meanA)*(static_cast<TOutput>(itB.GetPixel(pos))-meanB)/(itA.Size()*vcl_sqrt(varA*varB));
}
} }
else if(varA==0 && varB==0)
{
crossCorrel = 1;
} }
return static_cast<TOutput>( 1.0-crossCorrel ); return static_cast<TOutput>( 1.0-crossCorrel );
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment