Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Point2F assign problem

hi there,

as I know if I want to assign some number to the mat I would type

Mat C = (Mat_<double>(3,3) << 0, -1, 0, -1, 5, -1, 0, -1, 0);

just as like the document.

but now i want to assign some number to the Point2f,

when the codes are:

Mat testMat =(Mat_<Point2f>(1,5) << (5,1),(4,2),(3,3),(2,4),(2,5));

cout returns : [1,0,2,0,3,0,4,0,5,0]

when I typed

Mat testMat =(Mat_<Point2f>(1,5) << 5,1,4,2,3,3,2,4,2,5);

cout returns :[5,0,1,0,4,0,2,0,3,0]

I don't like the 0 and i want to assign value to it and make the cout like

[5,1,4,2,3,3,2,4,1,5]

how do i assign value to y ?

Point2F assign problem

hi there,

as I know if I want to assign some number to the mat I would type

Mat C = (Mat_<double>(3,3) << 0, -1, 0, -1, 5, -1, 0, -1, 0);

just as like the document.

but now i want to assign some number to the Point2f,

when the codes are:

Mat testMat =(Mat_<Point2f>(1,5) << (5,1),(4,2),(3,3),(2,4),(2,5));

cout returns : [1,0,2,0,3,0,4,0,5,0]

when I typed

Mat testMat =(Mat_<Point2f>(1,5) << 5,1,4,2,3,3,2,4,2,5);

cout returns :[5,0,1,0,4,0,2,0,3,0]

I don't like the 0 and i want to assign value to it and make the cout like

[5,1,4,2,3,3,2,4,1,5]

how do i assign value to y ?