简体   繁体   中英

Python OpenCV imshow() function is not implemented

I started to use opencv in Python. but I have some problem with that. here is my code:

image = None
image = cv2.imread('7.jpg')
if image != None:
    print("len >    " + str(len(image)))
    # show image
    cv2.imshow('image', image)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
else:
    print("Image is None")

when I run this simple code I have this error:

OpenCV Error: Unspecified error (The function is not implemented.

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 checked that, but all the packages are installed. I remove them and retry to install. but that didn't work!!! what should I do...

I actually checked this Link

but when I try this command: cmake -D WITH_QT=ON .. I have this in terminal:

The source directory "/home" does not appear to contain CMakeLists.txt

what should I do?

it seems opencv have problem with python 3 and above. I tried this code in python 2.7 and it worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM