OpenCV C++ and cvSmooth
Anyone know what could be problem:
cvSmooth(origImage, grayImage1, CV_BLUR,3);
I received error:
error: cannot co开发者_JAVA技巧nvert `cv::Mat' to `const CvArr*' for argument `1' to `void
cvSmooth(const CvArr*, CvArr*, int, int, int, double, double)'
If I use:
cvtColor(origImage, grayImage, CV_BGR2GRAY);
All worked fine. capturing is from laptop camera(realtime).
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.
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.
Be careful not to mix the OpenCV 1.x API (CvArr) with the 2.x API (cv::Mat). I guess you tried an example from somewhere.
精彩评论