diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index 8f515c54dd..e00c849400 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -697,11 +697,11 @@ void write(FileStorage& fs, const String& name, const Range& r ) template static inline void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0)); + fs << (DataType<_Tp>::fmt != 0 ? "[:" : "["); write(fs, vec); + fs << "]"; } - static inline void read(const FileNode& node, bool& value, bool default_value) {