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 the second slower.
B. First, focus on algorithms. A faster algorithm can improve performance with orders of magnitude (100x). A C++

C与C++在OpenCV中的接口在性能上几乎没有区别,主要差异在于设定ROI时的行为不同。C接口将ROI视为独立图片,而C++接口会参考原图。优化建议包括:先进行性能分析,关注算法优化,减小图像尺寸,使用简单操作,限制计算区域,避免不必要的类型转换,利用NEON指令集等。

4617

被折叠的 条评论
为什么被折叠?



