Ask Your Question


asked 2013-04-01 21:23:07 -0500

wsc36305 gravatar image

updated 2015-10-21 07:33:58 -0500

Here i have some trouble with the method of Mat,which is Mat::push_back() I have two groups of float numbers,and i want to push_back them into a CV_32FC2 Mat. But i don't known how to push_back two float numbers into the CV_32FC2 Mat,and I want to get the data with Mat,j)[0] and Mat,j)[1],Could anybody help me?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-02 04:47:32 -0500

Daniil Osokin gravatar image

Hi! You can do it with Vec2f:

Vec2f pair = Vec2f(firstFloat, secondFloat);

// dst is a CV_32FC Mat

For access use:<Vec2f>(rowId)[0]
Also, check this answer "Working with pixels".

edit flag offensive delete link more

Question Tools


Asked: 2013-04-01 21:23:07 -0500

Seen: 2,212 times

Last updated: Apr 02 '13