Goolge 0 Posted November 2, 2022 Two webcams were connected in the tinker edge. `cv2.open()` works well for two webcams, but only one webcam can be read. How do I `cv2.read()` two webcams at the same time? Share this post Link to post Share on other sites
tooz 52 Posted November 2, 2022 hello @Goolge, please try multithreading reference: python - Capturing video from two cameras in OpenCV at once - Stack Overflow Python - Multithreaded Programming (tutorialspoint.com) Share this post Link to post Share on other sites
Goolge 0 Posted November 11, 2022 (edited) @tooz Is there any other way to read two webcams in one code? I'm using Tinker Edge R. This device cannot read more than one webcam. Edited November 11, 2022 by Goolge Share this post Link to post Share on other sites
tooz 52 Posted November 16, 2022 hello @Goolge, try this .py: https://www.asuswebstorage.com/navigate/a/#/s/845A267A0B6E4346BF90E84D32F8A8C84 -- import cv2 def main(): cap = cv2.VideoCapture('/dev/video10', cv2.CAP_V4L2) cap1 = cv2.VideoCapture('/dev/video12', cv2.CAP_V4L2) while(True): ret, frame = cap.read() ret, frame1 = cap1.read() cv2.imshow('Camera 1', frame) cv2.imshow('Camera 2', frame1) if cv2.waitKey(1) & 0xFF == ord('q'): exit = True break cap.release() cv2.destroyAllWindows() if __name__ == '__main__': main() Share this post Link to post Share on other sites