Quick port to OpenCV 2