Opencv imshow() freezes when updating

后端 未结 9 2329
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:42

    My suggestion is to use Matplotlib pyplot for displaying the image. I do it the following way.

    import matplotlib.pyplot as plt
    # load image using cv2....and do processing.
    plt.imshow(cv2.cvtColor(image, cv2.BGR2RGB))
    # as opencv loads in BGR format by default, we want to show it in RGB.
    plt.show()
    

    I know it does not solve the problem of cv2.imshow, but it solves our problem.

提交回复
热议问题