def find_template_2D(template, img):
c = sp.correlate2d(img, template, mode='same')
# These y, x coordinates represent the peak. This point needs to be
# translated to be the top-left corner as the quiz suggests
y, x = np.unravel_index(np.argmax(c), c.shape)
return y - template.shape[0] // 2, x - template.shape[1] // 2
find_template_2D.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录