如何使用 C++ 将活动窗口设置为 opencv 图像OSX 中的 opencv highgui
在C++中,如何强制opencv窗口(例如在imshow调用之后)到前台?
在网上环顾四周,似乎你必须获取句柄,然后进行一些本机调用:
imshow("img", img);
void* handle = cvGetWindowHandle("img");
??
然后以某种方式使用本机句柄。我使用的是 OSX,我不熟悉 Carbon 或 Cocoa API,并且不确定它如何与 openCV 交互。谁能提供一个例子来说明我如何做到这一点?
另外,是否有 opencv 2.0 c++ 替代 cvGetWindowHandle() ?
In C++, how do I force an opencv window (eg after an imshow call) to the foreground?
Looking around on the net, it seems you have to get the handle, and then make some native call:
imshow("img", img);
void* handle = cvGetWindowHandle("img");
??
Then somehow use the native handle. I'm using OSX and I'm not familiar with the Carbon or Cocoa API and I'm not sure how it would interface with openCV. Can anyone provide an example of how I do this?
Also, is there an opencv 2.0 c++ alternative to cvGetWindowHandle()?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉 OpenCVs highgui,但是当我在 OSX 项目上工作时,我通常通过 NSImageView 显示我的 OpenCV 输出。要将我的 cv::Mat 转换为 NSImage,我使用这个助手: https://gist.github.com/1716068< /a>
也许有帮助:)
I'm not familiar with OpenCVs highgui, but when I'm working on OSX projects I usually displaying my OpenCV output through a NSImageView. To convert my cv::Mat to a NSImage I use this helper: https://gist.github.com/1716068
Maybe it's helpful :)