OpenCV的C ++和cvSmooth [英] OpenCV C++ and cvSmooth

查看:499
本文介绍了OpenCV的C ++和cvSmooth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道这可能是问题:

Anyone know what could be problem:

cvSmooth(origImage, grayImage1, CV_BLUR,3);

我收到的错误:

error: cannot convert `cv::Mat' to `const CvArr*' for argument `1' to `void 
cvSmooth(const CvArr*, CvArr*, int, int, int, double, double)'

如果我使用:

cvtColor(origImage, grayImage, CV_BGR2GRAY);

所有工作的罚款。捕获从笔记本电脑摄像头(实时)。

All worked fine. capturing is from laptop camera(realtime).

推荐答案

CV ::垫是的OpenCV的C ++版本的新结构。 cvSmooth()是从旧的C API。不要与C混合C接口++!

cv::Mat is a new structure from the C++ version of OpenCV. cvSmooth() is from the old C API. Do not mix the C interface with the C++!

我会建议你花一点时间来阅读引进

I'll suggest that you take a moment to read the introduction.

另外,如果你检查 OpenCV的/模块/ imgproc / src目录/ smooth.cpp 你会看到 CV :: boxFilter() cvSmooth(CV_BLUR)新的C ++接口上的等价物。

Also, if you check opencv/modules/imgproc/src/smooth.cpp you'll see that cv::boxFilter() is the equivalent for cvSmooth(CV_BLUR) on the new C++ interface.

这篇关于OpenCV的C ++和cvSmooth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆