Robust color detection
Reliably detecting colors can be a challenging task when the shape of the observed object is curved and/or has inconsistent light from all directions. In the photo shown we have dices for which we can say safely that the colors on each side should be very similar. If we were to inspect the RGB colors of left and bottom sides of the first dice (1 and 3) the results would be very different.