Draft: TestImageDifference asymmetrical result issue
Issue encountered in vtkImageDifference
. The class claims to be symmetrical to inputs A/B and B/A, but using test images I have encountered that the result in this case is asymmetrical.
Input images:
Setting
vtkNew<vtkImageDifference> diff12;
diff12->SetInputConnection(0, r1->GetOutputPort());
diff12->SetInputConnection(1, r2->GetOutputPort());
vtkNew<vtkPNGWriter> w12;
w12->SetFileName("diff12.png");
results in image
while using
vtkNew<vtkImageDifference> diff21;
diff21->SetInputConnection(0, r2->GetOutputPort());
diff21->SetInputConnection(1, r1->GetOutputPort());
vtkNew<vtkPNGWriter> w21;
w21->SetFileName("diff21.png");
results in image
The issue is quite important since vtkImageDifference
is used in vtkTesting
for image comparison between baseline images and new images created during tests. Merge request 9378 had tests passing with the above image despite the difference should resulted in a failed test.