Skip to content

Commit 9265393

Browse files
assignment day 2 shift image
1 parent e7716a7 commit 9265393

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

shift_image_downAndright.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import cv2
2+
import numpy as np
3+
4+
image = cv2.imread('chrisfoot.jpeg')
5+
shift = 40
6+
7+
for i in range(image.shape[1] -1, image.shape[1] - shift, -1):
8+
image = np.roll(image, -1, axis=1)
9+
image[:, -1] = 0
10+
11+
cv2.imshow('image', image)
12+
cv2.waitKey()

0 commit comments

Comments
 (0)