My program generates a series of windows using the following code:
def display(img, name, fun): global clicked cv.NamedWindow(name, 1) cv.ShowIm
I solved the problem by calling cv2.waitKey(1) in a for loop, I don't know why it worked but gets my job done, so I didn't bother myself further.
cv2.waitKey(1)
for i in range(1,10): cv2.destroyAllWindows() cv2.waitkey(1)
you are welcome to explain.