3
當我執行cv2.imshow
時發生錯誤和程序崩潰。在opencv-python中的imshow不起作用
我的代碼只是
import cv2
sscv = cv2.imread('/home/myuser/Pictures/Workspace 1_007.png',0)
cv2.imshow("screenshot image", sscv)
cv2.waitKey(0)
使用
- Ubuntu的14.0.4
- 的Python 2.7.6
- CV2 2.4顯示錯誤是
/home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: cannot register existing type 'GdkDisplayManager' cv2.imshow("screenshot image", sscv) /home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: g_once_init_leave: assertion 'result != 0' failed cv2.imshow("screenshot image", sscv) /home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed cv2.imshow("screenshot image", sscv) /home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: invalid (NULL) pointer instance cv2.imshow("screenshot image", sscv) /home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed cv2.imshow("screenshot image", sscv) /home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: cannot register existing type 'GdkDisplay' cv2.imshow("screenshot image", sscv) /home/mallory/workspace/python-autoaction/test/test_xutils.py:11: Warning: g_type_register_static: assertion 'parent_type > 0' failed cv2.imshow("screenshot image", sscv) Segmentation fault (core dumped)
。 8
那有什麼問題?
FWIW它工作正常使用''在Ubuntu 14.04 3.0.0-dev'' –
我看到一個類似的未解決的錯誤使用ubuntu 14.04在這裏也http://stackoverflow.com/questions/26100516/opencv-code-throws-segmentation-errorcore-dumped-ubuntu-14-04,該代碼也適用於我很好 –
你是如何安裝OpenCV的? –