From b1851e2f1667c40ae6580622308534a0ce32ef2e Mon Sep 17 00:00:00 2001 From: Fangjun KUANG Date: Mon, 20 Feb 2017 16:22:46 +0100 Subject: [PATCH] Add support to print `cv::UMat`. Now a user can use `std::cout` to print an object of `cv::UMat` just like `cv::Mat`. --- 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..d08b72b333 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); } +static inline +std::ostream& operator << (std::ostream& out, const UMat& m) +{ + return out << m.getMat(ACCESS_READ); +} + template static inline std::ostream& operator << (std::ostream& out, const std::vector >& vec) {