c++ - format() 中 int fmt 的值

标签 c++ printing outputstream opencv3.0

目前使用 OpenCV3,但在 OpenCV2 中,有一种格式化矩阵输出的方法。它在教程中使用 here .

format函数好像从OpenCV2的format(mat, str)变成了OpenCV3的format(mat, int)。进行此调用:

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)           

我可以插入整数以获得随机打印格式,但我假设在 OpenCV3 中,int fmt 是某种“CV_”宏,但我似乎无法在任何文档中找到它,也没有在 operations.hpp .

有人会碰巧知道 fmt 的正确值吗?

最佳答案

刚看了GitHub上的代码,看来你要找的常量是cv::Formatter::FMT_PYTHON。可以看到代码here .

关于c++ - format() 中 int fmt 的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30923051/

相关文章:

c++ - 重复执行 lambda 函数

python - 使用 Brother P950NW 的全页宽度

iOS 打印到网络上的打印机

java - 如何从java代码将键盘功能键发送到SSH服务器

Android 蓝牙 : java. io.IOException: 服务发现失败

c++ - decltype 不解析嵌套 vector 。如何使用嵌套 vector 的模板?

c++ - Lotus Notes Automation:Notes.NotesSession 没有实现 Domino::ISession?

c++ - 在 C++ Firemonkey 平台中克隆对象

c++ - 如何查看gdb内部智能指针的内部数据?

java - 为什么 openFileOutput 需要一个 try catch block ?