Read a binary descriptor file to cv::Mat
I have a binary file which includes ORB descriptor. I need to read it to a cv::Mat
so I can use it for further detection. FileStorage
only handles XML and YAML file. How can I read the file?
please explain "binary descriptor file".
@berak, it's just an ORB descriptor written to a binary file.
I guess you have writen it to the binary file, then the other way around should be quite identical. Can you provide the way you stored them?
@StevenPuttemans, I didn't do that. Somebody else has done it.
Well, afaik it all depends how the binary descriptor was written away. If you have no idea about that, I think it is nearly impossible to reconstruct the binary data...
@StevenPuttemans, thanks a lot. But one question: Is it possible to write an ORB descriptor to XML or YAML file? What would you do if you had to save an ORB Descriptor to a file and read it later on?
yes it can be done using serialization included in OpenCV, just look for the FileStorage interface right here. Just create your model, then write it to the file using the assignment operator.