OnmyojiAutoScript icon indicating copy to clipboard operation
OnmyojiAutoScript copied to clipboard

希望增加颜色匹配方法

Open ljxun opened this issue 1 year ago • 3 comments

当前不足

有的图片颜色不同appear方法识别效果是相同的 希望增加颜色匹配方法

解决方案

def color_image_same(file: str,file1: str): # 读取两张图片 img1 = cv2.imread(file) img2 = cv2.imread(file1)

# 计算直方图
hist1 = cv2.calcHist([img1], [0], None, [256], [0, 256])
hist2 = cv2.calcHist([img2], [0], None, [256], [0, 256])

# 归一化直方图
cv2.normalize(hist1, hist1)
cv2.normalize(hist2, hist2)

# 计算直方图的相似度
similarity = cv2.compareHist(hist1, hist2, cv2.HISTCMP_CORREL)

print(f'颜色直方图相似度: {similarity}')
return similarity

其他内容

Screenshots_create_daoguan Screenshots_create_daoguan_ok

具体实现靠你了

ljxun avatar Sep 14 '24 04:09 ljxun

MuMu12-20240909-201659 MuMu12-20240914-122509

ljxun avatar Sep 14 '24 06:09 ljxun

你看看module.atom.image.py这个文件的sift_match跟match_mean_color用不用得上?

ohspecial avatar Sep 21 '24 02:09 ohspecial

不需要颜色识别, 我认为每次进来都点击一下就可以了,

endlesswxk avatar Oct 02 '24 17:10 endlesswxk