title: Javascript: How to convert opencv mat to tensor?
body: <p>Does anybody know how to convert an opencv.js mat into a tensor so I can feed it into my tensorflow.js classifier?</p>
  <p>The following code shows what I did to read in and preprocess the image I want to classify:</p>
  <pre><code>img_array = cv.imread(document.getElementById('picture1'), cv.IMREAD_GRAYSCALE);
  cv.cvtColor(img_array, img_array, cv.COLOR_RGBA2GRAY);
  let dsize = new cv.Size(100, 100);
  cv.resize(img_array, img_array, dsize);
  </code></pre>
  <p>My classifier needs a tensor of shape (1, 100, 100, 1) as an input and I do not know how to convert the cv mat into a tensorflow.js tensor.</p>