Opencv打印显示Mat方法

您所在的位置:网站首页 python打印矩阵全部数据 Opencv打印显示Mat方法

Opencv打印显示Mat方法

2024-07-09 12:22| 来源: 网络整理| 查看: 265

Opencv打印Mat几种方法

1:使用CV:format函数

使用Opencv 提供的format()API接口:

static inline Ptr format(InputArray mtx, int fmt)

其中mtx为Mat 数据,fmt为所支持的打印打印风格,其参数可以为以下:

Formatter::FMT_C:C风格打印

Formatter::FMT_NUMPY: numpy风格打印

Formatter::FMT_CSV:逗号打印

Formatter::FMT_PYTHON: python打印

该方法仅支持二维打印,使用用例如下:

#include #include "opencv2/opencv.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" using namespace cv; using namespace std; void main() { Mat M(2, 2, CV_8UC3, Scalar(110, 0, 255)); cout


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3