OpenCV Version 3 compatibility

Tested and works with a bleeding-edge local OpenCV build now.