在 Windows 上扩展 OpenCV 1.1 中 GUI 功能的最简单方法?
我有一个 C 语言的 大型实时计算机视觉项目,其 GUI 使用 OpenCV 1.1 的内置 -在 HighGUI 库中。正如其他人指出的,OpenCV GUI 库非常有限。
我想制作一个像 cvCreateTrackbar
这样的滑块条(轨迹栏)GUI 元素,其值可以为负值或正值。 OpenCV 目前仅将轨迹栏限制为正整数值。我不需要任何其他花哨的东西,只需要一个可以变为负数的滑块。
获得正负滑动条的最简单方法是什么?
我在 Windows XP 上使用 mingw 和 OpenCV 1.1。理想情况下,任何解决方案都应该需要最少的依赖项或库,并且应该与 Windows 和 mingw 很好地配合。
I have a large real time computer vision project in C with a gui that uses OpenCV 1.1's built-in HighGUI library. As others have pointed out, the OpenCV GUI library is very limited.
I'd like to make a slider bar (trackbar) GUI element like cvCreateTrackbar
that can have values that go either negative or positive. OpenCV currently limits trackbars to positive integer values only. I don't need anything else fancy, just a sliderbar that can go negative.
What is the easiest way to get a slider bar that goes positive and negative?
I am on Windows XP using mingw
and OpenCV 1.1. Ideally any solution should require minimum dependencies or libraries, and should play nice with Windows and mingw
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以围绕进度条类编写一个包装器,将您的值标准化为进度条的范围。例如,如果您的范围是 -5 到 5(包含 -5 到 5),请在发送到进度小部件之前向该值添加 5。 “+5”调整范围从 0 到 10。
您可能需要考虑使用不同的小部件,因为进度测量的大多数定义不会变为负值。 (您的应用程序实际上是否取得了负进度?)此外,大多数进度小部件都允许正增量,而不是绝对值。当应用程序运行时,它会向小部件添加增量。
“这只是我的意见,我可能是错的。” ——丹尼斯·米勒。
You could write a wrapper around the progress bar class that normalizes your values to the range of the progress bar. For example, if your range is -5 to 5, inclusive, add 5 to the value before sending to the progress widget. The "+5" adjusts the range from 0 to 10.
You may want to consider using a different widget as most definitions of progress measurements don't go negative. (Is your application actually making negative progress?) Also, most progress widgets allow for a positive increment, different than an absolute value. As the application runs, it adds an increment to the widget.
"That's just my opinion, I could be wrong." -- Dennis Miller.
[zGUI][1]https://github.com/zetapark/zGUI
我刚刚上传了一个 opencv gui 工具包。请看一下..
这完全依赖于opencv。
事件驱动..
[zGUI][1]https://github.com/zetapark/zGUI
I just uploaded a opencv gui toolkit. Please take a look..
This is solely dependent on opencv.
Event driven..