Skip to content

Commit b1851e2

Browse files
authored
Add support to print cv::UMat.
Now a user can use `std::cout` to print an object of `cv::UMat` just like `cv::Mat`.
1 parent 47ae5f1 commit b1851e2

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+
static inline
187+
std::ostream& operator << (std::ostream& out, const UMat& m)
188+
{
189+
return out << m.getMat(ACCESS_READ);
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)