Why do some of the functions in the OpenCV C++ interface have struct declarations in them?
new to c++ interface i saw these two similiar/same functions on this page
http://docs.opencv.org/modules/ml/doc/support_vector_machines.html?highlight=cvsvm#bool%20CvSVM::train%28const%20CvMat%20trainData,%20const%20CvMat%20responses,%20const%20CvMat%20varIdx,%20const%20CvMat%20sampleIdx,%20CvSVMParams%20params%29
under the CvSVM::train heading
C++:
bool CvSVM::train(const Mat& trainData, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), CvSVMParams params=CvSVMParams() )
C++:
bool CvSVM::train(const CvMat* trainData, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, CvSVMParams params=CvSVMParams() )
they are the same but one uses the 'const Mat& ' and the other CvMat* Im writing a wrapper for opencv and I was wondering if, to make it complete would I need to include all the C structs ...or can C++ use the C structs or is CvMat and other structs both C and C++...I was under the impression that C++ used classes and C structs in opencv but if someone could shed light on this I would appreciate that....Also in the opencv cpp samples folder letter_recog.cpp there is alot of CvMat* in it....is that code just old and hasnt been updated yet. Opencv doc. says CvMat is deprecated so of the two above functions I guess i would just use the const Mat& one right and assume OpenCv documentation though posted on website is still maybe a bit "in proccess" . Any light shed on these queries is much appreciated
Actually I think you are pointing out the largest problem in current modules, being the ML module. It is the last module that still contains the old C - API wrapped with C++ wrappers, instead of a completely remaked C++ interface. Being patient is the only way to go. And indeed, many of the samples have still C - style structs and functions, but that is because there isn't a decent C++ wrapper system yet.