Skip to content

Commit 068f317

Browse files
authored
Add files via upload
1 parent a6839fe commit 068f317

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

rotate_image.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
import argparse
3+
import imutils
4+
import cv2
5+
6+
ap = argparse.ArgumentParser()
7+
ap.add_argument("-i", "--image", required = True, help = "path to the image file")
8+
args = vars(ap.parse_args())
9+
10+
image = cv2.imread(args["image"])
11+
12+
for angle in np.arange(0, 360, 15):
13+
rotated = imutils.rotate(image, angle)
14+
cv2.imshow("Rotated (not proper)", rotated)
15+
cv2.waitKey(0)
16+
17+
for angle in np.arange(0, 360, 15):
18+
rotated = imutils.rotate_bound(image, angle)
19+
cv2.imshow("Rotated (correct)", rotated)
20+
cv2.waitKey(0)
21+

0 commit comments

Comments
 (0)