[英]How can I compare the cover art of 2 MP3 file using python: eyed3?
我正在为我的电脑和 MP3 播放器之间的 MP3 编写自己的同步文件。 我可以捕捉新文件、更改名称、艺术家等……但如果我更新了封面就更难了。
使用此命令获取图像文件。
eyeD3 --write-images=DIR mp3_file
比较图像的代码:
import cv2
import numpy as np
original = cv2.imread("imaoriginal_golden_bridge.jpg")
duplicate = cv2.imread("images/duplicate.jpg")
# Check if 2 images are equals
if original.shape == duplicate.shape:
print("The images have same size and channels")
difference = cv2.subtract(original, duplicate)
b, g, r = cv2.split(difference)
if cv2.countNonZero(b) == 0 and cv2.countNonZero(g) == 0 and cv2.countNonZero(r)== 0:
print("The images are completely Equal")
#display images
cv2.imshow("Original", original)
cv2.imshow("Duplicate", duplicate)
cv2.waitKey(0)
cv2.destroyAllWindows()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.