Hello
After a keypoints detection, I would like to save the keypoints (KeyPointVector) and descriptors (Mat)
currently using version 1.3.1
I tried to do like that (sorry if I am very wrong) - getImageDescriptors() returns my descriptor org.bytedeco.javacpp.opencv_core$Mat[width=61,height=591,depth=8,channels=1]
FileStorage fs = new FileStorage("./kp.xml",FileStorage.WRITE);
fs.writeObj("data", getImageDescriptors());
fs.close();
But I get OpenCV Error: Bad argument (Unknown object) in cvWrite, file C:\projects\bytedeco\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.1.0\modules\core\src\persistence.cpp, line 5000
I have no issue if I use fs.writeObj("data", new Mat());
Am I complely wrong ? or is there a better way to deserialize / serialize that ?
Thanks a LOT !
Does the same thing work in C++?
Actually I don't know. :-s
Anyway, one good night of sleeps and things get easy and working :
FileStorage fs = new FileStorage("./kp.xml",FileStorage.WRITE);
org.bytedeco.javacpp.opencv_core.write(fs, "desc", getImageDescriptors());
org.bytedeco.javacpp.opencv_core.write(fs, "kp", getImageKeypoints());
fs.release();
And I am getting
<?xml version="1.0"?>
<opencv_storage>
<desc type_id="opencv-matrix">
<rows>591</rows>
<cols>61</cols>
<dt>u</dt>
<data>
160 23 0 0 128 1 8 70 223 255 128 139 199 129 255 119 0 0 0 0 0 15 0
Sorry for the questions, but did not find any javacv example, and was really stuck after a while ...
Thanks
Awesome. Please consider contributing a small sample for that! Thanks
https://github.com/bytedeco/javacv/tree/master/samples
Most helpful comment
Actually I don't know. :-s
Anyway, one good night of sleeps and things get easy and working :
And I am getting
Sorry for the questions, but did not find any javacv example, and was really stuck after a while ...
Thanks