opencv.imshow will cause jupyter notebook crash

后端 未结 8 1465
借酒劲吻你
借酒劲吻你 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:25

    %matplotlib inline
    #The line above is necesary to show Matplotlib's plots inside a Jupyter Notebook
    
    import cv2
    from matplotlib import pyplot as plt
    
    #Import image
    image = cv2.imread("input_path")
    
    #Show the image with matplotlib
    plt.imshow(image)
    plt.show()
    

提交回复
热议问题