import numpy as np
o = cv2.imread('1.jpg')
cv2.imshow("original",o)
cv2.imshow("result",o)
cv2.waitKey()
cv2.destroyAllWindows()
File "D:/python/pythonProject/lunkuo.py", line 5, in
cv2.imshow("original",o)
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:651: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa 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'
现在解决了,把之前opencv-python库卸载然后再下载
可能是python和opencv版本不匹配问题,换其他版本看看
代码应该是错了