I have two cameras (using OpenNI, I have two streams per camera, handled by the same instance of the driver API) and would like to have two threads, each capturing data from
I solved the issue by using mutables, passing a dictionary cam_disp = {}
to the thread and reading the value in the main thread. cv2.imshow()
works best when kept in the main thread, so this worked perfectly. I am not sure if this is the "right" way to do this, so all suggestions are welcome.
Try moving cv2.namedWindow('RGB' + str(cam))
inside your thread target capture_and_save