Opencv imshow() freezes when updating

后端 未结 9 2332
Happy的楠姐
Happy的楠姐 2020-12-09 05:18

For my image processing algorithm I\'m using python / OpenCV. The output of my algorithm shall be updated im the same window over and over again.

However sometimes

9条回答
  •  遥遥无期
    2020-12-09 05:33

    Increasing the wait time solves this issue. However in my opinion this is unnecessary time spent on sleeping (20 ms / frame), even though it's not much.

    Changing

    cv2.waitKey(1)
    

    to

    cv2.waitKey(20)
    

    prevents the window from freezing in my case. The duration of this required waiting time may vary on different machines.

提交回复
热议问题