Modifications for OpenCV3.0