OpenCV in python. Getting webcam stream works, but error message is printed


Question

I am writing something in which I need the webcam stream and do some face detection on it. Everything works fine, but I get an error message printed in the terminal, despite of me using cv.CaptureFromCAM(-1) which detects any camera connected to my machine. I also tried using cv2 instead of cv, and I get the same error:

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

Note that the only code I am running currently is cv.CaptureFromCAM(-1).Oh and I am using python 2.7.

 import cv
 cv.CaptureFromCAM(-1)

Can someone tell me how to fix this? Thanks.

1
2
2/19/2013 1:41:49 PM

I ran into the same error messages. In my case however they are not fatal just an indication that python is using v4l2 to probe parameters that happen to be invalid for my camera / os combination.

In my case

>>> cap = cv2.VideoCapture(0)
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
...

But

ret, frame = cap.read()

gives ret=true and a numby image for frame.

In my case the video camera is a Logitech, Inc. HD Webcam C910. And I am running Angstrom on a beagleboneblack.

1
2/11/2014 7:15:38 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon