creating Mat with OpenCV in python
<p>I am used to <a href="https://docs.opencv.org/3.4/javadoc/org/opencv/core/Mat.html#%3Cinit%3E(int,int,int)" rel="nofollow noreferrer">Java's implementation of OpenCV</a>. I want to create a <code>Mat</code> structure, fill data into it, extract a <code>submat</code> and then apply some image transform. In Java, I use:</p>
<pre class="lang-java prettyprint-override"><code>my_mat = new Mat(my_rows, my_cols, CvType.CV_8U);
my_mat.put(0, 0, my_data);
my_mat.submat(0, my_other_rows, 0, my_other_cols);
</code></pre>
<p>But I didn't find anything working in python's OpenCV. I found this link on the OpenCV forums: <a href="http://answers.opencv.org/question/30037/cv2createmat-in-python/" rel="nofollow noreferrer">cv2.CreateMat in python</a>, <s>but the link is broken</s></p>