OPENCV多相机处理问题
OpenCV Multi-camera handling issue
1)我在使用OpenCV(更新的Kubuntu Linux)处理两个Logitech C310摄像机时会遇到此错误
vidioc_streamon:设备上没有剩余的空间
整个错误日志如下
**IDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument**
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
**libv4l2: error turning on stream: No space left on device**
**VIDIOC_STREAMON: No space left on device**
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /home/rjdp/Computer_Vision/0_Installers/OpenCV-2.4.2/modules/core/src/array.cpp, line 2482
terminate called after throwing an instance of 'cv::Exception'
what(): /home/rjdp/Computer_Vision/0_Installers/OpenCV-2.4.2/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat
2)仅在处理两个摄像机,即使在默认低RES 640x480时也会发生。我仍然试图将代码中的分辨率降低到320x240,这也不起作用。
3)我在这里搜索了许多其他帖子&在其他网站上。这告诉我没有足够的USB凸轮带宽可用。因此,我试图将一个凸轮插入前方USB&一个在后侧也失败了:(
我的问题是:
是否可以解决此问题BandWith/Memory&运行两个或 OpenCV 2.4.2 ?? OpenCV使用 ffmpeg 处理I/O的更多摄像机,我可以使用一些ffmpeg命令告诉我的相机硬件,以使用 comprateds mpeg进行输入流模式而不是频率消耗正常模式。
代码如下:
#include "opencv2/opencv.hpp"
#include <stdio.h>
using namespace cv;
int main(int, char**)
{
VideoCapture cap01(0); // open the default camera
cap01.set(CV_CAP_PROP_FRAME_WIDTH,320);
cap01.set(CV_CAP_PROP_FRAME_HEIGHT,240);
//sleep(1);
if(!cap01.isOpened()) // check if we succeeded
return -1;
namedWindow("Camera01",1);
VideoCapture cap02(1); // open the default camera
cap02.set(CV_CAP_PROP_FRAME_WIDTH,320);
cap02.set(CV_CAP_PROP_FRAME_HEIGHT,240);
if(!cap02.isOpened()) // check if we succeeded
return -1;
namedWindow("Camera02",1);
for(;;)
{
Mat frame, frame_1;
//Mat frame02;
cap02 >> frame;
imshow("Camera01", frame);
if(waitKey(30) >= 0) break;
Mat frame_1;
cap02 >> frame_1;
imshow("Camera02", frame_1);
if(waitKey(30) >= 0) break;
}
return 0;
}
使用pci USB扩展卡对我解决了相同的问题,因为网络摄像头会在USB总线上使用所有可用的bandwith。使用PCI USB扩展卡为您提供第二个USB总线,您可以连接第二个网络摄像头
相关文章:
- 警告处理为错误这里有什么问题
- posix_spawn():使用posix_scawn()时的错误处理问题
- 当我使用 C++ 中的 C# dll 来使用 Selenium 时,存在异常处理问题
- C++:处理抽象类中的错误时出现问题
- 在通知提升间处理条件变量时未按住锁会导致问题
- 如何在 cpp 中使用 std::enable_if 从模板中处理此类问题
- 如何处理来自MIPI相机的12位图像?
- wxWidgets 拖放文件事件处理程序初始化问题(无效static_cast)
- OpenGL 相机移动程序顶点着色器问题
- 关于 istream 中的错误处理的问题
- 有关如何处理 vulkan 队列系列的问题
- 我如何处理这种情况C++大小问题
- OPENCV多相机处理问题
- C++循环算法不正确(或文件处理问题)
- 异常处理问题,原因
- 内存处理问题
- 失败错误处理问题
- Borland c++5.02文件处理问题
- 请纠正我的异常处理问题
- 需要建议:处理来自相机的彩色图像;人造人;开放简历;NDK;C++