Skip to content

Instantly share code, notes, and snippets.

@realphongha
Created December 9, 2022 08:04
Show Gist options
  • Save realphongha/0e8ff73365416a71f959093466f24409 to your computer and use it in GitHub Desktop.
Save realphongha/0e8ff73365416a71f959093466f24409 to your computer and use it in GitHub Desktop.
Concatenate two cv2 images horizontally
import cv2
import numpy as np
def horizontal_concat(img1, img2, img_size):
img1_resized = cv2.resize(img1, img_size)
img2_resized = cv2.resize(img2, img_size)
return np.concatenate((img1_resized, img2_resized), axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment