In OpenCV, I have seen many instances of namedWindow() preceding imshow(); such as:
namedWindow( imageName, CV_WINDOW_AUTOSIZE );
namedWindow( "Gray image", CV_WINDOW_AUTOSIZE );
imshow( imageName, image );
imshow( "Gray image", gray_image );
The above code is from OpenCV documentation.
In one of the posts a user mentions that namedWindow() is not necessary. I myself have never used namedWindow().
From the namedWindow documentation 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()?