C与C++在opencv中的区别

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值