From 9dd962ca1abf8b784141806ef02d5a82a8ea44a9 Mon Sep 17 00:00:00 2001 From: ohnozzy Date: Sat, 9 Apr 2016 19:01:34 +0800 Subject: [PATCH] Bug Fix for Issue 6288 Added 2 inline functions in persistence.hpp So that the '>>' operator works correctly for std::Vector and std::Vector --- modules/core/include/opencv2/core/persistence.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index 17686dd..9cf3bca 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -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& 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& vec) +{ + read(n, vec); +} + //! @} FileNode //! @relates cv::FileNodeIterator -- 2.7.4