Updated OpenCV example to use C++ API