Log in

View Full Version : How do you track multiple blobs of the same color?


EHaskins
04-01-2009, 20:25
From the C++ APIs how do you get an array of color particles in the image. The FindColor() function, which is what is demonstrated in the demos, only returns the largest particle.

I read the API Docs, but I didn't find an easy way to get all of the particles.

Pat Fairbank
04-01-2009, 22:01
The easiest thing to do would be to modify the WPILib code. You could modify the GetLargestParticle function in TrackAPI.cpp to return, say, the three largest particles, and then modify FindColor to return particle analysis reports for all three.

Personally, though, I'm planning to have my team completely rewrite the camera stuff to better suit this year's purposes, and to use C++ classes.

EHaskins
05-01-2009, 01:37
Personally, though, I'm planning to have my team completely rewrite the camera stuff to better suit this year's purposes, and to use C++ classes.

I was afraid I'd have to do that. It sounds better than hacking apart the WPI code, but I was hoping there was something I missed.