Camera

Hi, I have a uni project to design a traffic light system off a beagle
board, now Im thinking of using GPIO for my LED's and buttons, trick
comes in with the camera, we have to integrate a camera that will take
a snap if a sensor is triggered while a light is red, I thought of
using usb to connect the camera to the board for simplicity, is this
the most viable option? any ideas? also what would be the best
language to write all the code in, I am thinking C would probably be
best? I think so far the most challenging things would be getting the
webcam to take the snapshot, is it possible for me to use a utility
like cheese webcam booth (possibly running continuously and takes
picture when sensor is activated) if it would be any ideas what I
shold be looking for in terms of coding this! any help would be
appreciated.