python-cv 多张图片写到一张图片
import cv2
from pylab import *
res = np.full((540,960,3), 114, dtype=np.uint8)
print(res)
img5 = cv2.imread('./images/000171.jpg')
img5 = cv2.resize(img5,(960,540))
print(img5.shape)
img6 = cv2.imread('./images/000191.jpg')
img6 = cv2.resize(img6,(960,540))
img7 = cv2.imread('./images/000196.jpg')
img7 = cv2.resize(img7,(960,540))
img8 = cv2.imread('./images/000226.jpg')
img8 = cv2.resize(img8,(960,540))
h1 = [img5, img6, img7, img8]
htitch1= np.vstack(h1[:2])
htitch2= np.vstack(h1[2:])
vtitch = np.hstack((htitch1, htitch2))
cv2.imshow("test1", vtitch)
cv2.imwrite('111.jpg',vtitch)
cv2.waitKey(0)
cv2.destroyAllWindows()