laplace_and_sobel.py 文件源码

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

项目:opencv_edge_detection 作者: tasdikrahman 项目源码 文件源码
def resize_to_screen(src, maxw=1280, maxh=700, copy=False):

    height, width = src.shape[:2]

    scl_x = float(width)/maxw
    scl_y = float(height)/maxh

    scl = int(np.ceil(max(scl_x, scl_y)))

    if scl > 1.0:
        inv_scl = 1.0/scl
        img = cv2.resize(src, (0, 0), None, inv_scl, inv_scl, cv2.INTER_AREA)
    elif copy:
        img = src.copy()
    else:
        img = src

    return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号