I am trying to solve a problem where I have to compare one image with a list of images for the similarity.
for fn in image_path_list:
difference = cv2.subtract(image1, fn)
result = not np.any(difference) #if difference is all zeros it will return False
if result is True:
print("The images are the same")
else:
cv2.imwrite("result.jpg", difference)
print("the images are different")
That leads to:
TypeError: src2 is not a numpy array, neither a scalar
What wrong am I doing? (I have to compare image1 with all the images in image_path_list)