Convert MatOfKeyPoint to bytes[] and converse
Hi, I need to convert MatOfKeyPoint to bytes[] and converse in OpenCV Java.
Does anyone have experiment with it before?
I really need it.!!!!
Thanks!
might work the usual way:
Thank berak for your answer. But when I used it, I got the other issue.
Mat data type is not compatible at: m.get(0,0, bytes);
apologies, did not actually test it ;(
this would work:
but iirc(SO) - you wanted to save it to a database, and byte[] is required, correct ?
so, i'm a bit at loss, what to do. ;(
Yes, I use SerializationUtils.serialize(data) to convert to byte[]. But I got Mat data type is not compatible again at : m.put(0,0,data ); when I pass float[] to this fucntion:
MatOfKeyPoint mat = new MatOfkeyPoint(); ...... mat.put(0,0,data);
yes true, new MatOfkeyPoint() does not allocate any data, so you can't put() anything (whatever type)
Great!!! Thanks for your support.