title: Use of java image in pythonic OpenCV
body: <p>I'm fetching some images via HTTP: </p>
  
  <pre><code>val ostream = new ByteArrayOutputStream()
  ImageIO.write(imageurl, imageType, ostream)
  val istream = new ByteArrayInputStream(ostream.toByteArray)
  </code></pre>
  
  <p>(it is actually scala, but this code itself using Java libs, so there is no scala specific magic).<br>
  Then I'm pushing <code>istream</code> to database (in my case it is GridFS, which is a part of MongoDB).
  And now I need to use it image (bytearray) in OpenCV (w/ python bindings): </p>
  
  <pre><code>db = Connection(myserver,myport).DB
  fs = GridFS(db)
  bytearray = fs.get(id).read() 
  </code></pre>
  
  <p>Given that, how can I create <code>Mat</code> for use in OpenCV functions?</p>