{"action":"opened","issue":{"url":"https://api.github.com/repos/Itseez/opencv/issues/4535","labels_url":"https://api.github.com/repos/Itseez/opencv/issues/4535/labels{/name}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/4535/comments","events_url":"https://api.github.com/repos/Itseez/opencv/issues/4535/events","html_url":"https://github.com/Itseez/opencv/issues/4535","id":97423596,"number":4535,"title":"[Python] cv2.destroyWindow does not work","user":{"login":"opencv-pushbot","id":2051563,"avatar_url":"https://avatars.githubusercontent.com/u/2051563?v=3","gravatar_id":"","url":"https://api.github.com/users/opencv-pushbot","html_url":"https://github.com/opencv-pushbot","followers_url":"https://api.github.com/users/opencv-pushbot/followers","following_url":"https://api.github.com/users/opencv-pushbot/following{/other_user}","gists_url":"https://api.github.com/users/opencv-pushbot/gists{/gist_id}","starred_url":"https://api.github.com/users/opencv-pushbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencv-pushbot/subscriptions","organizations_url":"https://api.github.com/users/opencv-pushbot/orgs","repos_url":"https://api.github.com/users/opencv-pushbot/repos","events_url":"https://api.github.com/users/opencv-pushbot/events{/privacy}","received_events_url":"https://api.github.com/users/opencv-pushbot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Itseez/opencv/labels/affected:%202.4","name":"affected: 2.4","color":"ededed"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/auto-transferred","name":"auto-transferred","color":"ededed"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/category:%20highgui-gui","name":"category: highgui-gui","color":"ededed"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/priority:%20normal","name":"priority: normal","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-27T09:34:29Z","updated_at":"2015-07-27T09:34:29Z","closed_at":null,"body":"Transferred from http://code.opencv.org/issues/2911\r\n```\n|| Matthäus Brandl on 2013-03-22 16:04\n|| Priority: Normal\n|| Affected: 2.4.2\n|| Category: highgui-gui\n|| Tracker: Bug\n|| Difficulty: None\n|| PR: \n|| Platform: None / None\n```\n\n[Python] cv2.destroyWindow does not work\n-----------\n```\nOn Ubuntu 12.10 using either the shipped OpenCV 2.3.1 or OpenCV 2.4.2 of the upcoming Ubuntu 13.04, one cannot close named windows as expected using cv2.destroyWindow.\r\n\r\nSee for example on StackOverflow:\r\n* http://stackoverflow.com/questions/6116564\r\n* http://stackoverflow.com/questions/11593046\r\n\r\nAlthough both questions use OpenCV 1.x, the same problem occurs using the cv2 import of OpenCV 2.x\r\n\r\nThe only way to really close a window is to call the functions in this particular order:\r\n<pre>\r\ncv2.destroyWindow(name)\r\ncv2.waitKey(-1)\r\ncv2.imshow(name, img)\r\n</pre>\r\nwhere img is an arbitrary numpy array.\r\n\r\nFor the sake of completeness:\r\n<pre>\r\n% LC_ALL=C apt-cache policy python-opencv\r\npython-opencv:\r\n  Installed: 2.4.2+dfsg-0exp2ubuntu1\r\n  Candidate: 2.4.2+dfsg-0exp2ubuntu1\r\n  Version table:\r\n *** 2.4.2+dfsg-0exp2ubuntu1 0\r\n        100 /var/lib/dpkg/status\r\n     2.3.1-11ubuntu2 0\r\n        500 http://de.archive.ubuntu.com/ubuntu/ quantal/universe amd64 Packages\r\n</pre>\n```\n\nHistory\n-------"}}