Multithreaded cv2.imshow() in Python does not work

前端 未结 2 740
孤街浪徒
孤街浪徒 2021-01-14 14:14

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

相关标签:
2条回答
  • 2021-01-14 15:06

    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.

    0 讨论(0)
  • 2021-01-14 15:06

    Try moving cv2.namedWindow('RGB' + str(cam)) inside your thread target capture_and_save

    0 讨论(0)
提交回复
热议问题