Changing OpenCV C++ to C