Python OpenCV 3.2 imshow() no image content with waitKey(0)!

前端 未结 2 1369
走了就别回头了
走了就别回头了 2020-12-21 22:07

I installed OpenCV3.2 + python3.6.1 from this installation guide. (For the paths needed in guide I typed:


Edit: I\'m not sure, but I guess tha

2条回答
  •  眼角桃花
    2020-12-21 22:58

    If you just encounter the same problem, I can solve your problem. But you should take a look before you follow any further steps:

    1. I will recommend you first delete OpenCV 3.2 from your mac.

      Don't know how to delele? Here are the steps:

      1. Read this answer first if you want to know what the following command do in details, then run the following command in your Terminal:

        $> sudo find / -name "*opencv*" -exec rm -i {} \;
        
      2. Please read every delete-checking message carefully, or you may delete some of your files containing "opencv" in filename, which may not related to OpenCV but may be your personal files.

      3. Your cv2.so will still alive somewhere in your disk, go checkout where it is with the following command in Terminal:

        $> ls -l /usr/local/lib/python3.6/site-packages/
        

        In my case I found the cv2.so at .../python3.6/..., you should press 'tab' at /usr/local/lib/python then check out the site-packages folder for each python version (,which maybe you're about to re-install the OpenCV,) to search cv2.so. if you found it, delete it.

    2. Install OpenCV3.2 with Homebrew for Python2.7 / 3.6. Just follow all the steps, and keep in mind that Homebrew is your best friend.

      Edit: The link works for both Python2.7 and 3.6.

提交回复
热议问题