Created
September 24, 2014 04:55
-
-
Save taldehyde/78f9688a0357b092cc0c to your computer and use it in GitHub Desktop.
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
import numpy as np | |
import cv2 | |
img = cv2.imread("lena.bmp",0) | |
upsideDown = np.zeros((512,512),dtype=np.uint8) | |
mirror = np.zeros((512,512),dtype=np.uint8) | |
diagonal = np.zeros((512,512),dtype=np.uint8) | |
for i in xrange(512): | |
for j in xrange(512): | |
upsideDown[i][j] = img[511-i][j] | |
mirror[i][j] = img[i][511-j] | |
diagonal[i][j] = img[j][i] | |
cv2.imwrite("lena_1.bmp",upsideDown) | |
cv2.imwrite("lena_2.bmp",mirror) | |
cv2.imwrite("lena_3.bmp",diagonal) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment