On board Image Processing

Hi guys, I need some help or advice. I’m working on a project that requires on-board image processing in real time. I have the setup of Navio+ and Raspberry Pi 2 with a Raspberry Pi camera module. I’m struggling with adding the OpenCV library into Ardupilot.
I know that compiling OpenCV project needs adding flags in make file. So, adding a new class in the library is not enought. And that’s where I stuck. Anyone can give some ideas??

Use the waf build system. It has support for detecting if library is available/supported.

However IMO it would make more sense to have the vision processing in another process that communicates with ardupilot rather than bundling everything together.

Thanks for your advise. I have thought about having another processing running parallel on Raspberry Pi that can communicate with Ardupilot, but I don’t know how to make two programs communicate. Do you know any existing library that can do this task?