
HYPE Framework / Webcam Motion Detection
A little while ago I was looking into some possibilities for an interactive installation, and decide that I wanted to use webcam input, possibly microphone and generative graphics.
Searching around for webcam motion detection lead me to Justin Windle‘s excellent post & code samples.
Over the years i’d obviously heard a lot about Joshua Davis & Branden Hall’s HYPE Framework, for taking the heavy lifting out of generative artwork projects, so this seemed like a great place to start.
So, after some initial simple experiments, I customised the HYPE MouseFollow class, and created an XYFollow class, that would listen for and XY position rather than a mouse position.
However, I wanted the visuals to be a bit more interesting than just a blob moving around the screen, so looked at the HYPE Pixel Colorist examples.
That happened to use a Point theat the particle swarm were using as a target. In the example it was getting a random point, but i hijacked it, and made it follow the webcam motion tracking point instead.
In the end I adapted Soulwire’s MotionTracker class, instantiated it as it’s own object, and allowed the HYPE framework to query it for an XY position, as it needed.
The XY Position I got from the webcam (4:3) ratio was mapped onto my own specific canvas ratio (2:1) and used as a target for the HYPE swarm to follow.
So, hopefully this will be the first of many such experiments with both the webcam & the HYPE framework.. next step: Microphone monitoring
Click on any of the images below to run the flash demo, and all the better if you have a webcam.. if not, don’t worry you can toggle between webcam & mouse follow..
Note: hit spacebar in the demo to toggle the controls and info on / off.
Click on any of the images above, or click here to run the flash demo.
I will be uploading the code at some point, when it’s a bit tidier..




