【发布时间】:2019-01-18 08:30:52
【问题描述】:
我喜欢快速、紧凑的代码,所以我对此有疑问:
def loader(input_path, new_img_width, new_img_height):
input_image = tifffile.imread(input_path)
input_image = cv2.resize(input_image, (new_img_width, new_img_height),
interpolation=cv2.INTER_NEAREST)
return input_image
如果new_img_width 和new_img_height 与input_image 中的相同或cv2.resize 代码中已经存在此条件语句,我是否需要在调用cv2.resize 之前添加条件语句?
除非必要,否则我不希望花费周期调整图像大小。
【问题讨论】: