Files
004_comission/vinniesniper-54816/task1/_lab/001-test-integration/compareImgs.py
louiscklaw b1cd1d4662 update,
2025-01-31 22:56:58 +08:00

10 lines
221 B
Python

# Compute pixel-by-pixel difference and return the sum
import cv2 as cv
def compareImgs(img1, img2):
# img2 = cv.resize(img2, (img1.shape[1], img1.shape[0]))
diff = cv.absdiff(img1, img2)
return diff.sum()