1. 程式人生 > >opencv 3.0 Mat 格式化輸出 cout

opencv 3.0 Mat 格式化輸出 cout

矩陣格式化輸出

    Mat img = (Mat_<double>(3,3) << 1, 2, 3, 4, 5, 6, 7, 8, 9);
    cout << "No-\n" << img << endl;
    cout << "c\n" << format(img,Formatter::FMT_C) << endl;
    cout << "csv\n" << format(img,Formatter::FMT_CSV) << endl;
    cout << "default\n" << format(img,Formatter::FMT_DEFAULT) << endl;
    cout << "matlab\n" << format(img,Formatter::FMT_MATLAB) << endl;
    cout << "numpy\n" << format(img,Formatter::FMT_NUMPY) << endl;
    cout << "python\n" << format(img,Formatter::FMT_PYTHON) << endl;