Trying to run a python script and it 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 have installed the libgtk2.0-dev
and pkg-config
and reinstalled opencv3
but still get the same error.
I am on CentOS.
The simplest way is to remove the opencv packages update your conda and then find the missing package using third command.
conda remove opencv
conda update conda
conda install --channel menpo opencv
Another option is instead of using opencv built-in function use matplotlib for this....
import cv2
import matplotlib.pyplot as plt
img = cv2.imread('img.jpg',0)
plt.imshow(img, cmap='gray')
plt.show()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With