Opencv官方文档中提供的接口类型有c的,也有C++的,其实这两者之间并没有什么区别,或者更精确地说,区别很小,我所知道的只有一个,下面会介绍。
首先,这里是一个关于用C还是C++的问题(http://stackoverflow.com/questions/11376368/opencv-c-and-c-performance-comparison),回答问题的高人表示,这两种接口其实没什么区别(there is not much difference between the C and C++ interface in OpenCV. Actually, some of the code is written in C, and has a C++ wrapper interface, and some viceversa.),并且提供了几个用于提高程序效率的方法:
Advice for optimization
A. Profile your app. Do it first on your computer, since it is much easier. Use visual studio profiler, and see what functions take the most. Optimize them. Never ever optimize because you think is slow, but because you measure it. Start with the slowest function, optimize it as much as possible, then take th