Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

it's actually simple. In order to save your keypoints

 vector<Keypoint> mykpts;
 FileStorage fs("keypoints.yml", FileStorage::WRITE);
 write( fs , "aNameYouLike", mykpts );

fs.release();

This will store your keypoints in a file named keypoints.yml and the node containing the data is named "aNameYouLike". This will be used to read back the keypoints from the file:

  FileStorage fs2("keypoints.yml", FileStorage::READ);

Hi,

it's actually simple. In order to save your keypoints

 vector<Keypoint> mykpts;
 FileStorage fs("keypoints.yml", FileStorage::WRITE);
 write( fs , "aNameYouLike", mykpts );
 fs.release();

fs.release();

This will store your keypoints in a file named keypoints.yml and the node containing the data is named "aNameYouLike". This will be used to read back the keypoints from the file:

 vector<Keypoint> mykpts2;
  FileStorage fs2("keypoints.yml", FileStorage::READ);
  FileNode kptFileNode = fs2["aNameYouLike"];
  read( kptFileNode, mykpts2 );
  fs2.release();

You may want to check the XML/YAML file storage documentation for more information.

Hope it helps

S.