DestroyWindow does not close window on Mac using Python and OpenCV

后端 未结 12 1117
野趣味
野趣味 2020-11-27 05:36

My program generates a series of windows using the following code:

def display(img, name, fun):
    global clicked

    cv.NamedWindow(name, 1)
    cv.ShowIm         


        
12条回答
  •  我在风中等你
    2020-11-27 05:43

    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.

    for i in range(1,10):
        cv2.destroyAllWindows()
        cv2.waitkey(1)
    

    you are welcome to explain.

提交回复
热议问题