My understanding is that if you'd want to do that, you'd have to write a Kernel Extension. This means you can't change the camera's settings while using it in iChat or other applications. Note that you only have access to the camera if it is not in use by another process. I've also only implemented those controls that are supported by the QuickCam – other cameras might not support all of these, or might support additional ones. So all I know at this moment, is that it works with the QuickCam. However, I wasn't able to control the built-in iSight of my MacBook Air at all and I don't have any other cameras to test this with. In theory, the UVCCameraControl class should work with all UVC compatible cameras. You can use the USB Prober to find the values of your camera. In this example, VendorID and ProductID are the ones of the Logitech QuickCam 9000. So exposure, gain, brightness, contrast, saturation, sharpness and white balance all accept values from 0.0 to 1.0. Before setting a value the UVCCameraControl class asks the device for the min and max value for that setting and maps the input value accordingly. InitWithVendorID : 0x046d productID : 0x0990 ] Īll the input values are normalized. You can use it like this: UVCCameraControl * cameraControl = I've now cleaned up the source a bit and organized everything in a UVCCameraControl class. After some more hours of playing around with the Kernel Framework's USB API, I was finally able to control some of the QuickCam's settings! UVCCameraControl class
So, I poked around in the documentation for a while, read some Linux UVC driver sourcecode and used Apple's USB Prober to see what's going on. Great.īut wait, UVC is a standard, right? USB.org provides a documentation for all device classes, and the Video Class is no exception.
And Logitech apparently doesn't see the need to provide a Mac driver for their cameras, since Mac OS X already ships with one. Still, these cameras are the only devices that Apple provides an API for, if you want to change some esoteric parameters no one would ever need to change, like oh, the exposure time or white balance temperature for instance.Īpple is aware of the problem but hasn't done anything to solve it. What's an IIDC camera? Wil Shipley asked the same questions almost 3 years ago - even back then, IIDC cameras were pretty much deprecated. Well, maybe I could get to these parameters through the older Sequence Grabber Framework then? After all, there's a VDIIDCSetFeatures function and a vdIIDCFeatureExposure key! But nope, as the name implies, this stuff only works for IIDC cameras. Apple just implemented the bare minimum in its UVC driver and the QTkit Framework. No exposure values, no white balance, no gain, nothing. In fact, there's no way to change any parameters of your camera. I thought I could just turn the auto exposure off and set it to a fixed value through some QTKit API – but no, there's no way to change the exposure of a UVC camera with QTKit. However, the QuickCam 9000 has its auto exposure enabled by default, which is absolutely deadly for stable tracking results. I was able to get to the raw camera images through the QTKit Framework in no time. As I learned later, that's because the QuickCam 9000 is a UVC webcam for which Mac OS X 10.4.9 already provides a driver.
There was no need to install any drivers. I connected the camera to my Mac and was quite surprised to see that it just works.
Wednesday, July 15th 2009 UVC Camera Control for Mac OS Xįor a recent computer vision project I needed to pull images out of a Logitech QuickCam 9000 and track some markers with the help of the ARToolKitPlus library.