Saturday, January 27, 2007

Fun with LEDs and pattern recognition...

Having nothing much to do today, I connected a bunch of LEDs to my computer's parallel port. I've written a little program which uses a webcam to recognize color patterns, I create, by making colored dots on a sheet of paper. If I make a sequence like, red - yellow - red, the computer will recognize it as a binary 101 (red = 1, yellow = 0). So, it will turn on the LEDs in the sequence: ON OFF ON. Well, I guess this thing doesn't have much practical use. However, its fun because it feels as if I'm visually communicating with the computer in some way! I find this really interesting. Check out the videos above. :)

Sunday, January 21, 2007

Parallel port relay for playing with real world gadgets!

I've finally connected a relay to my parallel port! I got the circuit design from here. I can use the relay to control almost anything in my house. I have combined it with my gesture recognizer to allow me to control things with a laser pointer! Its fun. Using this with motion detection could also be a good idea. The computer would turn on lights whenever it senses motion. Anyway, check out the video above. I'm controling a table lamp with my computer.

I guess I could've connected upto eight relays, but I wanted to keep it simple. Besides, I might end up using a bluetooth relay board later on (or maybe even X10). :)

Monday, January 15, 2007

Real-Time Color Based Object Tracking

I have been trying to track moving objects for quite some time. I wasn't very successful in modifying my motion detection code to perform motion tracking because shadows were really making life difficult for my program. The program was having difficulties distinguishing the actual object from its shadow. So, I went for a different approach: "color based object tracking". Here's how it works. After the program captures an image from the webcam, it introduces it to a mean filter which causes the image to become blurred. This blurring is done to reduce noise from the image. After doing that, it uses an RGB filter to remove all objects from the image except the object to be tracked (I have to adjust the RGB filter manually for different objects). Then, to make life easier, the program thresholds the image. Thresholding turns the image into a 1-bit binary image. Check out the picture below:

Then, after performing some additional noise removal, it tries to determine the center of the object. See the picture below:

That's it! It's pretty simple, but I had to spend two days experimenting and testing this idea. Check out the video above to see this program tracking a yellow ball. I can't wait to hook this thing up with my floppy drive camera panner! It would be so much fun. :)

Saturday, January 13, 2007

Defcon Bots

I've been busy over the last couple of days working with my friend, Colin Karpfinger in building a computer controlled, autonomous shooting robot for the DefconBots competition. The robot basically has to identify and and shoot down targets in a shooting gallery. Colin is a really smart guy and he has already created a servo motor based pan/tilt assembly for moving the gun! You'll find some videos here. Now, he's planning to connect a relay to his parallel port which will trigger an electric airsoft gun. Awesome, isn't it?

Friday, January 12, 2007

Tinkering with electronics...

With nothing important to do today, I built a simple 555 astable circuit which flashes an LED. I replaced the 220k resistor (R2) with an LDR. This way, I got an astable which changes frequency in response to light intensity. Fun. :)

Tuesday, January 09, 2007

Laser Gesture Recognition: Article and code

Hello readers,

Some of you had asked me to release the source code of the laser gesture recognition program I made. Well, here it is: Yes, I decided to release it in the form of an article. The source and demo project are included in the article. Check it out.

EDIT: Fixed broken link