|
Author |
Topic: Color-tracking video (Read 3463 times) |
|
flight404
|
Color-tracking video
« on: Jul 5th, 2003, 8:48am » |
|
Trying to track movement by searching for the greatest concentration of red pixels. http://www.flight404.com/p5/video/virtualBall3.mov Had a red pen-cap tip in my hand. Unfortunately, my web cam does a massive amount of auto-color correction so it was a lot harder to find the red cap without it jumping to pinkish hues on my hand. Maybe red isnt the best color to use.
|
|
|
|
benelek
|
Re: Color-tracking video
« Reply #1 on: Jul 5th, 2003, 1:51pm » |
|
i tried a similar thing a while ago, using a small torch, and i think Glen Murphy also had a go at it. i think the major problem with using this method is that the movement tracking is a bit jagged (because of how often p5 can pull images from my webcam, as well as how long it takes to process the image for each frame). otherwise it'd be a pretty cool alternative to the ol' mouse also, as you mention, it relies on a slightly constructed situation - you can't have that particular colour/brightness moving about somewhere in the background, so the system works best in a dark room, or in front of a blue screen!
|
|
|
|
flight404
|
Re: Color-tracking video
« Reply #2 on: Jul 5th, 2003, 10:27pm » |
|
Indeed, not a mouse substitute, But with a little finagling and some proper lighting, I was able to modify it so that I could adjust volume of a sound loop by moving my hands up (louder) or down (quieter) and adjust the speed by moving my hands from right to left, creating a range of extra fast rewind to extra fastforward with normal play speed somewhere just right of middle. Silly, but very entertaining. Felt like a maestro, I did. Thinking about trying to make a poor poor mans minority report. Stand in front of the camera and along with the camera image, your window shows a small quicktime. A red dot will change speed of the movie playback and a blue one will register the upperleft corner and a green one, the lower right (for scaling). But with this color-correcting camera, I doubt i would get very far unless i can figure out a way to somehow disable the auto color correct and find a way to recognize not only colors, but the general shape of those color concentrations.
|
|
|
|
Glen Murphy
|
Re: Color-tracking video
« Reply #4 on: Jul 6th, 2003, 11:04am » |
|
I did something vaguely similar here: http://riot.com.au/systems.php?s=b1, and while it was written in C++, most of the logic could just be pasted into P5 and work fine. Let me know if you want to see it (I can't give away the source to the framegrabber bit, however). There should be some description of how it works on that page, but the biggest problem I encountered was that at its default settings, the code wasn't 'portable' - I couldn't demo it in just any environment without some major tweaking. So in the end, I used the LEDs and set the camera's shutter speed to around 1/1000th of a second so that in all indoors lighting situations, the camera will only see black, with pinpoints of light for the LEDs. I'm sure I had a point when I started writing this message.
|
|
|
|
|