opencv.imshow will cause jupyter notebook crash

后端 未结 8 1551
借酒劲吻你
借酒劲吻你 2021-01-31 07:46

I check other question on google or stackoverflow, they are talking about run cv2.imshow in script, but my code run in jupyter notebook.

Here is my configuration:

<
8条回答
  •  轮回少年
    2021-01-31 08:33

    I was having a similar problem, and could not come to a good solution with cv2.imshow() in the Jupyter Notebook. I followed this stackoverflow answer, just using matplotlib to display the image.

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

提交回复
热议问题