Using OSVR camera in OpenCV 3

171 views Asked by At

I'm trying to use the OSVR IR camera in OpenCV 3.1.

Initialization works OK.

Green LED is lit on camera.

When I call VideoCapture.read(mat) it returns false and mat is empty. Other cameras work fine with the same code and VLC can grab the stream from the OSVR camera.

Some further testing reveals: grab() return true, whereas retrieve(mat) again returns false. Getting width and height from the camera yields expected results but MODE and FORMAT gets me 0.

Is this a config issue? Can it be solved by a combination of VideoCapture.set calls?

1

There are 1 answers

1
reden On BEST ANSWER

Alternative Official answer received from the developers (after my own solution below): The reason my camera didn't work out of the box with OpenCV might be that it has old firmware (pre-v7).

Work around (or just update firmware):

I found the answer here while browsing anything remotely linked to the issue: Fastest way to get frames from webcam

You need to specify that it should use DirectShow.

VideoCapture capture( CV_CAP_DSHOW + id_of_camera );