Is there any method to change the icon for the imshow() window?

寵の児 提交于 2020-12-10 08:18:58

问题


That's the default cv2.imshow() window icon:

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!