【问题标题】:The values of int fmt in format()format() 中 int fmt 的值
【发布时间】: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


    【解决方案1】:

    刚看了github上的代码,貌似你要找的常量是cv::Formatter::FMT_PYTHON。可以看代码here

    【讨论】:

      猜你喜欢
      • 2021-12-19
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 2021-08-04
      • 1970-01-01
      • 2022-01-13
      • 2022-12-29
      相关资源
      最近更新 更多