1

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?

reden
  • 968
  • 7
  • 14

1 Answers1

1

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 );
Community
  • 1
  • 1
reden
  • 968
  • 7
  • 14
  • Yeah, v6 firmware fixes sync issues and v7 firmware fixes the USB UVC descriptor so it doesn't advertise a format it doesn't actually produce, which was required to get it working on non-Windows and as a byproduct, got it working by default in OpenCV on Windows too. I'm assuming it was trying to use the bogus format by default. – Ryan Pavlik Dec 15 '16 at 16:53