1 | initial version |
first, please do not use CvMat, IplImage or anything from the deprecated opencv1.0 c-api. please stick with cv::Mat and c++.
then, neither example probably does , what you want. before you can set values of a Mat, you have to allocate memory, like:
Mat m(3,3,CV_8U);
m.setTo(Scalar::all(17));
or, all in one go:
Mat m(3,3,CV_8U,Scalar::all(17));
(and again, you should ignore the 1st example entirely, it is no more valid today)
please also have a look at the tutorials