img = cv2.imread("image.jpg")
print(img.shape)
cv2.imshow("output",img)
cv2.waitKey(0)
结果与报错:
(1944, 2592, 3)
Traceback (most recent call last):
File "/home/pi/test.py", line 6, in
cv2.imshow("output",img)
cv2.error: OpenCV(4.4.0) /home/pi/opencv-4.4.0/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'