DestroyWindow does not close window on Mac using Python and OpenCV

后端 未结 12 1116
野趣味
野趣味 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:53

    Fiddling around with this issue in the python console I observed the following behavior:

    • issuing a cv2.imshow after cv2.destroyWindow sometimes closes the window. Albeit the old window pops up again with the next highgui call, e.g., cv2.namedWindow
    • the third call of cv2.waitKey after cv2.destroyWindow closed the window every time I tried. Additionally the closed window remained closed, even when using cv2.namedWindow afterwards

    Hope this helps somebody.

    (I used Ubuntu 12.10 with python 2.7.3 but OpenCV 2.4.2 from the 13.04 repos)

提交回复
热议问题