SVM in OpenCV: Visual Studio 2008 reported error wrongly (or is it right?)

Posted by Risa on Stack Overflow See other posts from Stack Overflow or by Risa
Published on 2012-03-21T17:25:25Z Indexed on 2012/03/21 17:30 UTC
Read the original article Hit count: 425

Filed under:
|
|
|

I'm using MS Visual Studio 2008, OpenCV, C++ and SVM for a OCR-related project. At least I can run the code until yesterday, when I open the project to continue working, VS reported this error:

error C2664: 'bool CvSVM::train(const CvMat *,const CvMat *,const CvMat *,const CvMat *,CvSVMParams)' : cannot convert parameter 1 from 'cv::Mat' to 'const CvMat *'

It didn't happen before and I haven't changed any code relating to it (I only changed the parameters for the kernel).

The code got error is:

Mat curTrainData, curTrainLabel;
CvSVM svm;
.
.
.
svm.train(curTrainData, curTrainLabel, Mat(), Mat(), params);

If I hover on the code, I still got this tip: image.

Which means my syntax isn't wrong. So why do VS bother to report such an error?

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-studio-2008