OpenCV: function not implemented

Attempting to run a python script and throws 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 cvDestroyAllWindows, file /io/opencv/modules/highgui
 /src/window.cpp, line 577
Traceback (most recent call last):
  File "/home/ldsvm/PycharmProjects/tagging/C1_DrawBboxesOnImages.py", line 
  116, in <module> cv2.destroyAllWindows()
cv2.error: /io/opencv/modules/highgui/src/window.cpp:577: 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  
 cvDestroyAllWindows

I installed libgtk2.0-devand pkg-configand reinstalled opencv3, but still getting the same error.

I'm on CentOS.

+5
source share
1 answer

The easiest way is to remove the opencv packages, update your conda and then find the missing package using the third command.

conda remove opencv
conda update conda
conda install --channel menpo opencv

Another option - instead of using the built-in opencv function, use matplotlib ....

import cv2
import matplotlib.pyplot as plt

img = cv2.imread('img.jpg',0)

plt.imshow(img, cmap='gray')
plt.show()
0
source

Source: https://habr.com/ru/post/1676163/


All Articles