Edit: New Version available.
I am proud to announce that the first beta version of iPinchMe is now available for download:
Link: iPinchMe - Beta
Requirements: Mac OS X 10.5 or later, Intel based Mac with builtin iSight.
This software is provided “as is” and in a HIGHLY EXPERIMENTAL state. I take no responsibility for whatever happens when you use it
Here is a short introduction on how to use it:
- Download and unpack the file.
- Start the program.
- While the prgram is initializing, step away from the camera, so that iPinchMe can learn the background. You can have it relearn the background, if you press the “Reinitialize” button (sometimes you have to press it a few times).
- Step back in front of the camera. The prgram should now recognize you as the foreground and draw a contour around you.
- Perform a pinch gesture (as shown in the iPhoto videos). Upon releasing the pinch, Expose should be triggered.
You should be in front of a static and more or less homogeneous background with as few dark areas as possible. Be sure to have enough illumination in your room. Otherwise iPinchMe will recognize false pinches or none at all, wildly triggering AppleScripts.Remember: iPinchMe will not work like magic! Computer Vision is a tough and computationally expensive problem…
How to bind other Apple Scripts to the pinches:
Upon the first start, iPinchMe will create the following file: ~/Library/Application Support/iPinchMe/ipinchme.script which contains an Apple Script function that is called from iPinchMe.
It will look like this:
if event_msg is equal to “one_pinch_release” then
tell application “System Events” to key code 101
Depending on what gesture you perform, the string event_msg will have a different content. Currently supported are the following gestures:
- event_msg = “one_pinch_down” (pinching with one hand)
- event_msg = “two_pinch_down” (pinching with two hands)
- event_msg = “one_pinch_release” (stop pinching with one hand)
- event_msg = “two_pinch_release” (stop pinching with both hands)
- event_msg = “one_pinch_release_left” (stop pinching with one hand on the left side of the captured camera image)
- event_msg = “one_pinch_release_right” (stop pinching with one hand on the right side of the captured camera image)
To bind one of these gestures to an Apple Script, for instance if you would like iTunes to play the next song when you perform the one_pinch_down gesture, you will have to add something like this into the body of the handle_event method:
if event_msg is equal to “one_pinch_down” then
tell application “iTunes” to next track
Apart from binding apple scripts to gestures, iPinchMe can also send keyboard events to other applications. This feature is however in a quite experimental state. So you should be really careful when to activate it!!! Only use it when you know what you are doing!!!!
Controlling Google Earth: Tick the checkbox “Send Keys” and then make sure that Google Earth is running in the foreground. In the same way you can also control TuxRacer or other apps that react on the left/right/up/down arrow keys. Look at the videos below, in order to get an impression on how move your hands.
I hope that you will have some fun with this small tool. In case you have questions, comments, bug reports, etc., just use the comments section. Ideas for future versions are always welcome.