Created
January 11, 2019 05:04
-
-
Save chelseatroy/7a418b982caa29fb7fe6df88f91bd422 to your computer and use it in GitHub Desktop.
Examples for Symmetry
This file contains hidden or 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 horizontal_asymmetry(image): | |
left, right = np.hsplit(image, 2) | |
right_flipped = np.flip(right, axis=1) | |
return np.sum(left - right_flipped) ** 2 | |
def vertical_asymmetry(image): | |
top, bottom = np.vsplit(image, 2) | |
bottom_flipped = np.flip(bottom, axis=0) | |
return np.sum(top - bottom_flipped) ** 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment