Controlling iSight Autoexposure programmatically

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.

Plotting a Single Point with Gnuplot

Sometimes simple things can be very hard to do. For instance plotting a single point with gnuplot. Luckily, there are two horrible hacks which allow you to accomplish this from the gnuplot prompt (putting the point’s coordinates in a file is of course just the easy way out…).

Method 1:
gnuplot> plot “< echo ‘x   y’”

(Set x and y to your point’s x and y coordinate)

Method 2:
gnuplot> plot “-”     (press shift enter)
x    y        (press enter)
e

iSightMaster - Progress

Work on iSightMaster has continued. Here is the first screenshot of the current version:

Screenshot

iSightMaster is now using  the incredibly helpful OpenCV library. The final release date remains “when it’s done”.

Converting Videos for the iPhone 3G on Mac using Open Source Tools

Since my girlfriend got a brand new iPhone these days, I have spent my time getting videos on it. It’s not quite as simple as one would expect from Apple. To make things worse, a simple Google search will only bring up incredibly bad, adinfected semimalwareesque, screw-the-average-user-over-40-bucks programs. Luckily, there is OpenShiiva, a simple mac application which does the job for you. If anyone is reading this and in need of a short guide, then just drop a comment.

The Next Generation - 13 Year old raises 6.5m$ Venture Capital

Holy *’$@#! I just looked at slashdot for the first time today and I really can’t believe what I’m reading: A 13(!) year old sixth-grader from california just got 6.5 million dollars in venture capital for a company he co-founded and which he is said to have been running the last year or so in his garage.According to the slashdot article and the original article behind it the kid raised the first capital for his company by selling online game items. Now his company tries to fully commercialize this market and offers game publishers a platform enabling people to sell and buy online game stuff (like that kick ass wow sword you always wanted) directly in-game.Ok, we were already getting used to 18 year old dot com millionaires and other web 2.0 strangenesses, but this story now seems to set a new record. So I guess that all those college students wishing to start their own companies should hurry up just a little. The next generation of kindergarten enterpreneurs is already forming…

iSightMaster - Control your Mac using simple Hand Gestures

Edit: There is a new version of this software.

I’ve just finished my first Cocoa/Objective-C application. It is called (right now) ‘iSightMaster’. It enables you to control your mac using your iSight and simple motions of your hand (or red/blue colored objects). The screenshot below shows a configuration of iSightMaster in which Expose is triggered if there is a motion from right to left with a certain speed. At the moment iSightMaster is still in its alpha stage, so it ony recognizes simple up/down,as well as left/right motions. If you would like to try it out yourself, then download the application here: isightmaster.zip  (should be a universal binary)Below the screenshot is a short description how to use iSightMaster.isightmaster.png Controlling Expose using iSightMaster:

  1. Start the application. If you see a black and white image appearing, iSighMaster isworking on your computer.
  2. We will use motion detection in this example: Set the sliders according to the screenshot above. Play around a little bit such that ‘motion left’ is shown in the log only when you move your hand, etc., fast enough from right to left.
  3. Click ‘Add…’, then enter in the left cell ‘motion left’ and in the right cell ‘tell application “System Events” to key code 101′. (You can enter any other AppleScript you wish in this field)
  4. Now Expose should be triggered whenever you perform a quick left to right motion.
  5. Have fun experimenting and drop a comment with your experiences.!

Note: This software is probably very buggy! So use it at your own risk! I do take no responsibility for whatever damage you might do to your software and/or hardware!

Political Opinion Hard Wired in Brain?

Check out this: http://www.wissenschaft.de/wissenschaft/news/282945 (in German). Some scientists apparently have been trying to find a difference in how persons who consider themselves rather liberal (or conservative) deal with new situations. The result they came up with seems to be quite interesting: Whenever the situation in the experiment changed, in most ‘liberal brains’ a different area was activated than in the ‘conservative brains’. The ‘liberal area’ in the brain seems to be the anterior cingular cortex. The scientists conclude that this might be a clue to whether political opinions are inherited saying that political opinion usually doesn’t change throughout one’s life. I can imagine the next Fox News headline: ‘Scientists: Liberals need brain surgery.’ 

Honey, I’ve lost the nukes!

According to this article on forbes.com a US B-52 bomber mistakenly(!) flew around six nuclear armed missiles across several states of the US. Guess I’ll go rent me some Kubrick DVDs now…

The Song Of The First Covenant

Hear ye, hear ye, this is the song of Ibem and his chosen people, the Siliconites.This is the song of the first covenant of computation and the breaking of the seal.
In the beginning there was Ibem. And Ibem ceated the first covenant with man who then went forth to adore Ibem and bring the message of peaceful compuation to the people of Itarnia. And for a time it was good. [Read more →]

3 Phrases For The Dada Traveller

  1. ¿Puedo tener palillos? Estoy teniendo mi período: Spanish for “Can I have chopsticks? I am having my period.
  2. Où est le bureau de poste, ma jambe cornait mal: French for “Where is the post office, my leg hurts.
  3. Quanto para o hippopotamus? Portuguese for “How much for the Hippopotamus?”

(Translation done using Google.)

   


   Twitter
   Impressum