title: OpenCV: Is namedWindow() necessary before imshow()?
body: <p>In OpenCV, I have seen many instances of namedWindow() preceding imshow(); such as:</p>
  
  <pre><code>namedWindow( imageName, CV_WINDOW_AUTOSIZE );
  namedWindow( "Gray image", CV_WINDOW_AUTOSIZE );
  
  imshow( imageName, image );
  imshow( "Gray image", gray_image );
  </code></pre>
  
  <p>The above code is from <a href="http://docs.opencv.org/doc/tutorials/introduction/load_save_image/load_save_image.html" rel="noreferrer">OpenCV documentation</a>.</p>
  
  <p>In one of the <a href="https://stackoverflow.com/a/13530567/5022962">posts</a> a user mentions that namedWindow() is not necessary. I myself have never used namedWindow().  </p>
  
  <p>From the <a href="http://docs.opencv.org/modules/highgui/doc/user_interface.html#namedwindow" rel="noreferrer">namedWindow documentation</a> it seems that namedWindow() might be useful with imshow() when the flag is not WINDOW_AUTOSIZE. But is there any use of namedWindow() with WINDOW_AUTOSIZE before imshow()?</p>