Ask Your Question
0

about push_back

asked 2018-03-15 04:06:26 -0600

Weifa Gan gravatar image

the book of learning opencv3 said that m0.push_back( s ) is used to extend an m × 1 matrix and insert the singleton s at the end while m0.push_back( m1 ) is used to extend an m × n by k rows and copy m1 into those rows; Cloud you tell me what's the different between s and m1 in the term of class?Does the singleton means the a single number?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-03-15 04:20:37 -0600

berak gravatar image

updated 2018-03-15 04:42:02 -0600

i have no idea, what they mean with "singleton" there (it's probably just misleading),

but push_back() is quite easy to explain: you add 1 or more rows to the bottom of an existing matrix. like:

1 1 1
1 1 1
  +
3 3 3
  =
1 1 1
1 1 1
3 3 3

it does the same as vconcat(), btw.

the restriction here is, that your newly added line(s) must have the same number of cols as the original Mat (easy to see in the example above i hope!)

edit flag offensive delete link more

Comments

Thanks your explain!

Weifa Gan gravatar imageWeifa Gan ( 2018-03-15 04:25:04 -0600 )edit

see the vconcat example, too !

berak gravatar imageberak ( 2018-03-15 04:41:29 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-15 04:06:26 -0600

Seen: 267 times

Last updated: Mar 15 '18