Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV 2.3 (C++,QtGui), Problem Initializing some specific USB Devices and Setups

I'm playing around with OpenCV since a while and I found some strange behavior of some specific capturing devices (PS3 Eye, Logitech C940, iSight) even on different Platforms.

Using OpenCV in Windows: All cams mentioned above work well. But when I want to use 2 cams and therefore create a second capture it will depend on the devices that I use in my Dual Cam Setup.

PS3 Eye + C940: no problems 2x C940: no problems

2x PS3 Eye: No chance, only the specific device that was connected first will initialize. The other PS3 Eye cannot be used the same time...No error events and no information about the problem is shown.

Now using OpenCV in MacOSX 10.7 (same for 10.6.x) there's different problems using the same devices and even the same QtGui-Application with 2 independent GLWidgets for displaying cv output in the QtGui.

Every Setup is great as long as it doesn't use a PS Eye in Mac OS. I tried macam and several other tools, but I just cannot get OpenCV to init this cam in OSX (I bought 3 for my project so hardware probs not very likely).

I'm still wondering where the problem is...Maybe 2 PS Eye's would work in OSX if a single one did? I can't tell.

I can even capture from 2x Logitech FULL HD Webcams simultaniously with nice performance.

Any Idea where Limitation could be with Dual PS Eye in Windows? Perhaps USB? And why can't OpenCV in OSX Capture from PSEye but macam can access the cam?

I just want to understand what's happening. Perhaps anyone of you found a way to use at least a singe PS Eye in OSX? Or is this just not possible? Can't opencv somehow use the macam component?

like image 822
QtGuy Avatar asked Dec 27 '22 15:12

QtGuy


1 Answers

Video capturing is very platform-dependent area. So difference between Windows and OS X is rather expected than wondering. OpenCV utilizes a lot of video capturing APIs to support as many device models as possible. At the moment (OpenCV 2.3.1) it uses following libs/APIs on the back-end:

Windows:

  • DirectShow (thought VideoInput library)
  • Microsoft's Video for Windows (VfW) API
  • CMU 1394 Digital Camera Driver
  • Matrox Imaging Library (MIL) (opt)
  • OpenNI camera drivers (opt)
  • XIMEA API for XIMEA devices (opt)

Linux:

  • libdc1394 (API v1 or API v2) - IIDC standard compliant cameras (opt)
  • PvAPI for Prosilica GigE Vision cameras (opt)
  • unicap - The uniform API for image acquisition devices (opt)
  • video4linux (V4L or V4L2) (opt)
  • OpenNI camera drivers (for Kinect) (opt)
  • XINE (opt)
  • XIMEA API for XIMEA devices (opt)

OS X:

  • QuickTime (opt)
  • QTKit (if no QuickTime, these two are mutually exclusive in OpenCV)
  • OpenNI camera drivers (opt)
  • XIMEA API for XIMEA devices (opt)

Android:

  • builtin Android camera

* (opt) - these interfaces are optional - can be turned on or off during the OpenCV build and may require some additional SDK.

About PS3 Eye - on Windows, it is most probably some limitation of VideoInput library or installed driver. On OS X - first, ensure that your OpenCV is built with QuickTime support. And second, ensure that macam.component is correctly installed into the QuickTime. Here is a quote from their FAQ:

Why can't I use my webcam with other applications?

You can. Please copy the macam.component into the /Library/QuickTime/ directory (for access by all users on the system) or into the ~/Library/QuickTime/ (for access by only that user). If you have a previous copy, please delete it first. A restart is usually not needed, but if you have trouble, it's a good thing to try. To verify that your installation works, test with a simple program such as HackTVCarbon, VideoViewer, or BTV.

like image 96
Andrey Kamaev Avatar answered Dec 31 '22 14:12

Andrey Kamaev