Ask Your Question
0

debian 8 (jessie) opencv 3.2 python3.4

asked 2017-05-30 11:11:10 -0600

Hi please note: that i have managed to get this same code to run with python2.7 and 3.6 (anaconda), but for some reason it does not run with python3.4:

import cv2 
img = cv2.imread('./images/old.wood.jpg',1)
cv2.imshow('Input image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

This is the error I get:

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 /io/opencv/modules/highgui/src/window.cpp, line 583
Traceback (most recent call last):
File "first.program.py", line 4, in <module>
cv2.imshow('Input image', img)
cv2.error: /io/opencv/modules/highgui/src/window.cpp:583: 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

i do have libgtk2.0-dev installed:

sudo aptitude search libgtk2.0-dev and pkg-config:
i   libgtk2.0-dev                 - development files for the GTK+ library
p   libgtk2.0-dev:i386            - development files for the GTK+ library
i   pkg-config                    - manage compile and link flags for libr
p   pkg-config:i386               - manage compile and link flags for libr

How would i run cmake to include

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-05-30 11:23:18 -0600

berak gravatar image

updated 2017-05-30 11:25:11 -0600

you installed 3rd party (opencv does not distribute any python/linux binaries) made binaries via a ppm, and received a "headless" (as in "no gui supplied") version.

installing libgtk won't help, you will have to build the actual cv2.so locally, with libgtk installed.

see here for build instructions

edit flag offensive delete link more

Comments

berak thank you for your reply. I went to the build instructions followed all the way through. the problem persists. I am no expert so I am not sure what I am doing wrong. It still works with python2.7 and python3.6.

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

that is what I typed for cmake. make -j4 went fine. sudo make install too, but when I run the program it doesn't work.

Please any help is very much appreciated. Take into account that I am new to this.

this is the error I get:

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 /io/opencv/modules/highgui/src/window.cpp, line 583
Traceback (most ...
(more)
crazygene gravatar imagecrazygene ( 2017-05-30 12:40:53 -0600 )edit

try a cv2.__version__ to see,if you're actually using the self-build cv2.so.

berak gravatar imageberak ( 2017-05-30 17:16:29 -0600 )edit

import cv2 print(cv2.__version__)

3.2.0 that is the version it is using, which is the version I compiled. Though checking python 3.6 is using 3.1. Is there a way to switch to 3.1 on python 3.4 so that I can see if that solves the problem? I am not sure how or where I would set this?

crazygene gravatar imagecrazygene ( 2017-06-01 23:53:55 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-05-30 11:11:10 -0600

Seen: 887 times

Last updated: May 30 '17