@@ -0,0 +1,882 @@
+#!/usr/bin/env python3%0A%0Aimport sys%0Aimport cv2%0Aimport numpy as np%0A%0Aif len(sys.argv) %3C 3:%0A    print(%22Usage:%22)%0A    print(%22    %7B%7D target reference %5Bshow%5D%22.format(sys.argv%5B0%5D))%0A    sys.exit(1)%0A%0Atarget = cv2.imread(sys.argv%5B1%5D, cv2.IMREAD_ANYCOLOR)%0Areference = cv2.imread(sys.argv%5B2%5D, cv2.IMREAD_ANYCOLOR)%0A%0A# First check - if files aren't the same, bad news%0Aif target.shape != reference.shape:%0A    print(%22Images are not same size%22)%0A    print(%22Your image: %7B%7D%22.format(target.shape))%0A    print(%22Target image: %7B%7D%22.format(reference.shape))%0A    sys.exit(1)%0A%0A# Do image subtraction%0Adiff = np.abs(target - reference)%0Aprint(%22# diff: %7B%7D%22.format(np.count_nonzero(diff)))%0Aprint(%22%25 diff: %7B0:2.2f%7D%22.format(np.count_nonzero(diff) / diff.size * 100))%0A%0A# Optionally show image%0Aif len(sys.argv) %3E 3:%0A    cv2.namedWindow(%22Image Diff%22, cv2.WINDOW_NORMAL)%0A    cv2.imshow(%22Image Diff%22, diff)%0A    cv2.waitKey()%0A

Add diff script for image comparison