I don’t want it to display it, I only want to create it. I want to display it only when imshow() is executed. any suggestions? is this a bug?
no. you asked to open a window, it did that.
then don’t use namedWindow()
(you only MUST if you need mouse events, trackbars)
imshow() (which will open a window on demand) and
last, but not least – those gui things are for debug-visualization. if you need more luxury, skip them and learn proper gtk/qt/wx/whatever.