Using information from a webcam

Hi,

Im not sure if this is the right forum but here it goes. I am developing a game that uses real time information taken from a webcam and uses that in game. Basically, the webcam looks at a table with lego pieces on that corresponds to the in game inventory, as things are made on the table, things are made in the game. I was just wondering if this real time link between the webcam and the game would be possible to implement in Unity and if so how?

Cheers

You can use this for your task: