image = # some image translated to a numpy array
print(type(image))
>> numpy.ndarray
# np.fliplr will also do the trick
flipped_image_h = np.flip(image, axis=1) # flip horizontally
# np.flipud will also do the trick
flipped_image_v = np.flip(image, axis=0) # flip vertically
# Save flipped_image
因为这个问题在Python标签下——我假设您希望在Python中完成。翻转可以在
numpy
、PIL
或opencv
(您的选择)中完成See the numpy docs for more info
相关问题 更多 >
编程相关推荐