View Single Post
  #43   Spotlight this post!  
Unread 10-01-2007, 18:19
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Post Re: 2007 Default Code?

Quote:
Originally Posted by Mike Copioli View Post
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 View Post
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 View Post
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 View Post
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 View Post
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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org