SVM in OpenCV: Visual Studio 2008 reported error wrongly (or is it right?)
- by Risa
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?