0

I tried to use Eclipse C++ to access See3cam CU40 camera which is in format of Y16 instead of RGB. I have installed required OpenCV library provided by the manufacturer but I encountered problems with libv4l2. Example:

#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;
}

Error in console:

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!

enter image description hereHere is resulting window

The desired result should be a window containing the edged video streaming captured by the camera, however, the frame was triplicated and somewhat overlapped. Anyone can help with this? Thanks.

Willie Cheng
  • 7,679
  • 13
  • 55
  • 68
  • have you solved your problem? feel free to ask any question if you have any problem! Please mark as answered if this solves your problem – Balaji R Jun 21 '16 at 03:11

1 Answers1

0

The output of See3Cam_CU40 is Y16- Bayer 10 Bit RGB IR Frame! You need to use modified version of the opencv videoio module as described here! Please visit here!https://www.e-consystems.com/blog/camera/?p=1317

Balaji R
  • 1,805
  • 22
  • 41
  • Thanks for your reply. How can I modify the videoio module? The website only provides modified highgui module and the documentary is not specific enough so that I got confused when replacing files. – ddy-siberian Jun 22 '16 at 02:05