Ask Your Question
0

Point2F assign problem

asked 2016-05-26 04:42:59 -0600

gino0717 gravatar image

updated 2016-05-26 04:46:26 -0600

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 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 ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2016-05-26 04:51:35 -0600

LBerger gravatar image

updated 2016-05-26 04:52:07 -0600

like this

Mat testMat =(Mat_<Point2f>(1,5) << Point2f(5,1),Point2f(4,2),Point2f(3,3),Point2f(2,4),Point2f(2,5));
edit flag offensive delete link more

Comments

thank you!

gino0717 gravatar imagegino0717 ( 2016-05-26 04:52:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-26 04:42:59 -0600

Seen: 652 times

Last updated: May 26 '16