Created
September 19, 2018 04:34
-
-
Save CaptainAshis/91456a5216f53c6c5d8896f28c2c03c5 to your computer and use it in GitHub Desktop.
pl_dihedral
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
def dihedral(x, dih): | |
""" Perform any of 8 permutations of 90-degrees rotations or flips for image x. """ | |
x = np.rot90(x, dih%4) | |
return x if dih<4 else np.fliplr(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment