As we all know, the vision processing software of FIRST allows us to find a black ring which is needed to find two round shapes (the vision target), so we have two questions:
a. How can we change the software so we can find a circle of any color?
b. How can we change the software so we can only find the outer circle (not a ring) without the inner round shapes?
Both are supposed to be simple to change the software, as the more complicated functions are already inside (the actual search function).
b. How can we change the software so we can only find the outer circle (not a ring) without the inner round shapes?
a.
The algorithm actually works on a monochrome image – an image with only one byte per pixel. When used on the luminance plane of a color image, it detects edges between bright and dark pixels. In other words, dark blue and bright yellow should work quite well too.
If you wanted to detect red, it might make sense to extract the red plane instead. Or if you have very specific colors, you can build an expression of RGB which will map to large numbers for one color, and small for the other and run the image through that function first. If you have specific colors, please ask if you want assistance.
b.
The algorithm actually find the edge between the light and dark shape. In the FIRST target, there are two edges that the target controls, and possibly more if the target happens to be placed in front of a dark backdrop. If you find multiple circles, you can execute a follow-up step to sample some pixels that intersect the circle. For example, you could use the circle center and radius to extract a line profile from say 90%radius to 110% radius*1.5. You can then examine the pixels just inside and just outside to see which is bright and which is dark.