Visual tracking system

My project will use two perpendicular servos for pointing a targeting laser on a moving object.

The project began all in software by using a generic web cam driver. A 320x240 pixel greyscale image can be downloaded from the camera by USB. I can do this in VB or Labview. The image processing algorithm is simple, just take the set of all pixels from one frame and subtract it from the set of all pixels in the next frame. Anything that moved between frames will show up as nonzero values, the rest is zero. Then just map the pixels into (theta) and (phi) polar and azimuthal angles and tell the srevos to point there.
The servos will hold a regular pen-type laser pointer for now. Imaging the look on a traspassers face if he’s sneaking around at night and all of the sudden a laser spot is shining on him, and follows anywhere he moves! Future generation may include attaching an electrically driven airsoft pistol too. Then it can fire plastic BBs at its target.
I just ordered the servos and the controller today. I’ll interface them with RS232, which is a breeze in VB or Labview. Later, I might want to make it compact and portable, but I haven’t figured out how to make a PIC MCU read the image from the webcam. Anyone have suggestions?

Your project sounds very cool, the sort of thing most of us would think about, but never take the time/effort to actually build. Actually in my fantasy version, the camera has face tracking/identification, so it aims at people’s faces that aren’t mine! (like that Deep Space 9 episode where the security system is shooting at everyone who isn’t a Cardassian, and Gul Dukat is all calm walking around and gets a cup of tea…anyone, anyone?)

Anyway, I don’t think you’re going to have any luck getting a PIC to interface with a webcam, unless it uses some crazy simple protocol like sending an ordered list of uncompressed pixel intensities.

If you’re not afraid of getting into ARM microcontrollers (I am, but I suppose I will eventually), You might consider looking into the CMUcam. It’s a 352x288 board-mounted color camera interfaced with a couple of microcontrollers for embedded vision processing. It’s totally open-source, and there’s a lot of tools and code out there for them (specifically, I’ve seen one used with an angled laser pointer as a rangefinder).

Also, if you’re looking for a servo-pan/tilt, you should check out the ones at Servocity. I just ordered the SPT200 for a camera tracking system (hasn’t arrived yet though) so I can give an idea of the quality, but they look very nice! Their full servo speed pan/tilt tables support up to 2lbs (all depends on the servos you get to run it), and they also have a range of down-gearing options for more power. You can mix and match!

Anyway, good luck with the project, and please post more as you go along!