有什么方法可以更改 imshow() 窗口的图标吗? [英] Is there any method to change the icon for the imshow() window?

查看:57
本文介绍了有什么方法可以更改 imshow() 窗口的图标吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我正在完成一个基本项目,但希望通过更改显示的窗口图标使其看起来更简洁.我知道它可以用 Tkinter windows 来完成,但我想看看是否有更直接的方法来用 OpenCV 库来做到这一点.

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.

推荐答案

仅使用 OpenCV 无法做到这一点.它的 高级 GUI 仅支持最少的功能,参见.详细说明:

You can't do that using only OpenCV. Its High-level GUI only supports minimal functionality, cf. the detailed description:

虽然 OpenCV 旨在用于全面的应用程序,并且可以在功能丰富的 UI 框架(例如 Qt*、WinForms* 或 Cocoa*)中使用或根本没有任何 UI,但有时需要尝试功能快速并可视化结果.这就是 HighGUI 模块的设计目的.

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.

它提供了简单的界面:

  • 创建和操作可以显示图像并记住"其内容的窗口(无需处理来自操作系统的重绘事件).
  • 向窗口添加轨迹栏,处理简单的鼠标事件以及键盘命令.

操作"窗口仅限于命名、移动和调整它们的大小.

"Manipulating" windows is limited to naming, moving, resizing them.

(从我个人的角度来看,OpenCV 窗口仅用于原型设计,您不会在生产中使用任何东西.)

(From my personal point of view, OpenCV windows are just for prototyping, nothing you'd use in production.)

希望有帮助!

这篇关于有什么方法可以更改 imshow() 窗口的图标吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆