Quote:
Originally Posted by Mike Copioli
Kevin, There seems to be some confusion about this years camera code. At the kickoff we were all told that this years camera code could support multiple targets. Is this the case? And if so. How?
|
Dave was referring to code written by FIRST engineering staff and included with EasyC.
Quote:
Originally Posted by Mike Copioli
The code on your repository appears to be no different than last years.
|
The existing code already does much of the work for you. A lot of information about the state of the "rack" can be backed out of the dimensions of the blob (x1, y1, x2, y2), the blob's center of mass (mx, my), Number of color-matching pixels (pixels) and the ratio of color-matching pixels to total number of pixels (confidence) returned in the camera's t-packet. Have a look at terminal.c for a way to access the t-packet information when it arrives.
Quote:
Originally Posted by Mike Copioli
Does the new code independantly track multiple centroids?
|
The camera cannot track multiple objects that are in view. FIRST's code does not track multiple lights.
Quote:
Originally Posted by Mike Copioli
Or does it average the independant targets to produce one centroid?
|
The camera returns a rectangle that includes both lights, one on the left, the other on the right, and the center of mass somewhere in between. This information alone will tell you if one or two lights are visible as a single light will only light-up about ten pixels from the starting area.
Quote:
Originally Posted by Mike Copioli
From the above statement it appears that the only way to differentiate between multiple and isolated targets is by the number of pixels. If two targets are "seen" by the camera, how do you direct the camera to select one of the targets?
|
One way is to rotate the camera until only one light is visible.
I have a few algorithms that can be used to derive the information you seek, but I'm not sure how much of the problem I should solve for teams. I've asked for guidance from the GDC on how to proceed. Until then, I'd really like to see some open discussion about this problem because it's a fun problem with a few possible solutions.
-Kevin