Modifications for OpenCV 3.0