VideoCapture未检测到uEye相机 [英] uEye camera not detected with VideoCapture

查看:205
本文介绍了VideoCapture未检测到uEye相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的uEye相机有问题。使用我的笔记本电脑摄像头(id 0)或usb上的网络摄像头(id 1),此行可以正常工作:TheVideoCapturer.open(1); (TheVideoCapturer是OpenCV的VideoCapture类。)

I'm pretty stuck on a problem with my uEye camera. Using my laptop camera (id 0) or internet camera on usb (id 1) this line works perfectly: TheVideoCapturer.open(1); (TheVideoCapturer is of VideoCapture class, OpenCV).

不幸的是,当我尝试使用uEye相机进行相同操作时,找不到它。我在ueyecameramanager中检查了相机ID,在某些专家模式下为1或35。我想像上面提到的照相机一样使用它。

Unfortunately, when I try to do the same with my uEye camera, it can't find it. I checked the camera ID in the ueyecameramanager, and it's 1. Or 35, in some expert mode. I'd like to use it the same way I used mentioned above cameras.

我有驱动程序,因为ueyecameramanager可以正常工作,并且给了我一些支持,并且ROS节点ueye_cam也可以正常工作。

I've got the drivers, because, well, the ueyecameramanager works and gives me some stream, and ROS node ueye_cam works fine as well .

任何建议都将不胜感激。

Any sort of advice would be gladly appreciated.

推荐答案

就我所知,即使您可能已经知道了这一点,您也无法直接在uEye相机上使用VideoCapture。您必须使用自己的SDK来访问视频流(或根据情况拍摄单个快照)。之后,您可以使用memcpy()将由 is:GetImageMem(...)填充的 void 指针所指向的内存复制到Mat对象(cv :: Mat :: ptr())。如果您看得足够近,那么 uEye的ROS节点它实际上使用uEye SDK提供的功能来设置和访问相机吗? ROS也有自己的图像格式,这就是为什么要实现接口的原因(称为 cv_bridge )将ROS图像转换为OpenCV图像。总体而言,这是对数据复制和转换的荒谬沙拉,但是由于这是当前的方式,因此您在这里没有太多选择。

Even though you have probably already figured it out as far as I know you cannot use VideoCapture directly with uEye cameras. You have to use their own SDK to access the videostream (or take a single snapshot depending on your case). After that you can use memcpy() to copy the memory that is pointed by void pointer filled by is:GetImageMem(...) to the Mat object (cv::Mat::ptr()). If you look close enough what the ROS node for uEye does it actually uses the functions provided by the uEye SDK to set and access the camera. ROS also has its own image format and that is why an interface is implemented (called cv_bridge) to convert ROS images to OpenCV images. Overall it's a ridiculous salad of data copying and conversion but since this is how things currently are you don't have much of a choice there.

这篇关于VideoCapture未检测到uEye相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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