声明:只是用来学习,请不要使用非法用途,责任自负
工具
使用python 3.6版本,安装如下库:
安装win32api
pip3 install pywin32
安装PIL
pip install Pillow
安装pyautogui
pip install pyautogui
安装numpy
pip install numpy
安装cv2
pip install opencv-python
安装matplotlib
pip install matplotlib
使用SPY查看相关窗口标题, 类名。此标题唯一, 故可以以此来查找相关窗口
得到窗口句柄

图像相似度打分算法
那么如何判断一张被PS过的图片是否与另一张图片本质上相同呢?比较简单、易用的解决方案是采用感知哈希算法(Perceptual Hash Algorithm)。
感知哈希算法是一类算法的总称,包括aHash、pHash、dHash。顾名思义,感知哈希不是以严格的方式计算Hash值,而是以更加相对的方式计算哈希值,因为“相似”与否,就是一种相对的判定。
aHash:平均值哈希。速度比较快,但是常常不太精确。
pHash:感知哈希。精确度比较高,但是速度方面较差一些。
dHash:差异值哈希。Amazing!精确度较高,且速度也非常快。因此我就选择了dHash作为我图片判重的def

图像搜索算法
使用res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)

网友评论