I'm a beginner.
http://opencv.blog.jp/python/install_easy and try to get python to use opencv to display the image, but the new window freezes and does not appear, either pythonxy or anaconda.
The code is
import cv2
import numpy as np
img=cv2.imread("test1")
cv2.imshow("test", img)
Yes.
The frozen message is init done opengl support available
.Thank you for your cooperation.
It's different from Freeze, but it may have just ended quickly.
In that case, you can solve this problem by putting waitKey
and so on.
#!/usr/bin/python2
import numpy as np
import cv2
img = cv2.imread ('./test.png', 0)
cv2.imshow('image',img')
cv2.waitKey(0)
cv2.destroyAllWindows()
© 2024 OneMinuteCode. All rights reserved.