Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unknown dot on using FileStorage to write Mat

I am using the following code to store Mat(SURF features) to a file

  cv::Mat descriptors;
  featureExtractor->compute(image, keypoints, descriptors);
  FileStorage fs("features.yml", FileStorage::WRITE);
  fs<<"oriimage"<<descriptors;

for reading the file, I use

FileStorage fs;
fs.open("features.yml", FileStorage::READ);
Mat m;
fs["oriimage"] >> m;

The Mat is stored and read as: {3., 6., 0., 0., 0., 0., 3., 2., 0., 0., 34.} //Note the .(dot) at the end of each number

while before storing if I do cout << descriptors, it prints the same numbers without the dots.

What is wrong with my code ?

click to hide/show revision 2
hope you don't mind me removing the hashes, they only lead to abnnoying duplicate tags, thank you!

updated 2013-09-06 11:42:53 -0600

berak gravatar image

unknown dot on using FileStorage to write Mat

I am using the following code to store Mat(SURF features) to a file

  cv::Mat descriptors;
  featureExtractor->compute(image, keypoints, descriptors);
  FileStorage fs("features.yml", FileStorage::WRITE);
  fs<<"oriimage"<<descriptors;

for reading the file, I use

FileStorage fs;
fs.open("features.yml", FileStorage::READ);
Mat m;
fs["oriimage"] >> m;

The Mat is stored and read as: {3., 6., 0., 0., 0., 0., 3., 2., 0., 0., 34.} //Note the .(dot) at the end of each number

while before storing if I do cout << descriptors, it prints the same numbers without the dots.

What is wrong with my code ?