OpenCV C ++ and cvSmooth

Does anyone know what might be the problem:

cvSmooth(origImage, grayImage1, CV_BLUR,3); 

I got an error:

 error: cannot convert `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); 

Everything worked fine. capture is carried out from the laptop camera (in real time).

+1
c ++ c opencv
Mar 27 '11 at 2:44 p.m.
source share
2 answers

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

I suggest you take a little time to read the introduction .

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

+9
Mar 27 '11 at 3:00 p.m.
source share

Be careful not to mix the OpenCV 1.x API (CvArr) with the 2.x API (cv :: Mat). I think you tried an example from somewhere.

+2
Mar 27 2018-11-11T00:
source share



All Articles