Are you referring to calculating distance using a method similar to the one described
here (by Kevin Watson)? It seems like it should be fairly easy to use the same tracking algorithm as you did for one color, but just find an average of the green and pink positions to find the center of the target, and then run your tracking algorithms off of that. You say you can do it with one color, so I won't bother going into the details of the visual servoing or distance calculation tasks.
However, this seems trivial enough that I'm wondering if you are referring to something else. Can you provide more detail?
--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor