【发布时间】:2015-06-18 18:30:09
【问题描述】:
目前使用 OpenCV3,但在 OpenCV2 中,有一种方法可以格式化矩阵输出。在教程here中使用。
format 函数好像从 OpenCV2 中的 format(mat, str) 变成了 format(mat, int) OpenCV3。拨打此电话:
cout << "4x4: " << endl << format(fourByFour, "python") << endl;
产生以下错误:
error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
/usr/local/include/opencv2/core/operations.hpp:371:16: note: initializing argument 2 of ‘cv::Ptr<cv::Formatted>cv::format(cv::InputArray, int)Ptr<Formatted> format(InputArray mtx, int fmt)
我可以插入 int 以获得随机打印格式,但我假设在 OpenCV3 中,int fmt 是某种“CV_”宏,但我似乎无法在任何文档中找到它,也在operations.hpp。
会有人碰巧知道 fmt 的正确值吗?
【问题讨论】:
标签: c++ printing outputstream opencv3.0