__init__.py 文件源码

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

项目:python-smart-crop 作者: epixelic 项目源码 文件源码
def center_from_good_features(matrix):
    x, y = (0, 0)
    weight = 0
    corners = cv2.goodFeaturesToTrack(matrix, FEATURE_DETECT_MAX_CORNERS, FEATURE_DETECT_QUALITY_LEVEL,
                                      FEATURE_DETECT_MIN_DISTANCE)

    for point in corners:
        weight += 1
        x += point[0][0]
        y += point[0][1]

    return {
        'x': x / weight,
        'y': y / weight,
        'count': weight
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号