私はデバッグpythonのopencvで "QObject :: moveToThread:"というエラーを修正する方法は?
QObject::moveToThread: Current thread (0x1d2c9cf0) is not the object's thread (0x1d347b20).
Cannot move to target thread (0x1d2c9cf0)
などのエラーを持っていると私はcv2.waitKey(0)
を使用するときにそれが起こったことがわかっコード
import cv2
cv2.namedWindow("output", cv2.WINDOW_NORMAL)
cv2.imshow("output",im)
cv2.resizeWindow('output', 400,400)
cv2.waitKey(0)
cv2.destroyAllWindows()
とpythonでopencv2使用しています。どのように修正する必要がありますか?ありがとう
更新:私は3.3.0.0を使用しています。私は古いバージョンを使用している場合、私はエラーが
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvDestroyAllWindows, file /io/opencv/modules/highgui/src/window.cpp, line 577 Traceback (most recent call last): File "tools/demo_handbone.py", line 220, in <module> demo(net, im_name) File "tools/demo_handbone.py", line 159, in demo cv2.destroyAllWindows() cv2.error: /io/opencv/modules/highgui/src/window.cpp:577: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvDestroyAllWindows
Qtまたはopencv2の最新バージョンのバグがあるかもしれないと思っています。あなたは最近パッケージをアップグレードしましたか? –
私はopencv2を再インストールして、問題が発生しました。 – user8264
古いバージョンをインストールしてみてください。 pipを使ってインストールしましたか? –