import cv2, sys
image = cv2.imread("lenna.png", 0)
for i in range(int(sys.argv[1]),int(sys.argv[2])):
for j in range(int(sys.argv[3]),int(sys.argv[4])):
image[i][j] = 255 - image[i][j]
cv2.imshow("janela", image)
cv2.waitKey(0)
cv2.destroyAllWindows()
import cv2
import numpy as np
image = cv2.imread("lenna.png", 0)
height, width = image.shape
#position to be splitted in half of the vertical and 0 for horizontal
[h,w] = np.split(image, [int(height/2)], 0)
#concatenate flipped in horizontal
image = np.concatenate((w,h))
#position to be splitted in half of the hoizontal and 1 for vertical
[h,w] = np.split(image,[int(width/2)], 1)
#concatenate flipped in vertical
image = np.concatenate((w,h),1)
cv2.imshow("image",image)
cv2.waitKey(0)
cv2.destroyAllWindows()