From b02fc039cd8dae0987644e6579e0a176f93c022d Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Fri, 17 Apr 2015 17:42:24 +0200 Subject: [PATCH] fix python and numpy output formatters --- modules/core/src/out.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/src/out.cpp b/modules/core/src/out.cpp index 2c6ba5396..343fd0a0e 100644 --- a/modules/core/src/out.cpp +++ b/modules/core/src/out.cpp @@ -309,7 +309,7 @@ namespace cv Ptr format(const Mat& mtx) const { - char braces[5] = {'[', ']', '\0', '[', ']'}; + char braces[5] = {'[', ']', ',', '[', ']'}; if (mtx.cols == 1) braces[0] = braces[1] = '\0'; return makePtr("[", "]", mtx, &*braces, @@ -327,11 +327,11 @@ namespace cv { "uint8", "int8", "uint16", "int16", "int32", "float32", "float64", "uint64" }; - char braces[5] = {'[', ']', '\0', '[', ']'}; + char braces[5] = {'[', ']', ',', '[', ']'}; if (mtx.cols == 1) braces[0] = braces[1] = '\0'; return makePtr("array([", - cv::format("], type='%s')", numpyTypes[mtx.depth()]), mtx, &*braces, + cv::format("], dtype='%s')", numpyTypes[mtx.depth()]), mtx, &*braces, mtx.rows == 1 || !multiline, false, mtx.depth() == CV_64F ? prec64f : prec32f ); } };