docker-python3-opencv icon indicating copy to clipboard operation
docker-python3-opencv copied to clipboard

Wot no gtk

Open adrianmay opened this issue 4 years ago • 1 comments

Attempting to run camodet_python I get:

OpenCv version: 4.1.1
Video Height 1944 Width 2592
Traceback (most recent call last):
  File "/app.py", line 300, in <module>
    main()
  File "/app.py", line 292, in main
    if( (cv2.waitKey(1) & 0xFF) == ord('q') ):
cv2.error: OpenCV(4.1.1) /opencv-4.1.1/modules/highgui/src/window.cpp:693: 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 'cvWaitKey'

Taking the suggestion of installing libgtk2.0-dev and pkg-config before the cmake fixes it. The waitKey still doesn't actually work, and I don't really need it, but this doesn't seem like a bad additiion to your image anyway.

adrianmay avatar Apr 27 '20 06:04 adrianmay

I believe that waitKey does not work because the application that runs within container does not have an X terminal attached. This sample shows how to make it work: https://github.com/maxirmx/docker-python3-opencv

maxirmx avatar Mar 11 '21 07:03 maxirmx