FileNodeIterator not conformant with STL iterator interface
Hi,
I have this piece of code:
std::copy( fn.begin(), fn.end(), std::back_inserter( v ) );
where fn is a FileNode and v is and std::vector<cv::keypoint>.
I have the following error at compile time:
/usr/include/c++/4.7/bits/stl_iterator_base_types.h:166:53: error: no type named ‘iterator_category’ in ‘class cv::FileNodeIterator’
/usr/include/c++/4.7/bits/stl_iterator_base_types.h:167:53: error: no type named ‘value_type’ in ‘class cv::FileNodeIterator’
/usr/include/c++/4.7/bits/stl_iterator_base_types.h:168:53: error: no type named ‘difference_type’ in ‘class cv::FileNodeIterator’
/usr/include/c++/4.7/bits/stl_iterator_base_types.h:169:53: error: no type named ‘pointer’ in ‘class cv::FileNodeIterator’
/usr/include/c++/4.7/bits/stl_iterator_base_types.h:170:53: error: no type named ‘reference’ in ‘class cv::FileNodeIterator’
Shouldn't FileNodeIterator declare those typedefs?
Thanks!
http://answers.opencv.org/question/323/how-to-write-keypoints-into-document-of-txt/ http://answers.opencv.org/question/4040/to-save-vector-keypoint-to-file-using-builtin/ These links have a solution such that my low-level approach is not required, so this question can be close/delete. Sorry, and thanks!
Anyway, for some reason, I must use: cv::read( fs["keypoints"], keypoints ); because the extractor operator>> fails: fs["keypoints"] >> keypoints Is this behavior expected?
It seems some problem specific with std::vector<cv::KeyPoint>, since I have tried the same with a cv::Mat and it works: cv::Mat m; fs["m"] >> m;