How to check if an opencv window is closed

后端 未结 5 749
囚心锁ツ
囚心锁ツ 2020-12-20 15:18

How do you check if an opencv window has been closed?

I would like to do:

cvNamedWindow(\"main\", 1);

while(!cvWindowIsClosed(\"main\"))
{
    cvSho         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-20 16:11

    In Python OpenCV version 3.4.2, Ubuntu Bionic, cv2.getWindowProperty('Main', cv2.WND_PROP_VISIBLE) returns a floating 0.0 (zero) when the window is closed and 1.0 (one) when it's open, whether see-able or not. Yes, still a 1.0 when it's minimized or behind another window or on a different desktop.

提交回复
热议问题