Skip to content

Commit a8a208e

Browse files
csukuangfjalalek
authored andcommitted
Merge pull request opencv#8208 from csukuangfj:complex_support
Add support for printing out cv::Complex. (opencv#8208) * Add support for printing out cv::Complex. * Conform to the format of std::complex. * Remove extra spaces. * Remove extra spaces.
1 parent 3fbaabc commit a8a208e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/core/include/opencv2/core/cvstd.inl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ std::ostream& operator << (std::ostream& out, const Mat& mtx)
183183
return out << Formatter::get()->format(mtx);
184184
}
185185

186+
template<typename _Tp> static inline
187+
std::ostream& operator << (std::ostream& out, const Complex<_Tp>& c)
188+
{
189+
return out << "(" << c.re << "," << c.im << ")";
190+
}
191+
186192
template<typename _Tp> static inline
187193
std::ostream& operator << (std::ostream& out, const std::vector<Point_<_Tp> >& vec)
188194
{

0 commit comments

Comments
 (0)