opencv: OpenCV 3.2 + Python 3.6.1: imshow() not worked even with waitKey(0)
System information (version)
- OpenCV => 3.2
- Operating System / Platform => MacOS Sierra 10.12.5
- Compiler => Terminal
I followed the documentation with:
import cv2
import numpy as np
img = cv2.imread('1.jpg')
print(img)
cv2.imshow('Image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
But I got empty content window:
Is this related to OpenCV?
For readability I posted this question to stackoverflow: https://stackoverflow.com/q/44469973/7813604
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 24 (8 by maintainers)
Same problem, attacked in multiple ways, all failed.
In every case, once cv2.imshow() in invoked, I get the window title bar but an empty window
Just to make clear: despite the odd grammar in the title of this issue, and some problems with the info given about it, it is a perfectly legitimate OpenCV issue to raise. Several of us are finding runtime window display errors with various versions of cv2 running on recent incarnations of MacOS. Via Python and C++ examples. Compilations give no indication whatsoever of a problem.
Note also that cv2 works fine, as far as my testing shows, as long as no cv2 display commands are invoked. For example cv2.imread() works, and display of the resulting image through matplotlib also.