cv2.imshow() function is opening a window that always says not responding - python opencv

后端 未结 9 1041
长情又很酷
长情又很酷 2020-12-13 17:54

I am trying to run a very simple program. To open and jpg file and display it using the opencv library for python. Initially it all worked fine but now it just opens a windo

9条回答
  •  轮回少年
    2020-12-13 18:29

    If you have used python notebooks then there is a problem in using cv2.waitKey(0) and cv2.destroyallwindows() in Unix based system to run a program of opencv.

    I have an alternative method which would prevent from freezing your image

    Steps: -Copy the code from python notebooks and create new filename.py and paste it - Open terminal - cd path/to/file - source activate VirtualEnvironment - python filename.py

    This will run code directly from terminal. Hope this helps you. Example Link: https://youtu.be/8O-FW4Wm10s

提交回复
热议问题