-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter_3.py
More file actions
33 lines (26 loc) · 816 Bytes
/
Copy pathchapter_3.py
File metadata and controls
33 lines (26 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import cv2
import numpy as np
def reshape():
imgObj = cv2.imread('Resources/Photos/reonaldo.png')
print(imgObj.shape)
reshaped = cv2.resize(imgObj, (int(imgObj.shape[0]/2), int(imgObj.shape[1]/2)))
cv2.imshow('Resized Image', reshaped)
cv2.waitKey(0)
def crop():
imgObj = cv2.imread('Resources/Photos/Small.jpg')
print(imgObj.shape)
print(imgObj)
croped = imgObj[0,0:2]
print('--\n', croped)
cv2.imshow('Croped Image', croped)
cv2.waitKey(0)
crop()
# if __name__ =='__main__':
# print('Program Started')
# num = input('ENTER GIVEN NUMBER : \n [1] => ImageShow Call \n [2] => VideoShow Call \n [3] => WebCamShow Call \n TICK : ')
# switcher = {
# '1':reshape,
# '2':crop,
# }
# switcher[num]()
# print('Program End')