Instructables
 
Ohhh timing. You ruin every jump shot.
You're counting down right before you leap into the air and your friend is crouched on the ground with their finger on the shutter button. Leaping into the air with a glorious jump, you pose for a split second. Confident in your ability, you run to your friend only to find that it is, yet again, another perfectly great jump shot ruined by the lag between pressing the shutter button and the photo actually being taken.

Well, no more! Using Processing, OpenCV, and a high quality web camera, you can take a perfect jump shot (nearly*) everytime!


*has some annoying constraints (see the last step!)
 
Remove these adsRemove these ads by Signing Up

Step 1: How It Works

The key to this project is using OpenCV's face detection capabilities. When a person is looking towards the camera, it will register the face. This is an example already available in the OpenCV library that was modified for this project. The sketch (Processing lingo for the code) is analyzing the basics of a persons movement. If their head goes above a certain location on the frame and there is a change in vertical direction (start falling back down), it will automatically take a image from the web camera. 

Step 2: Get Processing Set Up

Picture of Get Processing Set Up

Note: Newer versions of Processing are no longer compatible with this library. This OpenCV library works with the later versions of Processing, however, my code is not compatible with it. I'll try and update this Instructable when I get a chance.

First of all, you will need a computer that has Processing installed. Processing is free and open source, so download it and install it on your computer right now! It is a powerful tool and has a very active community of people working with it.

You will also need to install OpenCV and the Simple-OpenCV library for Processing. If you are using a Mac, you can follow this Instructable otherwise you can always follow the directions on this website.

haigarmen8 months ago

Has anyone refactored the code to use Greg Borenstein's newer OpenCV for Processing library? http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/

Hi.
You did a really nice work with OpenCV i'm impressed.
And you could maybe help me in some way.
I made a program a few ago which dectect my head.
I used the cvhaardectect and the face.xml
I'm running this with xcode on my macbook but the program is running really slow.
I basicly capture a frame, display it on a window and i draw a circle around my face.
It's not the drawing which slow down but I cannot verify if the display does.
I'll be very thankful if you could give me some tip or/and tricks to increase the speed of my captures.
Thanks in advance.
Again; you did an amazing job.
ElectricSlim (author)  greenben2141 year ago
Unfortunately, I don't have experience the with CV programs that you are using. I'd recommend finding an OpenCV forum and posting there.
haruspex1 year ago
This is a lot of fun. From a usability standpoint, though, this doesn't seem any easier than just using the webcam to film and then take a still from the resulting video. If your webcam for some reason takes higher resolution pictures than video, than this project makes a lot of sense. Nice write-up!
alcurb1 year ago
It's a clever funny project. Ditto on what MassimoHackensack said. I do admit that playing and sometimes fighting with OpenCV is a blast.
I find just making a video and using an editing program that has frame capture to much easier.
Do all the jumping and dancing you want, face any direction and spin in mid air if you wish and then just capture the frames as jpegs and link them together.
tinyweasel1 year ago
Reminds me of this. http://www.youtube.com/watch?v=5LwsAn1TnBM
I dont get it.. would you not be able to just bring a movie file into PS and render the individual frames and then deleting all but the jumping frames. and same for web.. and bang.. You have jumping in the air gif.?
zmashiah1 year ago
Very Nice!
I like it, and would try connecting it to DSLR to get better photo qualities.
This is a great project!
It shouldn't be difficult to connect a DSLR to this setup, maybe through an Arduino, and just shoot a burst (to get the best possibile picture) in the right moment :)
Actually if you got a PC there (or Mac), would be much easier to use the libs from Canon (maybe Nikon too) to directly control the DSLR. Canon have some SDK I played with and can do any control on the camera connected with USB cable. The SDK requires registration but otherwise free.
What sort of frame rates are you able to analyze the photo for a face? Could you track the average height of the face and snap the picture at its peak?
TheGreatS1 year ago
This is awesome and super usefull. I like you're wallpaper too.
ok i'll be nice. please don't say you are wallpaper, when you mean something else. thank you : )
ElectricSlim (author)  TheGreatS1 year ago
Thanks!
Please may I ask, where can I get that wallpaper ?
ElectricSlim (author)  ElectroFrank1 year ago
http://goo.gl/57xGhs
Got it, many thanks !
I agree. On both points. Tesla was awesome
FightCube1 year ago
Largest one I could find: http://i.imgur.com/Nv5qZIT.jpg
tseay1 year ago
Very clever...
This is super rad, I told my friend Lauren about this camera - she basically got her start as a photographer making jump shots.
ElectricSlim (author)  audreyobscura1 year ago
Thanks, Audrey! Lauren's photos are beautiful! I'm also going to need to spend the next 4 days researching everything about Philippe Halsman and the theory of jumpology...