OpenCV 3.0 adaptation