Try comparing images using RMS error metric.
authorCarl Hetherington <cth@carlh.net>
Sat, 30 Dec 2017 20:36:11 +0000 (20:36 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 30 Dec 2017 20:36:11 +0000 (20:36 +0000)
test/test.cc

index 0c2f324e05de99126375bba104bd508cb23091d9..41b845f85626c38859f45c3bbeb0af554575b3e3 100644 (file)
@@ -236,11 +236,8 @@ check_image (boost::filesystem::path ref, boost::filesystem::path check)
        ref_image.read (ref.string ());
        Magick::Image check_image;
        check_image.read (check.string ());
-       BOOST_CHECK_MESSAGE (
-               !ref_image.compare(check_image),
-               ref << " differs from " << check << " "
-                   << ref_image.meanErrorPerPixel() << " " << ref_image.normalizedMaxError() << " " << ref_image.normalizedMeanError()
-               );
+       double const dist = ref_image.compare(check_image, Magick::RootMeanSquaredErrorMetric);
+       BOOST_CHECK_MESSAGE (dist < 0.001, ref << " differs from " << check << " " << dist);
 }
 
 void