Rewrite Mat formatting without std streams
This commit is contained in:
@@ -30,16 +30,16 @@ int main(int,char**)
|
||||
help();
|
||||
Mat I = Mat::eye(4, 4, CV_64F);
|
||||
I.at<double>(1,1) = CV_PI;
|
||||
cout << "I = " << I << ";" << endl;
|
||||
cout << "I = \n" << I << ";" << endl << endl;
|
||||
|
||||
Mat r = Mat(10, 3, CV_8UC3);
|
||||
randu(r, Scalar::all(0), Scalar::all(255));
|
||||
|
||||
cout << "r (default) = " << r << ";" << endl << endl;
|
||||
cout << "r (python) = " << format(r,"python") << ";" << endl << endl;
|
||||
cout << "r (numpy) = " << format(r,"numpy") << ";" << endl << endl;
|
||||
cout << "r (csv) = " << format(r,"csv") << ";" << endl << endl;
|
||||
cout << "r (c) = " << format(r,"C") << ";" << endl << endl;
|
||||
cout << "r (default) = \n" << r << ";" << endl << endl;
|
||||
cout << "r (python) = \n" << format(r, Formatter::FMT_PYTHON) << ";" << endl << endl;
|
||||
cout << "r (numpy) = \n" << format(r, Formatter::FMT_NUMPY) << ";" << endl << endl;
|
||||
cout << "r (csv) = \n" << format(r, Formatter::FMT_CSV) << ";" << endl << endl;
|
||||
cout << "r (c) = \n" << format(r, Formatter::FMT_C) << ";" << endl << endl;
|
||||
|
||||
Point2f p(5, 1);
|
||||
cout << "p = " << p << ";" << endl;
|
||||
|
@@ -59,10 +59,10 @@ int main(int,char**)
|
||||
|
||||
// Demonstrate the output formating options
|
||||
cout << "R (default) = " << endl << R << endl << endl;
|
||||
cout << "R (python) = " << endl << format(R,"python") << endl << endl;
|
||||
cout << "R (numpy) = " << endl << format(R,"numpy" ) << endl << endl;
|
||||
cout << "R (csv) = " << endl << format(R,"csv" ) << endl << endl;
|
||||
cout << "R (c) = " << endl << format(R,"C" ) << endl << endl;
|
||||
cout << "R (python) = " << endl << format(R, Formatter::FMT_PYTHON) << endl << endl;
|
||||
cout << "R (numpy) = " << endl << format(R, Formatter::FMT_NUMPY ) << endl << endl;
|
||||
cout << "R (csv) = " << endl << format(R, Formatter::FMT_CSV ) << endl << endl;
|
||||
cout << "R (c) = " << endl << format(R, Formatter::FMT_C ) << endl << endl;
|
||||
|
||||
Point2f P(5, 1);
|
||||
cout << "Point (2D) = " << P << endl << endl;
|
||||
|
Reference in New Issue
Block a user