def find_template(template):
method = 'cv2.TM_CCOEFF'
w, h = template.shape[::-1]
res = cv2.matchTemplate(image, template, eval(method))
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)
top_left = max_loc
bottom_right = (top_left[0] + w, top_left[1] + h)
return top_left, bottom_right, res
评论列表
文章目录