get code working for OpenCV3