I am following this tutorial to do angle detection and I need to use cv2.imshow. Here is my code:
import cv2 import numpy as np filename = '1.jpg' img = cv2.imread(filename) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) gray = np.float32(gray) dst = cv2.cornerHarris(gray,2,3,0.04)
I got this error:
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 /root/mc-x86-2.7/conda-bld/opencv-3_1482254836916/work/opencv-3.1.0/modules/highgui/src/window.cpp, line 545 Traceback (most recent call last): File "<stdin>", line 1, in <module> cv2.error: /root/mc-x86-2.7/conda-bld/opencv-3_1482254836916/work/opencv-3.1.0/modules/highgui/src/window.cpp:545: 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
So, I installed libgtk2.0-dev and pkg-config, but this did not solve the problem. The error message says it starts cmake, but where? There is no CMakeLists.txt file in my drive.
Then I follow some answers on this website, like this one : first, I downloaded OpenCV directly to the website, and I run cmake, make and make install. Everything is fine, but I still have the same error when I use Anaconda, but received a different message when I open Python from / usr / bin / python:
init done opengl support available
At the moment, I canβt show my image. What should I do?