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

Conditions mirroir au bord

parent f51ba95f
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,6 @@ int otbMirrorBoundaryConditionTest(int argc, char * argv[])
itk::OStringStream oss;
PixelType in,out;
for(unsigned int i = 0;i<rad[0];++i)
{
for(unsigned int j = 0;j<rad[1];++j)
......@@ -72,5 +71,36 @@ int otbMirrorBoundaryConditionTest(int argc, char * argv[])
}
}
ImageType::IndexType center;
center[0]=reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2;
center[1]=reader->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2;
it.SetLocation(center);
bool resp = true;
for(unsigned int i = 0;i<rad[0];++i)
{
for(unsigned int j = 0;j<rad[1];++j)
{
off1[0] = -static_cast<int>(i);
off1[1] = -static_cast<int>(j);
off2[0] = i;
off2[1] = j;
out=it.GetPixel(off1);
in = it.GetPixel(off2);
for(unsigned int band = 0;band<reader->GetOutput()->GetNumberOfComponentsPerPixel();++band)
{
resp = resp && (out[band]==in[band]);
}
}
}
otbControlConditionTestMacro(resp,"All symmetrical value of the iterator are equal in the center of the image. their might be a problem.");
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment