问题
That's the default cv2.imshow()
window icon:
I'm finishing up a basic project, but want to make it look cleaner by changing the window icon that is displayed. I know it can be done with Tkinter windows, but I wanted to see if there was a more direct way to do it with just the OpenCV library.
回答1:
You can't do that using only OpenCV. Its High-level GUI only supports minimal functionality, cf. the detailed description:
While OpenCV was designed for use in full-scale applications and can be used within functionally rich UI frameworks (such as Qt*, WinForms*, or Cocoa*) or without any UI at all, sometimes there it is required to try functionality quickly and visualize the results. This is what the HighGUI module has been designed for.
It provides easy interface to:
- Create and manipulate windows that can display images and "remember" their content (no need to handle repaint events from OS).
- Add trackbars to the windows, handle simple mouse events as well as keyboard commands.
"Manipulating" windows is limited to naming, moving, resizing them.
(From my personal point of view, OpenCV windows are just for prototyping, nothing you'd use in production.)
Hope that helps!
来源:https://stackoverflow.com/questions/60259324/is-there-any-method-to-change-the-icon-for-the-imshow-window