How to fix the error “QObject::moveToThread:” in opencv in python?

前端 未结 15 2124
栀梦
栀梦 2020-12-10 11:18

I am using opencv2 in python with the code

import cv2
cv2.namedWindow(\"output\", cv2.WINDOW_NORMAL)       
cv2.imshow(\"output\",im)
cv2.resizeWindow(\'outp         


        
相关标签:
15条回答
  • 2020-12-10 12:08

    The openCv author says that this problem comes from different Qt versions in openCv and the linux distro. That is: openCv comes with Qt4, but Qt5 is already installed.

    0 讨论(0)
  • 2020-12-10 12:12

    I was able to fix this problem by installing new pyqt.

    if you are using anaconda, just write down below:

    $ conda install pyqt

    0 讨论(0)
  • 2020-12-10 12:16

    I had the same problem. Using opencv imshow function raised the moving thread error. Eventually, I found that Ubuntu 16.04 has a preinstalled pyqt5 while OpenCV needs pqty4. Therefore, this may be caused by conflicting installations of Qt libraries. The following command fixed it for me:

    sudo apt-get remove libqt5x11extras5 libqt5x11extras5-dev
    
    0 讨论(0)
提交回复
热议问题