I think it would be easier to use the OpenCV file storage facilities for
that. Here's a sample that should help you:
http://tech.groups.yahoo.com/group/OpenCV/message/23544
And then you can copy the content of that XML file in your database, and
reload it with OpenCV again from a temporary file created from data in
your database..
> hist.bins().asByteBuffer(1024);
>
> Just yields garbage..
What you are looking for is probably getByteBuffer(), not asByteBuffer()..
> Also, how would I go _back_ from something like a ByteBuffer to a
> CvArr (or rather, CvMat)?
There's a factory method for that:
CvMat cvMat(int rows, int cols, int type, Pointer data)
Samuel