diff --git a/modules/core/src/out.cpp b/modules/core/src/out.cpp index 2c6ba5396a..343fd0a0e1 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 ); } };