我想为每个图像计数重复图像的数量。谁能帮我提供代码?当我是python新手时,有人可以回答代码本身吗?另外,请修复以下代码中的逻辑,因为其未在列表中添加正确的图片
unique=[]
duplicate=[]
for i in image_path_list:
image2 = cv2.imread(i)
image2 = cv2.resize(image2,(360,480))
for j in image_path_list:
if i!=j:
image1=cv2.imread(j)
image1=cv2.resize(image1, (360,480))
difference = cv2.subtract(image1, image2)
result = not np.any(difference) #if difference is all zeros it will return False
if result is True:
duplicate.append(j)
else:
unique.append(j)