title: OpenCV 3.0.0 Mat.push_back for vector line
body: <p>I want to procedurally build an <code>OpenCV</code> <code>Mat</code> line by line using the <code>push_back</code> function.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdbool.h&gt;
  #include &lt;opencv2/core.hpp&gt;
  #include &lt;opencv2/highgui.hpp&gt;
  
  using namespace std;
  using namespace cv;
  
  int main(){
      Mat matrix(1,3,CV_8UC1);
      vector&lt;unsigned char&gt; line(3,1);
      matrix.push_back(Mat(line,true).t());
      return 0;
  }
  </code></pre>
  
  <p>This returns the following error</p>
  
  <pre><code>OpenCV Error: Assertion failed (DataType&lt;_Tp&gt;::type == type() &amp;&amp; cols == 1) in push_back, file /usr/local/include/opencv2/core/mat.inl.hpp, line 1071 terminate called after throwing an instance of 'cv::Exception'
  what():  /usr/local/include/opencv2/core/mat.inl.hpp:1071: error: (-215) DataType&lt;_Tp&gt;::type == type() &amp;&amp; cols == 1 in function push_back
  </code></pre>
  
  <p>I've guaranteed the types are equal by calling <code>type()</code> for each matrix and I could use <code>push_back(Mat(line,true))</code> (no matrix transposing), but the result was an added column</p>
  
  <pre><code>[1;
  1;
  1;]
  </code></pre>
  
  <p>The error seems to imply that I can only add elements column by column(<code>cols == 1</code> bit), but the method description says it adds elements to the bottom of the matrix (implying it adds lines)</p>
  
  <p>Is there any workaround to this situation, or that's the way is has to be?</p>