Compatibility with OpenCV < 3.0