FileStorage read/write for cv::Size,Rect,Vec (Bug #3196)
Description
FileStorage can write cv::Size,Rect,Vec fine but is unable to read them back in directly.
Either the attributes must be written separately then read back in and used with a constructor or they can be read as a std::vector.
eg.
// WRITE
cv::Size s(2,2);
cv::Vec3f v(1.,1.,1.);
cv::FileStorage fs;
fs.open("test.xml", cv::FileStorage::WRITE);
fs << "s" << s;
fs << "v" << v;
fs.release();
// READ
cv::FileStorage fs2;
fs2.open("test.xml", cv::FileStorage::READ);
cv::Size s;
cv::Vec3f v;
fs["s"] >> s; // this doesn't work
fs["v"] >> v; // neither does this
fs2.release();
/** test.xml **/
<opencv_storage>
<s>
2 2</s>
<v>
1. 1. 1.</v>
</opencv_storage>
Associated revisions
Added ability to read several opencv types (Size, Point, etc.) to FileStorage. Solves issue #3196
Merge pull request #3196 from PhilLab:patch-4
History
Updated by Victor Kocheganov over 11 years ago
Hello Kevin,
thanks for submitting this ticket. Unfortunately we have limited resources at the moment. So if you find time to implement this feature by yourself that would be great! (Please see http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute for details).
Thank you in advance,
Victor Kocheganov
- Category set to core
- Status changed from New to Open
- Target version set to 3.0-alpha
- Assignee set to Vadim Pisarevsky
Updated by Victor Kocheganov over 11 years ago
- Assignee changed from Vadim Pisarevsky to Roman Donchenko
Updated by Bahram Dahi over 11 years ago
Solved in pull request #1277. https://github.com/Itseez/opencv/pull/1277
- Target version changed from 3.0-alpha to 2.4.7
- % Done changed from 0 to 100
Updated by Bahram Dahi over 11 years ago
- Status changed from Open to Done