Ask Your Question
8

Concatenating matrices

asked 2012-08-10 12:04:25 -0600

gp gravatar image

Hello everyone,

I am starting using opencv, I would like to ask if there are functions to concatenate matrices, e.g. (matlab notation):

given matrices A = [1,2,3; 4,5,6], and B = [11,22,33; 44,55,66], I would like to produce the matrix H = [1,2,3,11,22,33; 4,5,6,44,55,66] (horizontal concatenation), and the matrix V = [1,2,3; 4,5,6; 11,22,33; 44,55,66] (vertical concatenation)

does openCV provide me the way to do it easily?

Thanks a lot for your kind help, GP

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
13

answered 2012-08-10 12:43:17 -0600

updated 2012-08-10 12:46:09 -0600

Yes, you can do it very easily using OpenCV:

Mat A, B;
... //initialize the matrices

Mat H, V;
hconcat(A, B, H);
vconcat(A, B, V);
edit flag offensive delete link more

Comments

Is there any documentation for those functions?

Michael Burdinov gravatar imageMichael Burdinov ( 2012-08-10 16:21:13 -0600 )edit
1

No, they are not documented. There is an open issue about this: http://code.opencv.org/issues/1215

Ilya Lysenkov gravatar imageIlya Lysenkov ( 2012-08-11 10:14:54 -0600 )edit

I see. Thanks.

Michael Burdinov gravatar imageMichael Burdinov ( 2012-08-11 16:19:33 -0600 )edit

Hey,

Is there a similar command that I can use to concatenate two IplImages or for CvMat structure.

cvuser1377 gravatar imagecvuser1377 ( 2014-04-02 04:34:59 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2012-08-10 12:04:25 -0600

Seen: 45,679 times

Last updated: Aug 10 '12