错误1:
错误2:
下面这个错误是在pycharm中出现的错误
OpenCV(3.4.1) 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 cvNamedWindow, file /opt/conda/conda-bld/opencv-suite_1527005194613/work/modules/highgui/src/window.cpp, line 618
找了好多方法:
说我什么gtk依赖包没有,各种问度娘,发现了这个,远作者是解决CentOS安装Filezilla时出错的解决方案,,然后让我试了下,安装成功了
yum install libgtk-x11-2.0 或者
yum install gtk2
安装成功了:不知道在可以用不。。。试试
。。。。结果还是不可以,可以导入,但是在测试的时候出现了下面的警告,真的事醉了!!!:
参考https://blog.csdn.net/flfihpv259/article/details/52787584在问了度娘,说是图形界面出现问题,结果把imshow()屏蔽了还是不可以。。。
然而还是不可以。。。
继续寻找方法中。。。然后在更新,先写着,真的事入了opencv的坑,烦死了
错误3:
在接下来的安装中又出现了如下的问题:
我将cv2.so文件均拷贝了一份到
/root/anconda2/lib/python2.7/site-packages和/usr//lib64/python2.7/site-packages 下,可以导入了,图片的内容可以出来了,但是又出现了新的问题:
代码:
import cv2
imagepath = "../code/chenduling.jpg"
image = cv2.imread(imagepath)
print (image)
cv2.imshow('image', image)
cv2.waitKey(0)
报错:
[[[122 146 152]
[122 146 152]
[122 146 152]
...
[145 161 150]
[145 161 150]
[145 161 150]]
[[122 146 152]
[122 146 152]
[122 146 152]
...
[144 160 149]
[144 160 149]
[144 160 149]]
[[122 146 152]
[122 146 152]
[122 146 152]
...
[144 160 149]
[144 160 149]
[144 160 149]]
...
[[252 240 238]
[252 240 238]
[252 240 238]
...
[ 83 109 149]
[ 84 110 147]
[ 87 110 148]]
[[252 240 238]
[252 240 238]
[252 240 238]
...
[ 83 109 149]
[ 84 110 147]
[ 87 110 148]]
[[252 240 238]
[252 240 238]
[252 240 238]
...
[ 83 109 149]
[ 84 110 147]
[ 87 110 148]]]
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 cvShowImage, file /usr/local/opencv-2.4.13/modules/highgui/src/window.cpp, line 501
Traceback (most recent call last):
File "/home/xhh/opencv_code/code/image_opencv.py", line 12, in <module>
cv2.imshow('image', image)
cv2.error: /usr/local/opencv-2.4.13/modules/highgui/src/window.cpp:501: 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 cvShowImage
分割线。。。。。。。。。。。。。。。。。。。。。。。。。。。。
解决一个又来一个。。很难受。。继续解决啊,,烦死我了,期间有看到说是GTK的问题,但是我的都有。。。。。。
最近还严重感冒。。。搭环境搭的我,涕泗横流的,想哭很。。。。