OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Sun, 02 Feb 2014 08:11:13 -0600adding a row to a Mat matrixhttp://answers.opencv.org/question/27590/adding-a-row-to-a-mat-matrix/
Hi!I am using opencv and c++. I am trying to add a row of 1's in the last row of a matrix. When I display the matrix of the Mat object in command line,it displays everything like this http://i.imgur.com/JFb49of.jpg,where (55,118) is the first coordinate obtained,(24,56) is the second coordinate and (52,26) is the 3rd coordinate. What I need is a matrix which is displayed column wise where (55,118),(24,56) and (52,26) are displayed column wise with their last rows having a 1. My problem is I cannot get the formatting right. Can anyone help please?ThanksSat, 01 Feb 2014 21:50:21 -0600http://answers.opencv.org/question/27590/adding-a-row-to-a-mat-matrix/Comment by Nghia for <p>Hi!I am using opencv and c++. I am trying to add a row of 1's in the last row of a matrix. When I display the matrix of the Mat object in command line,it displays everything like this <a href="http://i.imgur.com/JFb49of.jpg,where">http://i.imgur.com/JFb49of.jpg,where</a> (55,118) is the first coordinate obtained,(24,56) is the second coordinate and (52,26) is the 3rd coordinate. What I need is a matrix which is displayed column wise where (55,118),(24,56) and (52,26) are displayed column wise with their last rows having a 1. My problem is I cannot get the formatting right. Can anyone help please?Thanks</p>
http://answers.opencv.org/question/27590/adding-a-row-to-a-mat-matrix/?comment=27593#post-id-27593Transpose the matrix before adding the row?Sun, 02 Feb 2014 03:47:54 -0600http://answers.opencv.org/question/27590/adding-a-row-to-a-mat-matrix/?comment=27593#post-id-27593Answer by FLY for <p>Hi!I am using opencv and c++. I am trying to add a row of 1's in the last row of a matrix. When I display the matrix of the Mat object in command line,it displays everything like this <a href="http://i.imgur.com/JFb49of.jpg,where">http://i.imgur.com/JFb49of.jpg,where</a> (55,118) is the first coordinate obtained,(24,56) is the second coordinate and (52,26) is the 3rd coordinate. What I need is a matrix which is displayed column wise where (55,118),(24,56) and (52,26) are displayed column wise with their last rows having a 1. My problem is I cannot get the formatting right. Can anyone help please?Thanks</p>
http://answers.opencv.org/question/27590/adding-a-row-to-a-mat-matrix/?answer=27598#post-id-27598I think you need to transpose the matrix , Check [this](http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#transpose)Sun, 02 Feb 2014 08:11:13 -0600http://answers.opencv.org/question/27590/adding-a-row-to-a-mat-matrix/?answer=27598#post-id-27598