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

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?

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.

Related

Hog mode / Exclusive access to audio output device with SoX

I would like to know whether SoX/LibSoX offers the possibility to access a sound device in exclusive/hog mode. The idea is to prevent other applications from accessing the sound card / DAC that is being used by the focal app.
My main target is OSX CoreAudio output, but I am also eager to know about Linux (OSS/Alsa).
I know this is possible in CoreAudio, because I have seen it implemented in several apps, including this open source one.
On Mac OS X at least, the answer appears to be no. In http://sourceforge.net/p/sox/code/ci/master/tree/src/coreaudio.c SoX uses the default input or output device but there is no provision for hog mode.

Set audio input level using portaudio

I am dealing with a legacy code that uses portaudio on windows. The code grabs audio from desktop mic and has ability to configure input volume. It worked perfectly under windows xp, but tuning audio input level is broken under windows 7, changing the parameter has no effect on output audio stream.
Code do the following to adjust volume
mp_mixer = Px_OpenMixer(mp_inputStream, m_dev_num);
if(mp_mixer) Px_SetInputVolume(mp_mixer, m_volume);
I have discovered, that underling winmme functions does not work in Windows Vista and newer. I have updated to last version of portaudio pa_stable_v19_20140130 in which Mixer functions are not available anymore. I can't find alternative way to adjust input volume in portsound, Is there any?
I think you are going to have to use the Audio Endpoint Device API. http://msdn.microsoft.com/en-us/library/windows/desktop/dd370793(v=vs.85).aspx
Like you said the WMME mixer API is no longer supported.
The API isn't too bad. Just make sure you use the portaudio API device index to identify the device in the mixer API.

Can you use the Kinect for Xbox for Kinect Fusion?

I have a Kinect for Xbox that I would like to use for Kinect Fusion, but it doesn't recognize the sensor when it is plugged in. Would I need a Kinect for Windows to be able to use Kinect Fusion?
There is no problem running Kinect fusion with a Kinect for XBox, As far as I know theonly option that doesn't work on XBox version is near mode, but that's not required for fusion.
In case your card does not support DirectX11 you will not be able to use hardware acceleration tho, so in c# you need to use the following flag :
ReconstructionProcessor ProcessorType = ReconstructionProcessor.Cpu;
instead of
ReconstructionProcessor ProcessorType = ReconstructionProcessor.Amp;
Also make sure to copy binaries in the same folder as your executable (eg: KinectFusion180_32.dll or 64 bits version to your convenience).
That's more or less it, it just works )

Can SimpleCV read out multiple USB camera simultaneous in Windows 7?

I've been using OpenCV to read out camera output and process the frames. I am on Windows 7, and it turns out that OpenCV cannot simultaneously read multiple USB cameras in Windows. Does anybody have an experience with SimpleCV in Windows 7 in this direction? Is it capable of displaying output of multiple USB cameras in Windows 7 simultaneously?
Thanks!
I'm one of the core developers for SimpleCV and I'm guessing if OpenCV can't do it than it won't work. We have pygame as a graceful fallback on linux and mac but a camera interface doesn't exist to it on windows sadly. I have still yet to find a good open source solution to just viewing a webcam on windows either.

QTKit does not enumerate my USB- and virtual cams in 64Bit mode. Is there a workaround?

I have a problem with Quicktime, that means, QTKit. A long time ago I wrote an app, which is using camera devices on Mac OS X. The user could select the camera using a popup box. I populated the device list into a popup box so the user could choose his preferred camera. Now I migrated to 64Bit code. And everything works fine with iSight cam. Audio devices are listed properly, too (including virtual drivers like Soundflower). For my surprise all camera-devices are missing. And QTKit never enumerates the existing cameras. Is there a workaround or does someone know something about this issue?
I encountered the same issue. Haven't found a workaround other than keeping it 32bit. The Quicktime API mailing list has already discussed this here basically stating that the camera device (your camera device) is a Quicktime Component and Quicktime Components are only supported with Quicktime 7 not Quicktime X if I understood this correctly.
So to put it bluntly: Quicktime Components are not supported in 64bit, for whatever reason I don't understand.
Update: another discussion on the quicktime-api-lists also covers this topic here. Search for vdig in the discussion and you'll find statements on the whole 32bit vs. 64bit complications:
Apple has never updated or replaced the VDIG/ SG / QuickTime Component
API to a 64 bit architecture and your VDIG will never show up as a
selectable device under 64 Bit. So your VDIG is screwed, just like
every other Mac 3rd party QT component developer is.
Also, the term QTKitServer pops up, which seems undocumented but is used by Quicktime X in 64bit mode to play movies in 32bit by using Quicktime components.
Maybe QTKitServer is the key?

Resources