Taking a perfectly timed photograph of a jumping person is not trivial. You both count, 3…2..1…jump!
Wait, I should have jumped on “1″ or jumped on “Jump!”. Let’s try again. And again. and again… Would it be nice if we could do it perfect every time?
Imagine the photobooth opportunities it can open for events and weddings – an unattended booth that takes jump shots (no pun intended)
Instructables member Andrew Maxwell-Parish (A.K.A ElectricSlim) used two open source programs Processing (a programming language for visual creatives) and OpenCV (computer vision and learning) to create an automatic photobooth that takes pictures when you jump. It actually does better – it takes them at the peak of the jump and does not even require a fancy camera.
Here is a funny little movie that shows what this booth is capable of (please… speakers on full volume)
Andrew explains the mechanism behind the photobooth:
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 person’s 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.
If you have a USB camera ,all you have to do is download and install the relevant software and a sketch (program) that Andrew provides.
The sketch should automatically load that [USB camera] over the onboard web camera. At least that’s what happens with me. I hope it does with you.
You will want to check both the wide and high variables in the sketch. This should match the resolution of the web camera that you are using. When you are jumping you’ll want to be far enough back that you can get your whole body in the frame. If your face is detected you’ll see a red box at the top of the camera feed. Jump up high to get your head in that box. If it flashes white and you hear a shutter sound, then it took an image and saved it in the folder file that contains the Processing sketch.
While easy to setup, Andrew did find a few caveats:
- the face detection on OpenCV requires that your face is pointed towards
the camera. If your head is tilted away from the camera, it isn’t going
- Lighting is also an issue. I found that working in a room with a
reasonable amount of natural sunlight seemed work best. Dimly lit rooms
produced lower quality images and had a higher chance of not taking an
- Jumping against a bare background also seems to work better with
the face detection. OpenCV will occasionally detect random objects in
the background as faces
Internet getting flooded with Jumping shots in 3, 2, 1…
[Automatically Take Perfect Jump Shots | Andrew Maxwell-Parish]