Ricardo,
We needed to wait for a new modue to be launched to handle this one (i.e. the Sample Color module). Basically one way to do this is to
1. detect the upper and lower part of the line by looking for dark blobs.
2. determine the midpoint between those two line parts, that should approx be where the tape is assuming its the tape that split the line.
3. sample the color in that area and check to see if it is nearest to gray, green, etc.
4. react accordingly.
We attached a sample script that does just that except for #4. Basically you would use the information contained in SAMPLE_COLOR_NEAREST to determine what colored tape you are looking at. Note that even though the gray tape is reflective it is still closer in color to gray as apposed to green. Hopefully this gets you started in the right direction. Also note the use of a double flood fill. This is intentional to gradually bias the colors in the right direction.
Note that it appears to work on your attached images. If you find more that don't please post them here.
STeven.
program.robo
|
|