Following the Yellow Brick Road

hsvImageOutputYellow1

No, not that one!

Although colour detection worked well with a plain black background the challenge is not going to be so simple. The walls and floor although painted a uniform black will reflect a limited amount of background light. In addition as the walls are 30 cm and the coloured balls 10 cm off of the ground the Pi Camera will see something over the top of the wall. Depending on the colour of the trousers of the spectators there may well be shades of red, blue, yellow and green that may cause the current openCV Python algorithms to get confused.

This is illustrated with the following test, where the floor, like a background image over the wall, contains a large amount of yellow in it.

bgrImage5

hsvImageOutputRed6

hsvImageOutputGreen8

 

hsvImageOutputBlue7

The images above show that although it handles red, blue and green clearly. The yellow is a problem as the floor (background light substitute) is larger area than the marker and the algorithm looks for the contour with the largest area.

These may not be issues on the day if the camera is at the right angle as not to see over the wall too much and the black background does not reflect too much red, blue or green light, but this will need some more thought to make our algorithm more reliable.

Leave a comment