-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresize.py
More file actions
36 lines (26 loc) · 944 Bytes
/
resize.py
File metadata and controls
36 lines (26 loc) · 944 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
34
35
36
# import cv2
# # read the first image
# img1 = cv2.imread('C:/Users/Amit/Downloads/amit_degree_vflat.jpg')
# # read the second image
# img2 = cv2.imread('C:/Users/Amit/Downloads/20230406_210240633_vflat.jpg')
path1 = 'C:/Users/Amit/Downloads/Akshit_orig_001.jpg'
path2 = 'C:/Users/Amit/Downloads/amit_orig_001.jpg'
import cv2
# read the first image
img1 = cv2.imread(path1)
# read the second image
img2 = cv2.imread(path2)
import cv2
# read the first image
img1 = cv2.imread(path1)
# read the second image
img2 = cv2.imread(path2)
# find the minimum height and width
min_height = min(img1.shape[0], img2.shape[0])
min_width = min(img1.shape[1], img2.shape[1])
# resize both images to the same size
resized_img1 = cv2.resize(img1, (min_width, min_height))
resized_img2 = cv2.resize(img2, (min_width, min_height))
# save the resized images
cv2.imwrite('resized_image1.jpg', resized_img1)
cv2.imwrite('resized_image2.jpg', resized_img2)