template_matching.py 文件源码

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

项目:cv-utils 作者: gmichaeljaison 项目源码 文件源码
def match_one(template, image, options=None):
    """
    Match template and find exactly one match in the Image using specified features.

    :param template: Template Image
    :param image: Search Image
    :param options: Options include
        - features: List of options for each feature
    :return: (Box, Score) Bounding box of the matched object, Heatmap value
    """
    heatmap, scale = multi_feat_match(template, image, options)

    min_val, _, min_loc, _ = cv.minMaxLoc(heatmap)
    top_left = tuple(scale * x for x in min_loc)
    score = min_val

    h, w = template.shape[:2]
    return Box(top_left[0], top_left[1], w, h), score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号