how to print out (display) a matrix [closed]
i create a matrix like this double a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
CvMat Ma=cvMat(3, 4, CV_64FC1, a);
and i want to print out (display) this matrix but i cant i look for on the internet and learning opencv but i cant find a procedure for print out matrix please help me about 1 day i confuse
(not an answer, more a hint, if you'd switch to the c++ api instead, peace of cake) :
cout << Ma << endl;
how i can switch to c++ , when i write cout my visual produce error
need to include iostream, also
using namespace std;
thanks alot
when i write this code visual produce error
include <iostream>
include<core\core_c.h>
include<core\types_c.h>
include <highgui.h>
include <conio.h>
using namespace std;
int main()
{ int b; double a[] = { 3, 3, 3, 3, 3, 3, 7, 8, 9, 10, 11, 12 };
CvMat Ma=cvMat(3, 4, CV_64FC1, a);
cout<< Ma << endl; cin>>b; return(0);
} why???????/
CvMat, IplImage === c-api. cv::Mat === c++; cv::Mat != cvMat
really, stick with the c++ api, the old c one won't be supported for long
ok because i start learning opencv with learning opencv book and this book is for c api do u know a book or site learning opencv with c++???????
yes, the book is nice, still maybe look at the cpp samples in your opencv folder.
and ofc, the tutorials