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
laplace_and_sobel_histogram.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录