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

前端 未结 15 2152
栀梦
栀梦 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:06

    I don't know why, but installation of matplotlib solved for me the problem with the error

    QObject::moveToThread: Current thread (0x1d2c9cf0) is not the object's thread (0x1d347b20).
    Cannot move to target thread (0x1d2c9cf0)
    

    I emphasize that I prepared fresh conda environment where matplotlib was installed. Opencv was installed by pip in conda env as follow pip install opencv-python opencv-contrib-python.

提交回复
热议问题