VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDIOC_STREAMON: Bad file descriptor
Good news bad news ....
I modified mi cap_v4l.cpp file in order to set EXPOSURE_ABSOLUTE camera parameter ... all ok ...
Anyhow ... since I installed opencv3.0 I can not turn off and turn on the camera repeatedly without closing my app .... first with opencv 2.4.9 we could (though I used another system ..)... the simple code that I use ...
if (!mo_cap.isOpened())
{
VideoCapture mo_cap; // open the default camer
mo_cap.open(0);
}
if (mo_cap.isOpened())
{
do
{
QMutex mutex;
mutex.lock();
if(this->Stop) break;
mutex.unlock();
mo_cap.set(CV_CAP_PROP_GAIN, ex_gain);
mo_cap.set(CV_CAP_PROP_EXPOSURE, ex_exposure_abs);
controllokeypoint2 = 0;
mo_cap >> dest_image1111;
cvtColor(dest_image1111, dest_image, COLOR_BGR2RGB);
dest_image1 = dest_image.clone();
Mat2QImage(dest_image1); /**** these func send the video on Gui *******/
this->msleep(30);
}
While(/*stop_capture button is checked*/)
dest_image1111.release();
dest_image1.release();
dest_imag1111.release();
mo_cap.release();
qDebug() << "the camera thread is closed.";
}
I'm on linux kernel 4.4.041 all is installed ok ... when I try run again my thread obtain these error ...
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDIOC_STREAMON: Bad file descriptor
VIDIOC_STREAMON: Bad file descriptor
VIDIOC_STREAMON: Bad file descriptor /**** one for every thread cicle*****/
All type of suggest is well accept ...
Regards
giorgio
↧