Mat E = Mat::eye(2,2,CV_16F);
cout<<"默认风格:\n"<<E<<endl;
cout<<"默认风格:\n"<<format(E,Formatter::FMT_DEFAULT)<<endl;
cout<<"Python风格:\n"<<format(E,Formatter::FMT_PYTHON)<<endl;
cout<<"C风格:\n"<<format(E,Formatter::FMT_C)<<endl;
cout<<"CSV风格:\n"<<format(E,Formatter::FMT_CSV)<<endl;
cout<<"Matlab风格:\n"<<format(E,Formatter::FMT_MATLAB)<<endl;
cout<<"Numpy风格:\n"<<format(E,Formatter::FMT_NUMPY)<<endl;
默认风格:
[1, 0;
0, 1]
默认风格:
[1, 0;
0, 1]
Python风格:
[[1, 0],
[0, 1]]
C风格:
{1, 0,
0, 1}
CSV风格:
1, 0
0, 1
Matlab风格:
(:, :, 1) =
1, 0;
0, 1
Numpy风格:
array([[1, 0],
[0, 1]], dtype='float16')