标签:argmax 计算 return get pat ati print index sha
这两张图片的计算距离
import cv2
import numpy as np
def get_image_deviation():
'''
计算slideImg.png 与 slideImg.png 位移的距离
'''
print(sys.path)
slideImg = cv2.imread('图片路径1')
bgImg = cv2.imread(f'图片路径2')
result = cv2.matchTemplate(slideImg, bgImg, cv2.TM_CCOEFF_NORMED)
y, x = np.unravel_index(result.argmax(), result.shape)
return x
cv2.imread中的参数绝对不能有中文路径
标签:argmax 计算 return get pat ati print index sha
原文地址:https://www.cnblogs.com/pythonywy/p/12141648.html