def read_split_image(img):
mat = misc.imread(img).astype(np.float)
side = int(mat.shape[1] / 2)
assert side * 2 == mat.shape[1]
img_A = mat[:, :side] # target
img_B = mat[:, side:] # source
return img_A, img_B
文章目录