From a8a208e0fee106ab03ed4f2777320a20bdba8411 Mon Sep 17 00:00:00 2001 From: Fangjun KUANG Date: Wed, 15 Feb 2017 19:50:14 +0100 Subject: [PATCH] Merge pull request #8208 from csukuangfj:complex_support Add support for printing out cv::Complex. (#8208) * Add support for printing out cv::Complex. * Conform to the format of std::complex. * Remove extra spaces. * Remove extra spaces. --- modules/core/include/opencv2/core/cvstd.inl.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index 876def8254..55e35fe69b 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -183,6 +183,12 @@ std::ostream& operator << (std::ostream& out, const Mat& mtx) return out << Formatter::get()->format(mtx); } +template static inline +std::ostream& operator << (std::ostream& out, const Complex<_Tp>& c) +{ + return out << "(" << c.re << "," << c.im << ")"; +} + template static inline std::ostream& operator << (std::ostream& out, const std::vector >& vec) {