I am using OpenCV 3.0 with python 2.7.6 and ROS Indigo. I installed it through and am attempting to do some ORB object detection. Ironically, all of the actual detection code seems to run without issue. The code that doesn't work is imshow. It gives 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 /tmp/buildd/ros-indigo-opencv3-2.9.6-1trusty-20150512-2345/modules/highgui/src/window.cpp, line 534
I haven't seen any of this during my googling. Any help?
As the message says, you need to rebuild the library with gtk. Enter into your OpenCV folder and create a new folder with name Release.
Now you need to rebuild OpenCV. Use the following command
Remember to use
WITH_GTK=ON
while building. After this, enter these commandNow run your code. This should make it work. You can delete the old build folder.
The complete process involves recompiling OpenCV 3 and copying those new compiled libraries with the correct options to the ROS environment.
I ran into the same issue while programming a Baxter robot and needed to solve it.
So the following needs to be done:
Download the latest stable release http://opencv.org/downloads.html
The information is taken from this site -> https://sites.google.com/site/rameyarnaud/research/ros/latest-opencv-in-ros but I will post the information here:
Your ROS environment needs to be setup correctly otherwise rosversion will return .
After this you should be able to use OpenCV 3 and imshow properly.