cv2.namedWindow() function is displaying the window

no. you asked to open a window, it did that.

then don’t use namedWindow()
(you only MUST if you need mouse events, trackbars)
stick with imshow() (which will open a window on demand) and destroyWindow()

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.

1 Like