Bug Fix for Issue 6288
authorohnozzy <ohnozzy@gmail.com>
Sat, 9 Apr 2016 11:01:34 +0000 (19:01 +0800)
committerohnozzy <ohnozzy@gmail.com>
Tue, 12 Apr 2016 13:40:50 +0000 (21:40 +0800)
Added 2 inline functions in persistence.hpp
So that the '>>' operator works correctly for std::Vector<KeyPoint> and
std::Vector<DMatch>

modules/core/include/opencv2/core/persistence.hpp

index 17686dd..9cf3bca 100644 (file)
@@ -1130,6 +1130,23 @@ void operator >> (const FileNode& n, std::vector<_Tp>& vec)
     it >> vec;
 }
 
+/** @brief Reads KeyPoint from a file storage.
+*/
+//It needs special handling because it contains two types of fields, int & float.
+static inline
+void operator >> (const FileNode& n, std::vector<KeyPoint>& vec)
+{
+    read(n, vec);
+}
+/** @brief Reads DMatch from a file storage.
+*/
+//It needs special handling because it contains two types of fields, int & float.
+static inline
+void operator >> (const FileNode& n, std::vector<DMatch>& vec)
+{
+    read(n, vec);
+}
+
 //! @} FileNode
 
 //! @relates cv::FileNodeIterator