Hi,
I try to get a see3cam_cu20 camera from e-con Systems working on my jetson tk1 board. My configuration is as follow :
- jetson tk1 board
- Ubuntu linux 14.04 with linux for tegra 21.6
- usb3 enabled
- opencv 3.4.1
I installed the qtcam program from e-con Systems and it works fine if I run it with this command :
sudo QSG_RENDER_LOOP=basic qtcam
I also tried to use qv4l2 program and it works too.
Now, if I try to run this simple c++ program, the program is running but I only get a green screen. In addition, there is an error message “select timeout” (see attached picture).
#include <QCoreApplication>
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <sstream>
#include <iostream>
#include <fstream>
using namespace cv;
using namespace std;
const int imageWidth = 640;
const int imageHeight = 480;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Mat frame(imageHeight,imageWidth, CV_32FC3);
VideoCapture stream1(-1);
if (!stream1.isOpened()) {
cout << "cannot open camera";
return a.exec();
}
stream1.set(CV_CAP_PROP_FRAME_WIDTH,imageWidth);
stream1.set(CV_CAP_PROP_FRAME_HEIGHT,imageHeight);
int framesPerSecond = stream1.get(CV_CAP_PROP_FPS);
cout << "FPS = " << framesPerSecond << endl;
cout << "Convert RGB : " << stream1.get(CV_CAP_PROP_CONVERT_RGB) << endl;
cout << "Video size : " << stream1.get(CV_CAP_PROP_FRAME_WIDTH) << " x " << stream1.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
cout << "OpenCV version : " << CV_VERSION << endl;
namedWindow("seecam", CV_WINDOW_AUTOSIZE);
bool stop = true;
while(stop)
{
stream1 >> frame;
if( frame.empty() ) {
break;
cout << "Frame is empty !" << endl;
}
imshow("seecam", frame);
char character = waitKey(1000 / framesPerSecond);
switch (character)
{
case 27:
cout << "bye!" <<endl;
stop = false;
break;
}
}
waitKey(0);
return a.exec();
}
I can’t figure out where is the problem. Any idea ?
Thanks
Comment : I compile opencv from source with this option for video I/O :
Video I/O:
-- FFMPEG: YES
-- avcodec: YES (ver 54.35.1)
-- avformat: YES (ver 54.20.4)
-- avutil: YES (ver 52.3.0)
-- swscale: YES (ver 2.1.1)
-- avresample: NO
-- libv4l/libv4l2: NO
-- v4l/v4l2: linux/videodev2.h
-- gPhoto2: NO