Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you'll see, this is surprisingly easy:

ret1, img1 = camera1.read()
ret2, img2 = camera2.read()
if ret1==False or ret2==False:
      print("could not read from cameras !")
      return

# now, you can do this either vertical (one over the other):
final = cv2.vconcat(img1, img2)

# or horizontal (next to each other):
#final = cv2.hconcat(img1, img2)

imshow("I", final)
waitKey(10)

you'll see, this is surprisingly easy:easy. given, they got the same size, you can append them to a single image:

ret1, img1 = camera1.read()
ret2, img2 = camera2.read()
if ret1==False or ret2==False:
      print("could not read from cameras !")
      return

# now, you can do this either vertical (one over the other):
final = cv2.vconcat(img1, img2)

# or horizontal (next to each other):
#final = cv2.hconcat(img1, img2)

imshow("I", final)
waitKey(10)

you'll see, this is surprisingly easy. given, they got the same size, you can append them to a single image:

ret1, img1 = camera1.read()
ret2, img2 = camera2.read()
if ret1==False or ret2==False:
      print("could not read from cameras !")
      return

# now, you can do this either vertical (one over the other):
final = cv2.vconcat(img1, img2)
cv2.vconcat([img1, img2])

# or horizontal (next to each other):
#final = cv2.hconcat(img1, img2)
cv2.hconcat([img1, img2])

imshow("I", final)
waitKey(10)