Reference: https://rffan.info/3942
Error 1:
Error 2:
The following error is an error in 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
I found many ways:
I said that I don’t have any gtk dependencies. I asked Du Niang to find this. The author is a solution to the error when installing Filezilla on CentOS . Then I tried it and the installation was successful.
yum install libgtk-x11-2.0 或者
yum install gtk2
The installation was successful: I don't know if it can be used. . . Try
. . . . The result is still not possible, you can import, but the following warning appeared during the test, really drunk! ! ! :
Refer to https://blog.csdn.net/flfihpv259/article/details/52787584. I asked Du Niang and said that there was a problem with the graphical interface. As a result, imshow() was blocked or not. . .
However, it still cannot. . .
Continue to find a way. . . Then in the update, I wrote first, it really got into the pit of opencv, it was annoying
Error 3:
The following problems appeared in the following installation:
I copied all the cv2.so files to
Under /root/anconda2/lib/python2.7/site-packages and /usr//lib64/python2.7/site-packages, it can be imported, the content of the picture can be released, but a new problem has appeared:
Code:
import cv2
imagepath = "../code/chenduling.jpg"
image = cv2.imread(imagepath)
print (image)
cv2.imshow('image', image)
cv2.waitKey(0)
Error:
[[[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
Dividing line. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Solve one after another. . feeling bad. . Continue to solve it. I am so annoying. During the period, I saw GTK problems, but mine have all. . . . . .
I have a severe cold recently. . . I am in the environment, and I am so mad, I want to cry a lot. . . .