我试着用Eclipse访问See3cam CU40相机,它的格式是Y16而不是RGB。我已经安装了制造商提供的所需的OpenCV库,但在使用libv4l2时遇到了问题。示例:
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <ctype.h>
using namespace cv;
using namespace std;
int main(int, char**)
{
VideoCapture cap(0);
if(!cap.isOpened()){ // check if default camera is opened
cout << "***Could not initialize capturing...***\n";
return -1;
}
Mat edges;
namedWindow("edges",1);
for(;;)
{
Mat frame;
cap >> frame; // get a new frame from camera
cvtColor(frame, edges, CV_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
imshow("edges", edges);
if(waitKey(30) >= 0) break;
}
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;
}控制台出错:
libv4l2: error set_fmt gave us a different result then try_fmt!
HIGHGUI ERROR: libv4l unable convert to requested pixfmt
libv4l2: error set_fmt gave us a different result then try_fmt!

这是生成的窗口
期望的结果应该是包含摄像机捕获的边缘视频流的窗口,然而,帧是三重的,并且有些重叠。有人能帮上忙吗?谢谢。
发布于 2016-06-17 12:01:20
See3Cam_CU40的输出是Y16-拜耳10位RGB帧!您需要使用修改版本的opencv videoio模块作为described here!请访问此处
https://stackoverflow.com/questions/37872067
复制相似问题