opencv4.3

openCV imshow fails randomly

限于喜欢 提交于 2020-08-20 05:38:09
问题 When I want to display an image, the cv2.imshow() fails randomly. import cv2 frame = cv2.imread('desk.jpg', cv2.IMREAD_COLOR) cv2.imshow('test', frame) cv2.waitKey(0) cv2.destroyAllWindows() Sometimes, I got the first and sometimes the second: I'm sure that the data is correctly loaded because when I print the frame matrix, everything is ok. I also tried to convert picture to other format but the result is always the same, random. >>> cv2.__version__ '4.3.0' # opencv-contrib-python is