How do you capture video from two or more cameras at once (or nearly) with OpenCV, using the Python API?
I have three webcams, all capable of video streaming, locate
try to use this code... it worked as expected... this is for two cams,if you want more cams, just create the "VideoCapture()" objects...for example 3rd cam will have : cv2.VideoCapture(3) and corresponding code in the while loop
import cv2
frame0 = cv2.VideoCapture(1)
frame1 = cv2.VideoCapture(2)
while 1:
ret0, img0 = frame0.read()
ret1, img00 = frame1.read()
img1 = cv2.resize(img0,(360,240))
img2 = cv2.resize(img00,(360,240))
if (frame0):
cv2.imshow('img1',img1)
if (frame1):
cv2.imshow('img2',img2)
k = cv2.waitKey(30) & 0xff
if k == 27:
break
frame0.release()
frame1.release()
cv2.destroyAllWindows()
ALL THE BEST !