mtcnn_detector.py 文件源码

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

项目:prepare-faces-zyf 作者: walkoncross 项目源码 文件源码
def cv2_put_text_to_image(img, text, x, y, font_pix_h=10, color=(255, 0, 0)):
    if font_pix_h < 10:
        font_pix_h = 10

    y = y + font_pix_h
    # print img.shape

    h = img.shape[0]

    if x < 0:
        x = 0

    if y > h - 1:
        y = h - font_pix_h

    if y < 0:
        y = font_pix_h

    font_size = font_pix_h / 30.0
    # print font_size
    cv2.putText(img, text, (x, y), cv2.FONT_HERSHEY_SIMPLEX,
                font_size, color, 1, -1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号