I’m fetching some images via HTTP:
val ostream = new ByteArrayOutputStream()
ImageIO.write(imageurl, imageType, ostream)
val istream = new ByteArrayInputStream(ostream.toByteArray)
(it is actually scala, but this code itself using Java libs, so there is no scala specific magic).
Then I’m pushing istream 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):
db = Connection(myserver,myport).DB
fs = GridFS(db)
bytearray = fs.get(id).read()
Given that, how can I create Mat for use in OpenCV functions?
Probably you need imdecode function.