DeclK commited on
Commit
2d6b584
·
1 Parent(s): 71b2f33

fix concat bug

Browse files
Files changed (1) hide show
  1. main.py +6 -6
main.py CHANGED
@@ -18,16 +18,16 @@ def parse_args():
18
  return parser.parse_args()
19
 
20
  def concat(img1, img2, height=1080):
21
- w1, h1, _ = img1.shape
22
- w2, h2, _ = img2.shape
23
 
24
  # Calculate the scaling factor for each image
25
- scale1 = height / img1.shape[1]
26
- scale2 = height / img2.shape[1]
27
 
28
  # Resize the images
29
- img1 = cv2.resize(img1, (int(h1*scale1), int(w1*scale1)))
30
- img2 = cv2.resize(img2, (int(h2*scale2), int(w2*scale2)))
31
 
32
  # Concatenate the images horizontally
33
  image = cv2.hconcat([img1, img2])
 
18
  return parser.parse_args()
19
 
20
  def concat(img1, img2, height=1080):
21
+ h1, w1, _ = img1.shape
22
+ h2, w2, _ = img2.shape
23
 
24
  # Calculate the scaling factor for each image
25
+ scale1 = height / img1.shape[0]
26
+ scale2 = height / img2.shape[0]
27
 
28
  # Resize the images
29
+ img1 = cv2.resize(img1, (int(w1*scale1), int(h1*scale1)))
30
+ img2 = cv2.resize(img2, (int(w2*scale2), int(h2*scale2)))
31
 
32
  # Concatenate the images horizontally
33
  image = cv2.hconcat([img1, img2])