python - 有什么方法可以更改 imshow() 窗口的图标吗?

标签 python opencv

这是默认 cv2.imshow()窗口图标:

Default cv2.imshow() window icon

我正在完成一个基本项目,但想通过更改显示的窗口图标使其看起来更干净。我知道这可以用 Tkinter windows 来完成,但我想看看是否有更直接的方法可以只用 OpenCV 库来完成。

最佳答案

你不能只使用 OpenCV 来做到这一点。其High-level GUI仅支持最少的功能,参见。详细说明:

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.


“操纵”窗口仅限于命名、移动、调整它们的大小。

(从我个人的角度来看,OpenCV 窗口只是用于原型(prototype)设计,你不会在生产中使用。)

希望有帮助!

关于python - 有什么方法可以更改 imshow() 窗口的图标吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60259324/

相关文章:

python - 使用 urllib.request tinyupload.com 上传文件

python - OpenCV - 在捕获循环中没有 waitkey 不显示图像

python - 在 Raspberry PI 上构建时出现 OpenCV 错误

python - 如何使用python opencv在jupyter笔记本上以正常速度播放mp4

python - 为什么我的包不能安装 "pipx"?

python-3.x - Mat 中的断言失败(m.dims >= 2)

opencv - 我可以将 openCV 库与 Catapult C 一起使用吗?

c++ - OpenCV : How to display webcam capture in windows form application?

python - 如何正确导入graphviz?

python - 填充 Pandas Dataframe 中的货币缺失数据