Capture, image processing, action.... with a kind of GetPixels?

I would like to be able to retrieve an image of the scene taken by a camera :video_camera: and then do some processing on that image/pixels that will generate an action. :checkered_flag:

In your opinion, do we already have everything we need at hand to do this and how do we do it?
Or what would be the best way to proceed by creating new components by programming via script, lua, C++?