Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2016-08-16 12:15:22 -0600

Nbb gravatar image

Convert vector<point> to Mat with 2 columns

How can I do the following ? I tried it below but my matrix is of size 2 rows and 1 column. Its supposed to be 2 rows and 2 columns

vector<Point2d> Crds;

Crds.push_back(Point2d(1, 1));
Crds.push_back(Point2d(2, 2));

Mat crd = Mat(Crds);
cout << crd.cols << endl << endl;

cout << crd << endl;