I am trying out OpenCV on ubuntu 20.04, python 3.7. I have run the following script
import cv2
img = cv2.imread('butterfly.jpg')
cv2.imshow('ImageWindow', img)
cv2.waitKey()
Sometimes I would get the lovely picture of the original butterfly image, but sometimes I would get a small black window.
The behavior is a bit random, and I am not sure what is causing this issue.