如何在OpenCV中显示流图像?

发布于 2024-12-09 18:53:30 字数 256 浏览 0 评论 0原文

我想使用EDSDK实现实时查看功能。我已经使用 EdsGetPointer 来获取内存流的内存地址的指针。现在我想在电脑上显示流媒体图像。

我读到有人使用VisualC上的API,例如ATL或CImage,只需传递内存流的指针作为参数即可显示流图像,并且该函数可以自行检索流图像。我正在考虑使用 OpenCV 来显示流图像,因为我的计算机上没有安装 VisualC。 OpenCV 上有什么函数可以用来显示流图像吗?或者我可以使用任何其他替代方法来处理来自 EDSDK 的流图像吗?

I'd like to implement the live view function using EDSDK. I have used EdsGetPointer to get the pointer of the memory address for memory streaming. Now I want to display the streaming image on the PC.

I have read in some people use the API on VisualC such as ATL or CImage which able display the streaming image just by passing the pointer of the memory stream as the parameter, and the function could retrieve the streaming images by itself. I am thinking of using OpenCV in order to display the streaming images as I don't have VisualC installed on my computer. Is there any function on OpenCV that I can use to display streaming images? Or is there any other alternatives that I can use to deal with streaming images from EDSDK?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我喜欢麦丽素 2024-12-16 18:53:30

您可以将数据打包到 IplImage 中,并在循环中使用 cvShowImage 显示它:http://opencv.willowgarage.com/documentation/user_interface.html 缺点是您被束缚在 OpenCV 事件循环中。

还有其他选择。过去,我使用 OpenGL 将图像绘制为纹理,以便我可以管理视口、在其上绘图等。使用 GLUT 可以很快获得一个简单且灵活的工作 GUI。这样做的好处是,无论您编写的任何 OpenGL 代码都可以移植到您使用的任何其他 UI 库,只要该库具有 OpenGL 画布小部件即可。我总是做的是Camera->IplImage->OpenGL Texture->wxWidgets glCanvas。我仍然使用OpenCV进行实际的图像处理等。它是完全跨平台的,不需要付费版本的VC++。

You can pack the data into an IplImage and show it using cvShowImage in a loop: http://opencv.willowgarage.com/documentation/user_interface.html The down side is you're tied into the OpenCV event loop.

There are alternatives. In the past I've used OpenGL to paint an image as a texture so that I could manage the viewport, draw on top of it, etc. You can get a simple and flexible working GUI pretty quickly using GLUT. A benefit to that is that whatever OpenGL code you write will be portable to any other UI library you use as long as that library has an OpenGL canvas widget. What I always do is Camera->IplImage->OpenGL Texture->wxWidgets glCanvas. I still use OpenCV for the actual image processing, etc. It's totally cross-platform and doesn't require the pay version of VC++.

世界如花海般美丽 2024-12-16 18:53:30

您想要用于 LiveView 吗?如果不是实时查看,您可以将流媒体图像保存在主机中
使用

Error = EdsCreateFileStream(dirItemInfo.szFileName, EDSDK.EdsFileCreateDisposition.CreateAlways, EDSDK.EdsAccess.ReadWrite, out stream);

然后你可以加载它

IplImage *inImg = cvLoadImage("photo2.jpg");

,然后可以在opencv中处理图像。

are you want it for LiveView ? if not for liveview, you can save your streaming image in host
using

Error = EdsCreateFileStream(dirItemInfo.szFileName, EDSDK.EdsFileCreateDisposition.CreateAlways, EDSDK.EdsAccess.ReadWrite, out stream);

then you can load it

IplImage *inImg = cvLoadImage("photo2.jpg");

and then can process the image in opencv.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文