Reputation: 1469
I have extracted the SIFT feature descriptors in OpenCV.. Next step to me is to train an SVM but before that step, I think I need to save the extracted features in a file, in order to train these features...
So my questions are: 1- how to save these matrices? 2- I would like to know what to do about the features, I extracted features for one image, but I need to extract features for many images in different pose for one object (e.g cola) and save them in one file...
Do you have any idea, how to do that in opencv?
Thank you...
Upvotes: 2
Views: 4271
Reputation: 14011
If you would like to save an OpenCV Mat to file have a look at the FileStorage class they provide. For your purposes it might look something like:
FileStorage fs("features.yml", FileStorage::WRITE);
Mat colaFeaturesXYZ;
// compute SIFT features vectors to colaFeaturesXYZ;
fs << "cola_pose_xyz" << colaFeaturesXYZ;
If you want to store these features in a database for later searching you might consider having a look at the bagofwords_classification.cpp sample provided by OpenCV. This may have all the functionality you are looking for.
Upvotes: 6