Here is a simple script:
import cv2
img = cv2.imread("img.png", 0)
cv2.imshow("Test", img)
print("Before")
cv2.waitKey(0)
print("After")
After closing the Test window, the output of terminal was like:
$ python test.py
Before
It seems that cv2.waitKey(0) blocks the program and I cannot even kill the process by typing ctrl+c in the terminal. What's wrong with it?
PS: It works properly before but today there is some system upgrade being done and this kind of issue happened. I'm using ubuntu 18.04.