find_template_2D.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:CV-lecture-quizzes-python 作者: pdvelez 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号