def build_centering_transform(image_shape, target_shape):
rows, cols = image_shape
if target_shape is None:
trows,tcols = image_shape
else:
trows, tcols = target_shape
shift_x = (cols - tcols) / 2.0
shift_y = (rows - trows) / 2.0
return skimage.transform.SimilarityTransform(translation=(shift_x, shift_y))
img_augmentation.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录