📅  最后修改于: 2022-03-11 14:44:49.715000             🧑  作者: Mango
# creates the resulting image with double the size and 3 channels
output = np.zeros((w+h+h , w + h + h, 3), dtype="uint8")
# top img
output[0:h, h:h+w] = img
# left img (rotated 90°)
output[h:h+w, 0:h] = np.rot90(img,1)
# right img (rotated 270°)
output[h:h + w, h + w:h +w +h] = np.rot90(img,3)
# bottom img (rotated 180°)
output[h+w:h+w+h, h:h+w] = np.rot90(img,2)