【发布时间】:2015-02-23 05:00:22
【问题描述】:
执行cv2.imshow时发生错误,程序崩溃。
我的代码只是
import cv2
sscv = cv2.imread('/home/myuser/Pictures/Workspace 1_007.png',0)
cv2.imshow("screenshot image", sscv)
cv2.waitKey(0)
显示的错误是
/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)
使用
- Ubuntu 14.0.4
- Python 2.7.6
- cv2 2.4.8
这有什么问题?
【问题讨论】:
-
FWIW 在 ubuntu 14.04 上使用
'3.0.0-dev'可以正常工作 -
我在这里使用 ubuntu 14.04 也看到了类似的未解决错误stackoverflow.com/questions/26100516/…,该代码对我来说也可以正常工作
-
你是如何安装 OpenCV 的?