Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

opencv #c #c++

click to hide/show revision 2
No.2 Revision

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++: )

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

opencv #c #c++

click to hide/show revision 3
No.3 Revision

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

opencv #c #c++

click to hide/show revision 4
retagged

updated 2013-11-21 02:32:32 -0600

berak gravatar image

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