One of the things that make computer vision with Apple’s builtin iSight quite cumbersome, are the extremely annoying auto-exposure and auto-whitebalance features. Also, Apple does not seem to care one bit about providing any kind of documentation on how to deactivate these features (and/or control other features) of your iSight. Anyways, after a long time of googling/research I found an Objective-C class at phoboslab.org, which allows to control UVC compliant USB webcams.
With the help of this class and a few tweaks to its code I was finally able to deactivate auto-exposure and auto-whitebalance of my builtin iSight.
Here are my steps:
1. Get the UVCCameraControl class and include it in your project.
2. Instantiate this class after you started your QTCapture session with something like this:
“cameraControl = [[UVCCameraControl alloc] initWithVendorID:0×05ac productID:0×8507];”
(You might have to adjust the parameters, USB Prober is your friend)
3. In the file “UVCCameraControl.h” change the line “#define UVC_PROCESSING_UNIT_ID 0×02″ to
“#define UVC_PROCESSING_UNIT_ID 0×03″
4. In the method “- (BOOL)sendControlRequest:(IOUSBDevRequest)controlRequest” remove the calls to USBInterfaceOpen() and USBInterfaceClose().
That’s it! At least this is how it worked out for me on my MacBook Pro (latest Generation). If you still have some problems, just drop a comment.
Note: This does not seem to work, if you access your iSight via the old sequence grabber component. Be sure to use the newer Quicktime API.
Tags: MacFun by admin
5 Comments »