Error while running example - opencv

I installed opencv 2.3.1 and when I execute samples by running the command ./delaunay on the terminal, I got errors as follows:
This program builds the traingulation interactively, you may stop this process by
hitting any key.
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 cvNamedWindow, file /home/pi/OpenCV-2.3.1/modules/highgui/src/window.cpp, line 275 terminate called after throwing an instance of 'cv::Exception'
what(): /home/pi/OpenCV-2.3.1/modules/highgui/src/window.cpp:275: 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 cvNamedWindow
Aborted
What is the solution?

Related

could not use "cv2.imshow('Lena', img)" in jupyter notebook

It gives this error:
error Traceback (most recent call last)
<ipython-input-6-5e400e6b9939> in <module>()
1 img = cv2.imread(imgpath)
2
----> 3 cv2.namedWindow('Lena', cv2.WINDOW_AUTOSIZE)
4 cv2.imshow('Lena', img)
5 cv2.waitKey(0)
error: /tmp/build/80754af9/opencv_1512687413662/work/modules/highgui/src/window.cpp:593: 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 cvNamedWindow
I installed this package using conda so unable to understand how to make changes in that.
Seems to be an issue with your opencv, from the error my assumption is you built it from source.
l would advise uninstalling the current opencv you have and install via pip pip install opencv-python

OpenCV Crosscompile for ARM: highgui error (GTK2+)

I'm have build the OpenCV library from source for Zynq (ARM). But, OpenCV was build on the same PC for x86 (PC) also. Firstly, I can execute every example on my PC without any issues. Secondly, I am able to crosscompile and execute every program on the arm target, except the ones including highgui libraries, where I receive the following 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 /home/hristov/workspace/opencv/modules/highgui/src/window.cpp, line 534
terminate called after throwing an instance of 'cv::Exception'
what(): /home/user/workspace/opencv/modules/highgui/src/window.cpp:534: 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
Yes, I have gone through the forum for solutions for this issue but some answers were unclear and I would like some more detail into this. I have created the OpenCV build for ARM build WITH_GTK and GTK2. Also installed libgtk2.0-dev, pkg-config
However, From another topic on this forum, I learned that the problem lies in setting up the pkg-config: http://answers.opencv.org/question/57945/opencv-gui-with-gtk-2-solved/
Q) Based on the above solution, Do you set the path for PKG_CONFIG_PATH on your ARM platform (Zynq) or on the PC platform (Ubuntu PC)? Because, it is already set to the described path on the ARM platform whereas it is different on the PC Linux platform. More details of the current path is shown below:
PKG_CONFIG_PATH in PC(Ubuntu):
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
PKG_CONFIG_PATH in ARM (Embedded platform):
/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
If the pkg-config must be changed on my PC, to the /usr/lib/arm-linux-gnueabihf/pkgconfig/ location, I cannot find any pkg-config in that location. Should I create a new one, by copying the folder from my target?
Q) Also, Should the GTK libraries also be installed in the Target Embedded system (ARM)?
Hope someone can help me with this solution as I have rebuild the libraries umpteen times with many different solutions, but to no avail. Thanks!

OpenCv program is not able to run ; pkg-config is hashed

I am working with opencv libraries. When I run my project, I get following 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 cvNamedWindow, file /home/krathi/softwaresetup/opencv-2.4.9/modules/highgui/src/window.cpp, line 483
terminate called after throwing an instance of 'cv::Exception'
what(): /home/krathi/softwaresetup/opencv-2.4.9/modules/highgui/src/window.cpp:483: 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 cvNamedWindow
When I go to terminal and type "type pkg-config" I get this:
pkg-config is hashed (/usr/bin/pkg-config)
I dont know what this means , but I guess that the access to pkg-config is only to the admin user of my machine. Am I right?
What should I do to fix this error ? Specifically what should I do so that my program can use pkg-config.
Note :I have installed libgtk
You probably have compiled OpenCV by yourself looking at the folders given in the error message. You need to recompile OpenCV by setting WITH_GTK=ON using cmake.

OpenCv Error: Function Not Implemented

I get the following 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 cvNamedWindow, file /home/robik/Downloads/Java/OpenCV-2.3.1/modules/highgui/src/window.cpp, line 275
terminate called after throwing an instance of 'cv::Exception'
what(): /home/robik/Downloads/Java/OpenCV-2.3.1/modules/highgui/src/window.cpp:275: 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 cvNamedWindow
Aborted
libgtk2.0-dev and pkg-config both are installed but I still get the error. What is wrong?
I followed the steps at http://www.samontab.com/web/2011/06/...-ubuntu-11-04/
still doesn't help.

opencvlibrary 2.4 installation [duplicate]

I installed open cv in my ubuntu 11.04. But whenever I try to run any code I get the following 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 cvNamedWindow, file /home/robik/Downloads/Java/OpenCV-2.3.1/modules/highgui/src/window.cpp, line 275
terminate called after throwing an instance of 'cv::Exception'
what(): /home/robik/Downloads/Java/OpenCV-2.3.1/modules/highgui/src/window.cpp:275: 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 cvNamedWindow
I already have libgtk2.0-dev and pkg-config in my OS. What should I do?
re configure and then re-run cmake. checkout this tutorial

Resources