Track only colored compact shapes that are surrounded by white color

bart at max (previously BITter)'s icon

Hi all

How to track in a space only colored compact shapes surrounded by white color?

I know how to track persons and colors, now i am searching to track colored compact shapes that only are surrounded by white. How to separated, this compact shapes surrounded by white from the rest of the camera image?

Thanks for tips & tricks!

Details:

I have to track minimum six persons dressed with white t-shirts with a colored form on.

THE SPACE
# white walls
# dimmed light

THE PERSONS
# white t-shirt
# on every t-shirt one colored form (kind of triangle, square, circle)

THE TRACKING
# (web)camera
# track and follow the color
# recognize the form

THE STEPS
1 find the white t-shirts (white surroundings)
2 see and follow which color is inside
3 recognize the form
4 action ...