Reputation: 43
I am using my builtin laptop webcam on Ubuntu 12.04
It was working fine at the beginning but now it gives me constant errors
CODE:
using namespace cv;
/** @function main */
int main(int argc, char** argv)
{
/// Read Video
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
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;
}
cv::waitKey(0);
return 0;
}
ERRORS:
VIDIOC_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: Invalid argument
VIDIOC_STREAMON: Invalid argument
Thanks in advance
Upvotes: 4
Views: 17881
Reputation: 11
I faced the same issue and cannot be resolved even after installing opencv 2.4.10 .Issue got resolved after installing libqt4-dev. Here is the command:
sudo apt-get install libqt4-dev
Upvotes: 1
Reputation: 311
I am using Ubuntu 12.04 . "VIDIOC_QUERYMENU: Invalid argument" error appeared while working with OpenCv version 2.4.8. I upgraded to OpenCv version 2.4.10 and error disappeared.
Upvotes: 1
Reputation: 313
This might be related to this issue: http://code.opencv.org/issues/3554
Upvotes: 0