title: What is the function of cv2.destroyAllWindows()?
body: <pre><code>import cv2
  
  img = cv2.imread('pic.jpg',1)
  cv2.imshow(&quot;Win&quot;,img)
  cv2.waitKey(0)
  cv2.destroyAllWindows()
  </code></pre>
  <p>Even if I don't use cv2.destroyAllWindows() function, pressing any key on my keyboard is closing the image window. So what is its use?</p>