OpenCV python on MAC

import cv2

img = cv2.imread('mikrotik.jpg',0)
cv2.imshow('image',img)
cv2.waitKey(0)cv2.destroyAllWindows()

      

I ran this code on my Pycharm on Mac

then get this error instead

>/Users/briant/venv/bin/python /Users/briant/PycharmProjects/InputandOutput/ImageTestFile.py
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 /Users/travis/build/skvark/opencv->python/opencv/modules/highgui/src/window.cpp, line 583
    >Traceback (most recent call last):
    >  File "/Users/briant/PycharmProjects/InputandOutput/ImageTestFile.py", >line 9, in <module>
    >    cv2.imshow('image',img)
    >cv2.error: /Users/travis/build/skvark/opencv->python/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


>Process finished with exit code 1

      

Can someone explain to me what I should be doing? thank you in advance.

+3


source to share





All Articles