Image Processing (Webcam to Input)


I am working on a projekt, where I use a webcam to capture a frame on userinput and convert it to some x/y coordinates. (working in AS3 xD)
Now I want to test it in an actual 3D game. (Some kind of extended railgun shooter with lightgun support)

Is there(how) a possibility to capture a webcam frame and process inside unreal? (Though itshould be reasonably fast) Or what other possibilitys do i have to get those coordinates into my game?