Last active
July 12, 2022 12:12
-
-
Save CLozy/c7f6d95aa67922037cee5145c4128a7a to your computer and use it in GitHub Desktop.
flipping image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image = Image.open('/content/gdrive/MyDrive/ComputerVisionEngineer/images/deadstar.jpg') | |
#horizontal flip | |
hor_flip = image.transpose(Image.FLIP_LEFT_RIGHT) | |
#vertical flip | |
ver_flip = image.transpose(Image.FLIP_TOP_BOTTOM) | |
#plot all three using matplotlib | |
f = pyplot.figure(figsize=(30,30)) | |
f.add_subplot(131) | |
pyplot.imshow(image) | |
f.add_subplot(132) | |
pyplot.imshow(hor_flip) | |
f.add_subplot(133) | |
pyplot.imshow(ver_flip) | |
pyplot.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment