Controlling a character using a webcam via Max

Hello there,

As a university project i need to make an interactive game, my plan is to connect a webcam to unreal using Max and then have the players movements controlled by placing different colours underneath the webcam. Does anyone have any idea on how to achieve this? I would like to do a quick style game so the character would move to a square and a question would pop up and then by putting the corresponding colour under the webcam the character will move to the next square.

Thanks in advance!