我要计算每个图像的重复图像数。有人能帮我查一下密码吗?我是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)
目前没有回答
相关问题 更多 >
编程相关推荐