vision.py 文件源码

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

项目:Vision2016 作者: Team3309 项目源码 文件源码
def aspect_ratio_score(contour):
    rect = cv2.minAreaRect(contour)
    width = rect[1][0]
    height = rect[1][1]

    ratio_score = 0.0

    # check to make sure the size is defined to prevent possible division by 0 error
    if width != 0 and height != 0:
        # the target is 1ft8in wide by 1ft2in high, so ratio of width/height is 20/14
        ratio_score = 100 - abs((width / height) - (20 / 14))

    return ratio_score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号