OpenCV is a powerful tool and although alot of things are now in Cpp there are still some functions that remain in C therefore I provide an example of C/Cpp code generally I try to use vectors a lot in my code so that is the Cpp reference of course you can use an array off the heap if that is more suited to your codeing style.